athena-ui-js 2.0.1 → 2.2.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 +58 -4
- package/docs/migration-2.0.md +1 -1
- package/docs/styling.md +24 -7
- package/package.json +5 -1
- package/src/athena-ui.js +2 -1
- package/src/libs/config/config.js +1 -1
- package/src/libs/core/motion.js +358 -0
- package/src/libs/core/popover.js +96 -0
- package/src/libs/core/theme.js +12 -0
- package/src/libs/hephaestus/chartGenerator/chartGenerator.js +9 -5
- package/src/libs/hephaestus/componentGenerator/componentGenerator.js +43 -2
- package/src/libs/hephaestus/dialogGenerator/dialogGenerator.js +2 -1
- package/src/libs/hephaestus/feedbackGenerator/feedbackGenerator.js +3 -1
- package/src/libs/hephaestus/navigationGenerator/navigationGenerator.js +45 -9
- package/src/libs/hephaestus/router/router.js +18 -9
- package/src/libs/hephaestus/tableGenerator/tableGenerator.js +25 -0
- package/src/motion.js +6 -0
- package/src/res/themes/default/style.css +260 -10
- package/src/res/themes/tokens.css +25 -0
- package/types/athena-ui.d.ts +97 -96
- package/types/libs/config/config.d.ts +3 -3
- package/types/libs/core/motion.d.ts +123 -0
- package/types/libs/core/popover.d.ts +36 -0
- package/types/libs/core/theme.d.ts +41 -39
- package/types/libs/hephaestus/chartGenerator/chartGenerator.d.ts +2 -0
- package/types/libs/hephaestus/componentGenerator/componentGenerator.d.ts +238 -222
- package/types/libs/hephaestus/navigationGenerator/navigationGenerator.d.ts +4 -1
- package/types/libs/hephaestus/router/router.d.ts +71 -67
- package/types/libs/hephaestus/tableGenerator/tableGenerator.d.ts +123 -120
- package/types/motion.d.ts +1 -0
|
@@ -261,7 +261,7 @@ textarea {
|
|
|
261
261
|
border-radius: 10px;
|
|
262
262
|
background-color: var(--athena-line);
|
|
263
263
|
position: relative;
|
|
264
|
-
transition: background-color
|
|
264
|
+
transition: background-color var(--athena-duration-fast) var(--athena-ease-standard);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
.switch-track::after {
|
|
@@ -273,7 +273,7 @@ textarea {
|
|
|
273
273
|
height: 16px;
|
|
274
274
|
border-radius: 50%;
|
|
275
275
|
background-color: #fff;
|
|
276
|
-
transition: transform
|
|
276
|
+
transition: transform var(--athena-duration-fast) var(--athena-ease-standard);
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
.switch input:checked + .switch-track {
|
|
@@ -395,7 +395,7 @@ textarea {
|
|
|
395
395
|
.progress-fill {
|
|
396
396
|
height: 100%;
|
|
397
397
|
background-color: var(--progress-color, var(--athena-accent));
|
|
398
|
-
transition: width
|
|
398
|
+
transition: width var(--athena-duration-base) var(--athena-ease-standard);
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
.progress-success {
|
|
@@ -595,7 +595,7 @@ dialog.dialog::backdrop {
|
|
|
595
595
|
.accordion-icon::before {
|
|
596
596
|
content: "▾";
|
|
597
597
|
display: inline-block;
|
|
598
|
-
transition: transform
|
|
598
|
+
transition: transform var(--athena-duration-fast) var(--athena-ease-standard);
|
|
599
599
|
}
|
|
600
600
|
|
|
601
601
|
.accordion-item[open] > .accordion-header .accordion-icon::before,
|
|
@@ -632,6 +632,29 @@ dialog.dialog::backdrop {
|
|
|
632
632
|
right: 0;
|
|
633
633
|
}
|
|
634
634
|
|
|
635
|
+
/* A popover (the dropdown menu, the tooltip) is in the top layer, placed next to its anchor by script through two variables */
|
|
636
|
+
.athena-popover[popover] {
|
|
637
|
+
position: fixed;
|
|
638
|
+
inset: auto;
|
|
639
|
+
left: var(--athena-popover-left, 0);
|
|
640
|
+
top: var(--athena-popover-top, 0);
|
|
641
|
+
margin: 0;
|
|
642
|
+
width: max-content;
|
|
643
|
+
max-width: min(92vw, 36em);
|
|
644
|
+
overflow: visible;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.athena-popover-center { translate: -50% 0; }
|
|
648
|
+
.athena-popover-end { translate: -100% 0; }
|
|
649
|
+
.athena-popover-above { translate: 0 -100%; }
|
|
650
|
+
.athena-popover-center.athena-popover-above { translate: -50% -100%; }
|
|
651
|
+
.athena-popover-end.athena-popover-above { translate: -100% -100%; }
|
|
652
|
+
|
|
653
|
+
.dropdown-menu[popover] {
|
|
654
|
+
max-height: min(70vh, 28em);
|
|
655
|
+
overflow-y: auto;
|
|
656
|
+
}
|
|
657
|
+
|
|
635
658
|
.dropdown-item {
|
|
636
659
|
display: block;
|
|
637
660
|
width: 100%;
|
|
@@ -874,7 +897,7 @@ dialog.dialog::backdrop {
|
|
|
874
897
|
pointer-events: none;
|
|
875
898
|
visibility: hidden;
|
|
876
899
|
opacity: 0;
|
|
877
|
-
transition: opacity
|
|
900
|
+
transition: opacity var(--athena-duration-fast) var(--athena-ease-standard);
|
|
878
901
|
}
|
|
879
902
|
|
|
880
903
|
.has-tooltip:hover > .tooltip-text,
|
|
@@ -884,6 +907,15 @@ dialog.dialog::backdrop {
|
|
|
884
907
|
opacity: 1;
|
|
885
908
|
}
|
|
886
909
|
|
|
910
|
+
/* As a popover it is only drawn while it is open, so it is always visible; the position comes from placePopover() */
|
|
911
|
+
.tooltip-text[popover] {
|
|
912
|
+
border: 0;
|
|
913
|
+
bottom: auto;
|
|
914
|
+
transform: none;
|
|
915
|
+
visibility: visible;
|
|
916
|
+
opacity: 1;
|
|
917
|
+
}
|
|
918
|
+
|
|
887
919
|
/* Combobox (autocomplete, multi select) and chips */
|
|
888
920
|
|
|
889
921
|
.combobox {
|
|
@@ -1250,15 +1282,17 @@ dialog.dialog::backdrop {
|
|
|
1250
1282
|
}
|
|
1251
1283
|
}
|
|
1252
1284
|
|
|
1285
|
+
/* Reduced motion: a spinner and an indeterminate bar still have to say "busy", but slowly. The transitions read the duration tokens (0). */
|
|
1253
1286
|
@media (prefers-reduced-motion: reduce) {
|
|
1254
|
-
.spinner,
|
|
1255
|
-
.progress-indeterminate .progress-fill {
|
|
1287
|
+
:root:not([data-motion="full"]) .spinner,
|
|
1288
|
+
:root:not([data-motion="full"]) .progress-indeterminate .progress-fill {
|
|
1256
1289
|
animation-duration: 3s;
|
|
1257
1290
|
}
|
|
1291
|
+
}
|
|
1258
1292
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1293
|
+
:root[data-motion="reduce"] .spinner,
|
|
1294
|
+
:root[data-motion="reduce"] .progress-indeterminate .progress-fill {
|
|
1295
|
+
animation-duration: 3s;
|
|
1262
1296
|
}
|
|
1263
1297
|
|
|
1264
1298
|
/* Menu submenus */
|
|
@@ -2124,4 +2158,220 @@ dialog.dialog::backdrop {
|
|
|
2124
2158
|
.stat.is-warn .stat-value { color: var(--athena-warning); }
|
|
2125
2159
|
.stat.is-bad .stat-value { color: var(--athena-danger); }
|
|
2126
2160
|
|
|
2161
|
+
|
|
2162
|
+
/* ------------------------------------------------------------ Motion
|
|
2163
|
+
Everything reads the --athena-duration-* and --athena-ease-* tokens: 0 under reduced motion. Entering uses @starting-style, leaving
|
|
2164
|
+
uses transition-behavior: allow-discrete, so a closed dialog or popover fades out before it is taken off the screen. A browser that
|
|
2165
|
+
does not know them just shows and hides without motion. */
|
|
2166
|
+
|
|
2167
|
+
dialog.dialog {
|
|
2168
|
+
opacity: 0;
|
|
2169
|
+
translate: 0 8px;
|
|
2170
|
+
transition:
|
|
2171
|
+
opacity var(--athena-duration-base) var(--athena-ease-out),
|
|
2172
|
+
translate var(--athena-duration-base) var(--athena-ease-out),
|
|
2173
|
+
overlay var(--athena-duration-base) allow-discrete,
|
|
2174
|
+
display var(--athena-duration-base) allow-discrete;
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
dialog.dialog[open] {
|
|
2178
|
+
opacity: 1;
|
|
2179
|
+
translate: 0 0;
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
dialog.dialog::backdrop {
|
|
2183
|
+
opacity: 0;
|
|
2184
|
+
transition:
|
|
2185
|
+
opacity var(--athena-duration-base) var(--athena-ease-out),
|
|
2186
|
+
overlay var(--athena-duration-base) allow-discrete,
|
|
2187
|
+
display var(--athena-duration-base) allow-discrete;
|
|
2188
|
+
}
|
|
2189
|
+
|
|
2190
|
+
dialog.dialog[open]::backdrop {
|
|
2191
|
+
opacity: 1;
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
@starting-style {
|
|
2195
|
+
dialog.dialog[open] {
|
|
2196
|
+
opacity: 0;
|
|
2197
|
+
translate: 0 8px;
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
dialog.dialog[open]::backdrop {
|
|
2201
|
+
opacity: 0;
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
.athena-popover[popover] {
|
|
2206
|
+
opacity: 0;
|
|
2207
|
+
scale: 0.97;
|
|
2208
|
+
transform-origin: top;
|
|
2209
|
+
transition:
|
|
2210
|
+
opacity var(--athena-duration-fast) var(--athena-ease-out),
|
|
2211
|
+
scale var(--athena-duration-fast) var(--athena-ease-out),
|
|
2212
|
+
overlay var(--athena-duration-fast) allow-discrete,
|
|
2213
|
+
display var(--athena-duration-fast) allow-discrete;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
.athena-popover[popover]:popover-open {
|
|
2217
|
+
opacity: 1;
|
|
2218
|
+
scale: 1;
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
.athena-popover-above[popover] {
|
|
2222
|
+
transform-origin: bottom;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
@starting-style {
|
|
2226
|
+
.athena-popover[popover]:popover-open {
|
|
2227
|
+
opacity: 0;
|
|
2228
|
+
scale: 0.97;
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
/* Toasts slide in from the side, and out again when they are closed */
|
|
2233
|
+
.toast {
|
|
2234
|
+
transition:
|
|
2235
|
+
opacity var(--athena-duration-base) var(--athena-ease-out),
|
|
2236
|
+
translate var(--athena-duration-base) var(--athena-ease-out);
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
@starting-style {
|
|
2240
|
+
.toast {
|
|
2241
|
+
opacity: 0;
|
|
2242
|
+
translate: 16px 0;
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
.toast.is-leaving {
|
|
2247
|
+
opacity: 0;
|
|
2248
|
+
translate: 16px 0;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
/* The panel of an accordion opens and closes smoothly (a browser without ::details-content opens it at once) */
|
|
2252
|
+
.accordion-item {
|
|
2253
|
+
interpolate-size: allow-keywords;
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
.accordion-item::details-content {
|
|
2257
|
+
block-size: 0;
|
|
2258
|
+
overflow: clip;
|
|
2259
|
+
transition:
|
|
2260
|
+
block-size var(--athena-duration-base) var(--athena-ease-standard),
|
|
2261
|
+
content-visibility var(--athena-duration-base) allow-discrete;
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
.accordion-item[open]::details-content {
|
|
2265
|
+
block-size: auto;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
/* The mark of the active item, and hover, move gently */
|
|
2269
|
+
.athena-menu .menu-control {
|
|
2270
|
+
transition:
|
|
2271
|
+
background-color var(--athena-duration-fast) var(--athena-ease-standard),
|
|
2272
|
+
box-shadow var(--athena-duration-fast) var(--athena-ease-standard);
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
/* A place holder for what is loading: a skeleton with a shimmer (generateSkeleton) */
|
|
2276
|
+
.athena-skeleton {
|
|
2277
|
+
display: block;
|
|
2278
|
+
min-height: 1em;
|
|
2279
|
+
border-radius: var(--athena-radius);
|
|
2280
|
+
background: linear-gradient(90deg, var(--athena-surface) 25%, var(--athena-hover) 50%, var(--athena-surface) 75%);
|
|
2281
|
+
background-size: 200% 100%;
|
|
2282
|
+
animation: athena-shimmer 1.4s linear infinite;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
.athena-skeleton-line + .athena-skeleton-line {
|
|
2286
|
+
margin-top: var(--athena-space-2);
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
.athena-skeleton-line:last-child:not(:only-child) {
|
|
2290
|
+
width: 60%;
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
@keyframes athena-shimmer {
|
|
2294
|
+
to {
|
|
2295
|
+
background-position: -200% 0;
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2300
|
+
:root:not([data-motion="full"]) .athena-skeleton {
|
|
2301
|
+
animation: none;
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
:root[data-motion="reduce"] .athena-skeleton {
|
|
2306
|
+
animation: none;
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
/* A theme or mode change cross-fades instead of flashing (the theme manager sets the class for a moment) */
|
|
2310
|
+
.athena-switching,
|
|
2311
|
+
.athena-switching *,
|
|
2312
|
+
.athena-switching *::before,
|
|
2313
|
+
.athena-switching *::after {
|
|
2314
|
+
transition:
|
|
2315
|
+
background-color var(--athena-duration-slow) var(--athena-ease-standard),
|
|
2316
|
+
color var(--athena-duration-slow) var(--athena-ease-standard),
|
|
2317
|
+
border-color var(--athena-duration-slow) var(--athena-ease-standard),
|
|
2318
|
+
fill var(--athena-duration-slow) var(--athena-ease-standard),
|
|
2319
|
+
stroke var(--athena-duration-slow) var(--athena-ease-standard);
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
/* Page transitions of the router (router({ transition: true })) */
|
|
2323
|
+
::view-transition-old(root),
|
|
2324
|
+
::view-transition-new(root) {
|
|
2325
|
+
animation-duration: var(--athena-duration-base);
|
|
2326
|
+
animation-timing-function: var(--athena-ease-standard);
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
/* Charts draw themselves when they appear: bars grow, lines are drawn, slices pop in (only the first time, not when a chart streams or is zoomed) */
|
|
2330
|
+
@keyframes athena-grow {
|
|
2331
|
+
from {
|
|
2332
|
+
scale: 1 0;
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
@keyframes athena-draw {
|
|
2337
|
+
from {
|
|
2338
|
+
stroke-dashoffset: 1;
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2342
|
+
@keyframes athena-appear {
|
|
2343
|
+
from {
|
|
2344
|
+
opacity: 0;
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
@keyframes athena-pop {
|
|
2349
|
+
from {
|
|
2350
|
+
opacity: 0;
|
|
2351
|
+
scale: 0.6;
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
.athena-chart-animated .chart-bar {
|
|
2356
|
+
transform-box: fill-box;
|
|
2357
|
+
transform-origin: 50% 100%;
|
|
2358
|
+
animation: athena-grow var(--athena-duration-slow) var(--athena-ease-out) backwards;
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
.athena-chart-animated .chart-line {
|
|
2362
|
+
stroke-dasharray: 1;
|
|
2363
|
+
animation: athena-draw var(--athena-duration-slow) var(--athena-ease-out) backwards;
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
.athena-chart-animated .chart-area,
|
|
2367
|
+
.athena-chart-animated .chart-point {
|
|
2368
|
+
animation: athena-appear var(--athena-duration-slow) var(--athena-ease-out) backwards;
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
.athena-chart-animated .chart-slice {
|
|
2372
|
+
transform-box: fill-box;
|
|
2373
|
+
transform-origin: center;
|
|
2374
|
+
animation: athena-pop var(--athena-duration-slow) var(--athena-ease-out) backwards;
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2127
2377
|
}
|
|
@@ -47,6 +47,31 @@
|
|
|
47
47
|
--athena-dialog-medium: 480px;
|
|
48
48
|
--athena-dialog-large: 720px;
|
|
49
49
|
--athena-row-height: 36px; /* rows of a virtual table; generateTable({ virtual: { rowHeight } }) sets --row-height on the table */
|
|
50
|
+
|
|
51
|
+
/* motion: every transition and animation of Athena UI reads these, so one variable slows down or switches off all of it */
|
|
52
|
+
--athena-duration-fast: 120ms;
|
|
53
|
+
--athena-duration-base: 200ms;
|
|
54
|
+
--athena-duration-slow: 360ms;
|
|
55
|
+
--athena-ease-standard: cubic-bezier(0.2, 0, 0, 1);
|
|
56
|
+
--athena-ease-in: cubic-bezier(0.4, 0, 1, 1);
|
|
57
|
+
--athena-ease-out: cubic-bezier(0, 0, 0.2, 1);
|
|
58
|
+
--athena-ease-spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.077 22.8%, 1.121 26.7%, 1.149 31.2%, 1.159 36.2%, 1.138 49.9%, 1.115 56.3%, 1.043 69.7%, 1.009 81.2%, 0.998 92.1%, 1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Less motion: the durations are 0. The system asks for it (prefers-reduced-motion), or the person does (data-motion="reduce" on <html>, see setMotion
|
|
62
|
+
in athena-ui-js/motion); data-motion="full" keeps the motion although the system asks for less. */
|
|
63
|
+
@media (prefers-reduced-motion: reduce) {
|
|
64
|
+
:root:not([data-motion="full"]) {
|
|
65
|
+
--athena-duration-fast: 0ms;
|
|
66
|
+
--athena-duration-base: 0ms;
|
|
67
|
+
--athena-duration-slow: 0ms;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:root[data-motion="reduce"] {
|
|
72
|
+
--athena-duration-fast: 0ms;
|
|
73
|
+
--athena-duration-base: 0ms;
|
|
74
|
+
--athena-duration-slow: 0ms;
|
|
50
75
|
}
|
|
51
76
|
|
|
52
77
|
/* The dark colours: chosen with data-mode="dark" ... */
|
package/types/athena-ui.d.ts
CHANGED
|
@@ -1,96 +1,97 @@
|
|
|
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/
|
|
91
|
-
export * from "./libs/
|
|
92
|
-
export * from "./libs/
|
|
93
|
-
|
|
94
|
-
import
|
|
95
|
-
|
|
96
|
-
export {
|
|
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/core/motion.js";
|
|
91
|
+
export * from "./libs/hephaestus/modalGenerator/modalGenerator.js";
|
|
92
|
+
export * from "./libs/core/theme.js";
|
|
93
|
+
export * from "./libs/hephaestus/componentGenerator/themePicker.js";
|
|
94
|
+
import config from "./libs/config/config.js";
|
|
95
|
+
import { loadScript } from "./libs/hephaestus/hephaestus.js";
|
|
96
|
+
export { config, loadScript };
|
|
97
|
+
export { el, setContent, resolveElement, asHandle, createSafeBuilder } from "./libs/core/dom.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function applyConfig(...sources: any[]): {
|
|
2
|
-
version: "2.0
|
|
2
|
+
version: "2.2.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
|
|
35
|
+
version: "2.2.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
|
|
67
|
+
let version: "2.2.0";
|
|
68
68
|
let container_class: "container";
|
|
69
69
|
let header_class: "header-container";
|
|
70
70
|
let header_menu_class: "header-menu menu";
|