athena-ui-js 2.0.0 → 2.1.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.
Files changed (83) hide show
  1. package/README.md +47 -5
  2. package/docs/migration-2.0.md +1 -1
  3. package/docs/styling.md +3 -1
  4. package/package.json +5 -2
  5. package/src/athena-ui.js +1 -1
  6. package/src/libs/config/config.js +1 -1
  7. package/src/libs/core/popover.js +96 -0
  8. package/src/libs/hephaestus/chartGenerator/chartGenerator.js +26 -2
  9. package/src/libs/hephaestus/componentGenerator/componentGenerator.js +26 -2
  10. package/src/libs/hephaestus/navigationGenerator/navigationGenerator.js +45 -9
  11. package/src/res/themes/default/style.css +32 -0
  12. package/types/athena-ui.d.ts +96 -96
  13. package/types/chart.d.ts +1 -1
  14. package/types/classic.d.ts +1 -1
  15. package/types/components.d.ts +1 -1
  16. package/types/controls.d.ts +3 -3
  17. package/types/csv.d.ts +1 -1
  18. package/types/dialog.d.ts +2 -2
  19. package/types/dom.d.ts +1 -1
  20. package/types/feedback.d.ts +1 -1
  21. package/types/format.d.ts +1 -1
  22. package/types/forms.d.ts +2 -2
  23. package/types/i18n.d.ts +1 -1
  24. package/types/inputs.d.ts +4 -4
  25. package/types/libs/config/config.d.ts +3 -3
  26. package/types/libs/config/hooks.d.ts +8 -8
  27. package/types/libs/core/combobox.d.ts +10 -10
  28. package/types/libs/core/controls.d.ts +28 -28
  29. package/types/libs/core/cookies.d.ts +27 -27
  30. package/types/libs/core/csv.d.ts +12 -12
  31. package/types/libs/core/dateRange.d.ts +72 -72
  32. package/types/libs/core/dom.d.ts +65 -65
  33. package/types/libs/core/elementGenerator.d.ts +30 -30
  34. package/types/libs/core/errors.d.ts +29 -29
  35. package/types/libs/core/focus.d.ts +6 -6
  36. package/types/libs/core/format.d.ts +21 -21
  37. package/types/libs/core/hungarianControls.d.ts +2 -2
  38. package/types/libs/core/i18n.d.ts +17 -17
  39. package/types/libs/core/pagination.d.ts +5 -5
  40. package/types/libs/core/popover.d.ts +36 -0
  41. package/types/libs/core/sanitize.d.ts +6 -6
  42. package/types/libs/core/tableMath.d.ts +26 -26
  43. package/types/libs/core/theme.d.ts +39 -39
  44. package/types/libs/core/validation.d.ts +56 -56
  45. package/types/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.d.ts +10 -10
  46. package/types/libs/hephaestus/LayoutGenerator/footerContentGenerator.d.ts +4 -4
  47. package/types/libs/hephaestus/LayoutGenerator/headerContentGenerator.d.ts +20 -20
  48. package/types/libs/hephaestus/LayoutGenerator/wrapperContentGenerator.d.ts +1 -1
  49. package/types/libs/hephaestus/MenuGenerator/basicMenuGenerator.d.ts +14 -14
  50. package/types/libs/hephaestus/MenuGenerator/menuGenerator.d.ts +65 -65
  51. package/types/libs/hephaestus/auth/authState.d.ts +26 -26
  52. package/types/libs/hephaestus/auth/session.d.ts +26 -26
  53. package/types/libs/hephaestus/chartGenerator/chartGenerator.d.ts +93 -91
  54. package/types/libs/hephaestus/componentGenerator/componentGenerator.d.ts +3 -1
  55. package/types/libs/hephaestus/componentGenerator/themePicker.d.ts +24 -24
  56. package/types/libs/hephaestus/dialogGenerator/dialogGenerator.d.ts +120 -120
  57. package/types/libs/hephaestus/feedbackGenerator/feedbackGenerator.d.ts +86 -86
  58. package/types/libs/hephaestus/formGenerator/authForms.d.ts +122 -122
  59. package/types/libs/hephaestus/formGenerator/changePasswordFormGenerator.d.ts +6 -6
  60. package/types/libs/hephaestus/formGenerator/formBuilder.d.ts +113 -113
  61. package/types/libs/hephaestus/formGenerator/formUtils.d.ts +8 -8
  62. package/types/libs/hephaestus/formGenerator/loginFormGenerator.d.ts +11 -11
  63. package/types/libs/hephaestus/formGenerator/lostPasswordFormGenerator.d.ts +4 -4
  64. package/types/libs/hephaestus/formGenerator/registrationFormGenerator.d.ts +7 -7
  65. package/types/libs/hephaestus/hephaestus.d.ts +3 -3
  66. package/types/libs/hephaestus/inputGenerator/dropZoneGenerator.d.ts +48 -48
  67. package/types/libs/hephaestus/inputGenerator/inputGenerator.d.ts +185 -185
  68. package/types/libs/hephaestus/inputGenerator/richTextGenerator.d.ts +49 -49
  69. package/types/libs/hephaestus/modalGenerator/modalGenerator.d.ts +2 -2
  70. package/types/libs/hephaestus/navigationGenerator/navigationGenerator.d.ts +4 -1
  71. package/types/libs/hephaestus/router/matchRoute.d.ts +12 -12
  72. package/types/libs/hephaestus/router/router.d.ts +67 -67
  73. package/types/libs/hephaestus/tableGenerator/tableGenerator.d.ts +120 -120
  74. package/types/menu.d.ts +1 -1
  75. package/types/navigation.d.ts +1 -1
  76. package/types/res/themes/themes.d.ts +7 -7
  77. package/types/router.d.ts +1 -1
  78. package/types/sanitize.d.ts +1 -1
  79. package/types/session.d.ts +3 -3
  80. package/types/table.d.ts +1 -1
  81. package/types/testing.d.ts +27 -27
  82. package/types/theme.d.ts +2 -2
  83. package/types/validation.d.ts +1 -1
@@ -1,96 +1,96 @@
1
- /**
2
- * Loads the theme, waits for the page and generates the layout.
3
- *
4
- * @param {object} [options]
5
- * @param {{id?: number, href?: string}} [options.theme] registered theme id or custom stylesheet
6
- * @param {object} [options.config] settings overriding the defaults (and the global appConfig)
7
- * @param {Function} [options.nav] navigation callback (falls back to the global nav)
8
- * @param {Function} [options.login] login callback (falls back to the global login)
9
- * @param {Function} [options.register] registration callback (falls back to the global register)
10
- * @param {Function} [options.lostPassword] lost password callback (falls back to the global lostPassword)
11
- * @param {Function} [options.changePassword] change password callback (falls back to the global changePassword)
12
- * @param {object} [options.menuItems] { headerMenu, footerMenu } (falls back to the global menuItems)
13
- * @returns {Promise<object>} the effective configuration
14
- */
15
- export function init(options?: {
16
- theme?: {
17
- id?: number;
18
- href?: string;
19
- };
20
- config?: object;
21
- nav?: Function;
22
- login?: Function;
23
- register?: Function;
24
- lostPassword?: Function;
25
- changePassword?: Function;
26
- menuItems?: object;
27
- }): Promise<object>;
28
- /**
29
- * Starts Athena UI inside an element of your page instead of the body, so it can be one part of a larger page (or of several apps).
30
- * It does what init() does (settings, language, theme, hooks), and the layout (container, header, wrapper, footer) is generated into
31
- * `root`. The parts follow the settings: `config: { generateHeader: false, generateFooter: false }` leaves only the wrapper, which is where
32
- * the components go by default (the element with the id "wrapper"). One app per page: the parts have fixed ids.
33
- *
34
- * @param {object} options the options of init(), and
35
- * @param {string|Element} options.root the element to build into (an element, an id or a selector)
36
- * @returns {Promise<{element: HTMLElement, container: HTMLElement, header: HTMLElement|null, wrapper: HTMLElement|null, footer: HTMLElement|null,
37
- * config: object, update: Function, destroy: Function}>}
38
- */
39
- export function createApp(options?: {
40
- root: string | Element;
41
- }): Promise<{
42
- element: HTMLElement;
43
- container: HTMLElement;
44
- header: HTMLElement | null;
45
- wrapper: HTMLElement | null;
46
- footer: HTMLElement | null;
47
- config: object;
48
- update: Function;
49
- destroy: Function;
50
- }>;
51
- /**
52
- * Switches the theme at runtime: { id } of a registered theme or { href } of a stylesheet.
53
- * @returns {Promise<object>} the applied theme
54
- */
55
- export function setTheme(selected: any): Promise<object>;
56
- export { default as Cookies } from "./libs/core/cookies.js";
57
- export * from "./libs/core/elementGenerator.js";
58
- export * from "./libs/core/controls.js";
59
- export * from "./libs/core/hungarianControls.js";
60
- export * from "./libs/hephaestus/LayoutGenerator/basicLayoutGenerator.js";
61
- export * from "./libs/hephaestus/LayoutGenerator/headerContentGenerator.js";
62
- export * from "./libs/hephaestus/LayoutGenerator/wrapperContentGenerator.js";
63
- export * from "./libs/hephaestus/LayoutGenerator/footerContentGenerator.js";
64
- export * from "./libs/hephaestus/MenuGenerator/basicMenuGenerator.js";
65
- export * from "./libs/hephaestus/MenuGenerator/menuGenerator.js";
66
- export * from "./libs/hephaestus/formGenerator/loginFormGenerator.js";
67
- export * from "./libs/hephaestus/formGenerator/registrationFormGenerator.js";
68
- export * from "./libs/hephaestus/formGenerator/lostPasswordFormGenerator.js";
69
- export * from "./libs/hephaestus/chartGenerator/chartGenerator.js";
70
- export * from "./libs/hephaestus/tableGenerator/tableGenerator.js";
71
- export * from "./libs/hephaestus/formGenerator/changePasswordFormGenerator.js";
72
- export * from "./libs/hephaestus/formGenerator/formBuilder.js";
73
- export * from "./libs/hephaestus/formGenerator/authForms.js";
74
- export * from "./libs/hephaestus/feedbackGenerator/feedbackGenerator.js";
75
- export * from "./libs/hephaestus/dialogGenerator/dialogGenerator.js";
76
- export * from "./libs/hephaestus/navigationGenerator/navigationGenerator.js";
77
- export * from "./libs/hephaestus/componentGenerator/componentGenerator.js";
78
- export * from "./libs/hephaestus/inputGenerator/inputGenerator.js";
79
- export * from "./libs/hephaestus/inputGenerator/dropZoneGenerator.js";
80
- export * from "./libs/hephaestus/inputGenerator/richTextGenerator.js";
81
- export * from "./libs/core/sanitize.js";
82
- export * from "./libs/hephaestus/router/router.js";
83
- export * from "./libs/hephaestus/auth/session.js";
84
- export * from "./libs/hephaestus/auth/authState.js";
85
- export * from "./libs/core/i18n.js";
86
- export * from "./libs/core/validation.js";
87
- export * from "./libs/core/csv.js";
88
- export * from "./libs/core/dateRange.js";
89
- export * from "./libs/core/format.js";
90
- export * from "./libs/hephaestus/modalGenerator/modalGenerator.js";
91
- export * from "./libs/core/theme.js";
92
- export * from "./libs/hephaestus/componentGenerator/themePicker.js";
93
- import config from "./libs/config/config.js";
94
- import { loadScript } from "./libs/hephaestus/hephaestus.js";
95
- export { config, loadScript };
96
- export { el, setContent, resolveElement, asHandle, createSafeBuilder } from "./libs/core/dom.js";
1
+ /**
2
+ * Loads the theme, waits for the page and generates the layout.
3
+ *
4
+ * @param {object} [options]
5
+ * @param {{id?: number, href?: string}} [options.theme] registered theme id or custom stylesheet
6
+ * @param {object} [options.config] settings overriding the defaults (and the global appConfig)
7
+ * @param {Function} [options.nav] navigation callback (falls back to the global nav)
8
+ * @param {Function} [options.login] login callback (falls back to the global login)
9
+ * @param {Function} [options.register] registration callback (falls back to the global register)
10
+ * @param {Function} [options.lostPassword] lost password callback (falls back to the global lostPassword)
11
+ * @param {Function} [options.changePassword] change password callback (falls back to the global changePassword)
12
+ * @param {object} [options.menuItems] { headerMenu, footerMenu } (falls back to the global menuItems)
13
+ * @returns {Promise<object>} the effective configuration
14
+ */
15
+ export function init(options?: {
16
+ theme?: {
17
+ id?: number;
18
+ href?: string;
19
+ };
20
+ config?: object;
21
+ nav?: Function;
22
+ login?: Function;
23
+ register?: Function;
24
+ lostPassword?: Function;
25
+ changePassword?: Function;
26
+ menuItems?: object;
27
+ }): Promise<object>;
28
+ /**
29
+ * Starts Athena UI inside an element of your page instead of the body, so it can be one part of a larger page (or of several apps).
30
+ * It does what init() does (settings, language, theme, hooks), and the layout (container, header, wrapper, footer) is generated into
31
+ * `root`. The parts follow the settings: `config: { generateHeader: false, generateFooter: false }` leaves only the wrapper, which is where
32
+ * the components go by default (the element with the id "wrapper"). One app per page: the parts have fixed ids.
33
+ *
34
+ * @param {object} options the options of init(), and
35
+ * @param {string|Element} options.root the element to build into (an element, an id or a selector)
36
+ * @returns {Promise<{element: HTMLElement, container: HTMLElement, header: HTMLElement|null, wrapper: HTMLElement|null, footer: HTMLElement|null,
37
+ * config: object, update: Function, destroy: Function}>}
38
+ */
39
+ export function createApp(options?: {
40
+ root: string | Element;
41
+ }): Promise<{
42
+ element: HTMLElement;
43
+ container: HTMLElement;
44
+ header: HTMLElement | null;
45
+ wrapper: HTMLElement | null;
46
+ footer: HTMLElement | null;
47
+ config: object;
48
+ update: Function;
49
+ destroy: Function;
50
+ }>;
51
+ /**
52
+ * Switches the theme at runtime: { id } of a registered theme or { href } of a stylesheet.
53
+ * @returns {Promise<object>} the applied theme
54
+ */
55
+ export function setTheme(selected: any): Promise<object>;
56
+ export { default as Cookies } from "./libs/core/cookies.js";
57
+ export * from "./libs/core/elementGenerator.js";
58
+ export * from "./libs/core/controls.js";
59
+ export * from "./libs/core/hungarianControls.js";
60
+ export * from "./libs/hephaestus/LayoutGenerator/basicLayoutGenerator.js";
61
+ export * from "./libs/hephaestus/LayoutGenerator/headerContentGenerator.js";
62
+ export * from "./libs/hephaestus/LayoutGenerator/wrapperContentGenerator.js";
63
+ export * from "./libs/hephaestus/LayoutGenerator/footerContentGenerator.js";
64
+ export * from "./libs/hephaestus/MenuGenerator/basicMenuGenerator.js";
65
+ export * from "./libs/hephaestus/MenuGenerator/menuGenerator.js";
66
+ export * from "./libs/hephaestus/formGenerator/loginFormGenerator.js";
67
+ export * from "./libs/hephaestus/formGenerator/registrationFormGenerator.js";
68
+ export * from "./libs/hephaestus/formGenerator/lostPasswordFormGenerator.js";
69
+ export * from "./libs/hephaestus/chartGenerator/chartGenerator.js";
70
+ export * from "./libs/hephaestus/tableGenerator/tableGenerator.js";
71
+ export * from "./libs/hephaestus/formGenerator/changePasswordFormGenerator.js";
72
+ export * from "./libs/hephaestus/formGenerator/formBuilder.js";
73
+ export * from "./libs/hephaestus/formGenerator/authForms.js";
74
+ export * from "./libs/hephaestus/feedbackGenerator/feedbackGenerator.js";
75
+ export * from "./libs/hephaestus/dialogGenerator/dialogGenerator.js";
76
+ export * from "./libs/hephaestus/navigationGenerator/navigationGenerator.js";
77
+ export * from "./libs/hephaestus/componentGenerator/componentGenerator.js";
78
+ export * from "./libs/hephaestus/inputGenerator/inputGenerator.js";
79
+ export * from "./libs/hephaestus/inputGenerator/dropZoneGenerator.js";
80
+ export * from "./libs/hephaestus/inputGenerator/richTextGenerator.js";
81
+ export * from "./libs/core/sanitize.js";
82
+ export * from "./libs/hephaestus/router/router.js";
83
+ export * from "./libs/hephaestus/auth/session.js";
84
+ export * from "./libs/hephaestus/auth/authState.js";
85
+ export * from "./libs/core/i18n.js";
86
+ export * from "./libs/core/validation.js";
87
+ export * from "./libs/core/csv.js";
88
+ export * from "./libs/core/dateRange.js";
89
+ export * from "./libs/core/format.js";
90
+ export * from "./libs/hephaestus/modalGenerator/modalGenerator.js";
91
+ export * from "./libs/core/theme.js";
92
+ export * from "./libs/hephaestus/componentGenerator/themePicker.js";
93
+ import config from "./libs/config/config.js";
94
+ import { loadScript } from "./libs/hephaestus/hephaestus.js";
95
+ export { config, loadScript };
96
+ export { el, setContent, resolveElement, asHandle, createSafeBuilder } from "./libs/core/dom.js";
package/types/chart.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./libs/hephaestus/chartGenerator/chartGenerator.js";
1
+ export * from "./libs/hephaestus/chartGenerator/chartGenerator.js";
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export * from "./libs/hephaestus/componentGenerator/componentGenerator.js";
1
+ export * from "./libs/hephaestus/componentGenerator/componentGenerator.js";
@@ -1,3 +1,3 @@
1
- export * from "./libs/core/elementGenerator.js";
2
- export * from "./libs/core/controls.js";
3
- export * from "./libs/core/hungarianControls.js";
1
+ export * from "./libs/core/elementGenerator.js";
2
+ export * from "./libs/core/controls.js";
3
+ export * from "./libs/core/hungarianControls.js";
package/types/csv.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./libs/core/csv.js";
1
+ export * from "./libs/core/csv.js";
package/types/dialog.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./libs/hephaestus/dialogGenerator/dialogGenerator.js";
2
- export * from "./libs/hephaestus/modalGenerator/modalGenerator.js";
1
+ export * from "./libs/hephaestus/dialogGenerator/dialogGenerator.js";
2
+ export * from "./libs/hephaestus/modalGenerator/modalGenerator.js";
package/types/dom.d.ts CHANGED
@@ -1 +1 @@
1
- export { el, setContent, resolveElement, asHandle, createSafeBuilder } from "./libs/core/dom.js";
1
+ export { el, setContent, resolveElement, asHandle, createSafeBuilder } from "./libs/core/dom.js";
@@ -1 +1 @@
1
- export * from "./libs/hephaestus/feedbackGenerator/feedbackGenerator.js";
1
+ export * from "./libs/hephaestus/feedbackGenerator/feedbackGenerator.js";
package/types/format.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./libs/core/format.js";
1
+ export * from "./libs/core/format.js";
package/types/forms.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./libs/hephaestus/formGenerator/formBuilder.js";
2
- export * from "./libs/hephaestus/formGenerator/authForms.js";
1
+ export * from "./libs/hephaestus/formGenerator/formBuilder.js";
2
+ export * from "./libs/hephaestus/formGenerator/authForms.js";
package/types/i18n.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./libs/core/i18n.js";
1
+ export * from "./libs/core/i18n.js";
package/types/inputs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./libs/hephaestus/inputGenerator/inputGenerator.js";
2
- export * from "./libs/hephaestus/inputGenerator/dropZoneGenerator.js";
3
- export * from "./libs/hephaestus/inputGenerator/richTextGenerator.js";
4
- export * from "./libs/core/dateRange.js";
1
+ export * from "./libs/hephaestus/inputGenerator/inputGenerator.js";
2
+ export * from "./libs/hephaestus/inputGenerator/dropZoneGenerator.js";
3
+ export * from "./libs/hephaestus/inputGenerator/richTextGenerator.js";
4
+ export * from "./libs/core/dateRange.js";
@@ -1,5 +1,5 @@
1
1
  export function applyConfig(...sources: any[]): {
2
- version: "2.0.0";
2
+ version: "2.1.0";
3
3
  container_class: "container";
4
4
  header_class: "header-container";
5
5
  header_menu_class: "header-menu menu";
@@ -32,7 +32,7 @@ export function applyConfig(...sources: any[]): {
32
32
  export function withBorder(className: any): any;
33
33
  export const BORDERED_CLASS: "default-cointainer-bordered";
34
34
  export const defaults: Readonly<{
35
- version: "2.0.0";
35
+ version: "2.1.0";
36
36
  container_class: "container";
37
37
  header_class: "header-container";
38
38
  header_menu_class: "header-menu menu";
@@ -64,7 +64,7 @@ export const defaults: Readonly<{
64
64
  }>;
65
65
  export default config;
66
66
  declare namespace config {
67
- let version: "2.0.0";
67
+ let version: "2.1.0";
68
68
  let container_class: "container";
69
69
  let header_class: "header-container";
70
70
  let header_menu_class: "header-menu menu";
@@ -1,8 +1,8 @@
1
- export function setHooks(options?: {}): void;
2
- export function getAppConfig(): any;
3
- export function getMenuItems(): any;
4
- export function getNav(): any;
5
- export function getLogin(): any;
6
- export function getRegister(): any;
7
- export function getLostPassword(): any;
8
- export function getChangePassword(): any;
1
+ export function setHooks(options?: {}): void;
2
+ export function getAppConfig(): any;
3
+ export function getMenuItems(): any;
4
+ export function getNav(): any;
5
+ export function getLogin(): any;
6
+ export function getRegister(): any;
7
+ export function getLostPassword(): any;
8
+ export function getChangePassword(): any;
@@ -1,10 +1,10 @@
1
- /**
2
- * Internal: input with a suggestion list. Single mode is an autocomplete, multiple mode a tag selector.
3
- * `source` is an array of options, or a function (query) => options | Promise<options>.
4
- */
5
- export function createCombobox(options?: {}): {
6
- element: HTMLElement;
7
- input: HTMLElement;
8
- getValue: () => any;
9
- setValue: (value: any) => void;
10
- };
1
+ /**
2
+ * Internal: input with a suggestion list. Single mode is an autocomplete, multiple mode a tag selector.
3
+ * `source` is an array of options, or a function (query) => options | Promise<options>.
4
+ */
5
+ export function createCombobox(options?: {}): {
6
+ element: HTMLElement;
7
+ input: HTMLElement;
8
+ getValue: () => any;
9
+ setValue: (value: any) => void;
10
+ };
@@ -1,28 +1,28 @@
1
- /** Builds the control described by `options` without appending it. Returns the element, or null (an error is reported). */
2
- export function buildControl(options: any): any;
3
- /**
4
- * Registers a new input type. `factory(options)` returns the element to append.
5
- * Addons use this to plug in their controls, see registerHungarianInputControls.
6
- */
7
- export function registerControl(inputType: any, factory: any): void;
8
- /**
9
- * Builds a control from `{ inputType, id, class, name, value, items, onclick, onchange, ... }` and appends it to the element given as
10
- * `parent` (an id or an element; without one, to the body).
11
- *
12
- * @returns {HTMLElement|undefined} the control, or undefined when the input type is not known
13
- */
14
- export function generateControl(options?: {}): HTMLElement | undefined;
15
- /**
16
- * The HTMLControlGenerator of the standalone project (0.4.1), so code written for it keeps working.
17
- * `HTMLControlGenerator(options)` builds the control and appends it to the element with the id `options.parent`
18
- * (an unknown id appends it, in a div, to the body). It is also a global once Athena UI is loaded.
19
- */
20
- export function HTMLControlGenerator(options: any): void;
21
- export namespace HTMLControlGenerator {
22
- /**
23
- * Builds the control without appending it and returns the element (the standalone project returned a jQuery object: wrap it yourself with
24
- * `$(HTMLControlGenerator.create(options))` if you still need one). Undefined when the options are not valid.
25
- */
26
- export function create(options: any): any;
27
- export { registerControl as register };
28
- }
1
+ /** Builds the control described by `options` without appending it. Returns the element, or null (an error is reported). */
2
+ export function buildControl(options: any): any;
3
+ /**
4
+ * Registers a new input type. `factory(options)` returns the element to append.
5
+ * Addons use this to plug in their controls, see registerHungarianInputControls.
6
+ */
7
+ export function registerControl(inputType: any, factory: any): void;
8
+ /**
9
+ * Builds a control from `{ inputType, id, class, name, value, items, onclick, onchange, ... }` and appends it to the element given as
10
+ * `parent` (an id or an element; without one, to the body).
11
+ *
12
+ * @returns {HTMLElement|undefined} the control, or undefined when the input type is not known
13
+ */
14
+ export function generateControl(options?: {}): HTMLElement | undefined;
15
+ /**
16
+ * The HTMLControlGenerator of the standalone project (0.4.1), so code written for it keeps working.
17
+ * `HTMLControlGenerator(options)` builds the control and appends it to the element with the id `options.parent`
18
+ * (an unknown id appends it, in a div, to the body). It is also a global once Athena UI is loaded.
19
+ */
20
+ export function HTMLControlGenerator(options: any): void;
21
+ export namespace HTMLControlGenerator {
22
+ /**
23
+ * Builds the control without appending it and returns the element (the standalone project returned a jQuery object: wrap it yourself with
24
+ * `$(HTMLControlGenerator.create(options))` if you still need one). Undefined when the options are not valid.
25
+ */
26
+ export function create(options: any): any;
27
+ export { registerControl as register };
28
+ }
@@ -1,27 +1,27 @@
1
- export default Cookies;
2
- export namespace Cookies {
3
- export { get };
4
- export { set };
5
- export { remove };
6
- }
7
- /** The value of a cookie, or undefined. Without a name: all cookies as an object. */
8
- declare function get(name: any): any;
9
- /**
10
- * @param {string} name
11
- * @param {string} value
12
- * @param {object} [attributes]
13
- * @param {number|Date} [attributes.expires] days from now, or a Date. Without it the cookie ends with the browser session.
14
- * @param {string} [attributes.path="/"]
15
- * @param {string} [attributes.domain]
16
- * @param {"strict"|"lax"|"none"} [attributes.sameSite]
17
- * @param {boolean} [attributes.secure]
18
- */
19
- declare function set(name: string, value: string, attributes?: {
20
- expires?: number | Date;
21
- path?: string;
22
- domain?: string;
23
- sameSite?: "strict" | "lax" | "none";
24
- secure?: boolean;
25
- }): void;
26
- /** Removes a cookie. Give the same path, domain and sameSite it was set with. */
27
- declare function remove(name: any, attributes?: {}): void;
1
+ export default Cookies;
2
+ export namespace Cookies {
3
+ export { get };
4
+ export { set };
5
+ export { remove };
6
+ }
7
+ /** The value of a cookie, or undefined. Without a name: all cookies as an object. */
8
+ declare function get(name: any): any;
9
+ /**
10
+ * @param {string} name
11
+ * @param {string} value
12
+ * @param {object} [attributes]
13
+ * @param {number|Date} [attributes.expires] days from now, or a Date. Without it the cookie ends with the browser session.
14
+ * @param {string} [attributes.path="/"]
15
+ * @param {string} [attributes.domain]
16
+ * @param {"strict"|"lax"|"none"} [attributes.sameSite]
17
+ * @param {boolean} [attributes.secure]
18
+ */
19
+ declare function set(name: string, value: string, attributes?: {
20
+ expires?: number | Date;
21
+ path?: string;
22
+ domain?: string;
23
+ sameSite?: "strict" | "lax" | "none";
24
+ secure?: boolean;
25
+ }): void;
26
+ /** Removes a cookie. Give the same path, domain and sameSite it was set with. */
27
+ declare function remove(name: any, attributes?: {}): void;
@@ -1,12 +1,12 @@
1
- /**
2
- * Converts rows to CSV text (RFC 4180 quoting, CRLF line ends).
3
- *
4
- * @param {{key: string, label?: string}[]} columns
5
- * @param {object[]} rows
6
- * @param {string} [separator=","]
7
- */
8
- export function toCsv(columns: {
9
- key: string;
10
- label?: string;
11
- }[], rows: object[], separator?: string): string;
12
- export function downloadFile(filename: any, text: any, type?: string): void;
1
+ /**
2
+ * Converts rows to CSV text (RFC 4180 quoting, CRLF line ends).
3
+ *
4
+ * @param {{key: string, label?: string}[]} columns
5
+ * @param {object[]} rows
6
+ * @param {string} [separator=","]
7
+ */
8
+ export function toCsv(columns: {
9
+ key: string;
10
+ label?: string;
11
+ }[], rows: object[], separator?: string): string;
12
+ export function downloadFile(filename: any, text: any, type?: string): void;
@@ -1,72 +1,72 @@
1
- /**
2
- * Internal: two native date inputs (from / to). The "to" picker starts at the chosen start date.
3
- * Values are ISO dates ("2026-01-31"), an empty date is "".
4
- */
5
- export function createDateRange(options?: {}): {
6
- element: HTMLElement;
7
- inputs: HTMLElement[];
8
- getValue: () => {
9
- from: any;
10
- to: any;
11
- };
12
- setValue: (value: any) => void;
13
- validate: () => any;
14
- };
15
- /** A Date as the value of a datetime-local input, in the local time of the person: "2026-11-19T10:30". */
16
- export function toLocalInput(date: any, seconds?: boolean): string;
17
- /** The value of a datetime-local input as a Date (local time), or null when it is empty or not valid. */
18
- export function fromLocalInput(value: any): Date;
19
- /**
20
- * Internal: two datetime-local inputs and a list of presets (last 15 minutes, hour, 24 hours, 7 days). Choosing a preset fills
21
- * both inputs; changing an input switches the preset to "Custom". A preset is remembered as a preset: getRange() works out
22
- * "now" when it is called, so a screen that refreshes asks again and gets the moving window.
23
- *
24
- * @param {object} options
25
- * @param {string} [options.id]
26
- * @param {string} [options.from] initial start (datetime-local value)
27
- * @param {string} [options.to] initial end
28
- * @param {string} [options.preset] id of the preset to start with
29
- * @param {object[]} [options.presets] default DEFAULT_RANGE_PRESETS; { id, label | labelKey, minutes }
30
- * @param {boolean} [options.seconds=false] the inputs ask for seconds too
31
- * @param {string} [options.min]
32
- * @param {string} [options.max]
33
- * @param {boolean} [options.disabled]
34
- * @param {(value: {from: string, to: string, preset: string}) => void} [options.onChange]
35
- */
36
- export function createDateTimeRange(options?: {
37
- id?: string;
38
- from?: string;
39
- to?: string;
40
- preset?: string;
41
- presets?: object[];
42
- seconds?: boolean;
43
- min?: string;
44
- max?: string;
45
- disabled?: boolean;
46
- onChange?: (value: {
47
- from: string;
48
- to: string;
49
- preset: string;
50
- }) => void;
51
- }): {
52
- element: HTMLElement;
53
- inputs: HTMLElement[];
54
- getValue: () => {
55
- from: any;
56
- to: any;
57
- preset: string;
58
- };
59
- setValue: (value: any) => void;
60
- /** The range as Dates: a preset is measured from now (when this is called), a custom range is what the inputs hold. */
61
- getRange(): {
62
- from: Date;
63
- to: Date;
64
- };
65
- validate: () => any;
66
- };
67
- /** The presets of generateDateTimeRange: a name, and how far back from now they reach. */
68
- export const DEFAULT_RANGE_PRESETS: {
69
- id: string;
70
- labelKey: string;
71
- minutes: number;
72
- }[];
1
+ /**
2
+ * Internal: two native date inputs (from / to). The "to" picker starts at the chosen start date.
3
+ * Values are ISO dates ("2026-01-31"), an empty date is "".
4
+ */
5
+ export function createDateRange(options?: {}): {
6
+ element: HTMLElement;
7
+ inputs: HTMLElement[];
8
+ getValue: () => {
9
+ from: any;
10
+ to: any;
11
+ };
12
+ setValue: (value: any) => void;
13
+ validate: () => any;
14
+ };
15
+ /** A Date as the value of a datetime-local input, in the local time of the person: "2026-11-19T10:30". */
16
+ export function toLocalInput(date: any, seconds?: boolean): string;
17
+ /** The value of a datetime-local input as a Date (local time), or null when it is empty or not valid. */
18
+ export function fromLocalInput(value: any): Date;
19
+ /**
20
+ * Internal: two datetime-local inputs and a list of presets (last 15 minutes, hour, 24 hours, 7 days). Choosing a preset fills
21
+ * both inputs; changing an input switches the preset to "Custom". A preset is remembered as a preset: getRange() works out
22
+ * "now" when it is called, so a screen that refreshes asks again and gets the moving window.
23
+ *
24
+ * @param {object} options
25
+ * @param {string} [options.id]
26
+ * @param {string} [options.from] initial start (datetime-local value)
27
+ * @param {string} [options.to] initial end
28
+ * @param {string} [options.preset] id of the preset to start with
29
+ * @param {object[]} [options.presets] default DEFAULT_RANGE_PRESETS; { id, label | labelKey, minutes }
30
+ * @param {boolean} [options.seconds=false] the inputs ask for seconds too
31
+ * @param {string} [options.min]
32
+ * @param {string} [options.max]
33
+ * @param {boolean} [options.disabled]
34
+ * @param {(value: {from: string, to: string, preset: string}) => void} [options.onChange]
35
+ */
36
+ export function createDateTimeRange(options?: {
37
+ id?: string;
38
+ from?: string;
39
+ to?: string;
40
+ preset?: string;
41
+ presets?: object[];
42
+ seconds?: boolean;
43
+ min?: string;
44
+ max?: string;
45
+ disabled?: boolean;
46
+ onChange?: (value: {
47
+ from: string;
48
+ to: string;
49
+ preset: string;
50
+ }) => void;
51
+ }): {
52
+ element: HTMLElement;
53
+ inputs: HTMLElement[];
54
+ getValue: () => {
55
+ from: any;
56
+ to: any;
57
+ preset: string;
58
+ };
59
+ setValue: (value: any) => void;
60
+ /** The range as Dates: a preset is measured from now (when this is called), a custom range is what the inputs hold. */
61
+ getRange(): {
62
+ from: Date;
63
+ to: Date;
64
+ };
65
+ validate: () => any;
66
+ };
67
+ /** The presets of generateDateTimeRange: a name, and how far back from now they reach. */
68
+ export const DEFAULT_RANGE_PRESETS: {
69
+ id: string;
70
+ labelKey: string;
71
+ minutes: number;
72
+ }[];