athena-ui-js 1.3.0 → 2.0.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 (124) hide show
  1. package/README.md +100 -54
  2. package/docs/migration-2.0.md +83 -0
  3. package/docs/styling.md +86 -0
  4. package/package.json +108 -25
  5. package/src/athena-ui.js +54 -97
  6. package/src/chart.js +6 -0
  7. package/src/classic.js +11 -0
  8. package/src/components.js +6 -0
  9. package/src/controls.js +8 -0
  10. package/src/csv.js +6 -0
  11. package/src/dialog.js +7 -0
  12. package/src/dom.js +6 -0
  13. package/src/feedback.js +6 -0
  14. package/src/format.js +6 -0
  15. package/src/forms.js +7 -0
  16. package/src/i18n.js +6 -0
  17. package/src/inputs.js +9 -0
  18. package/src/libs/config/config.js +1 -9
  19. package/src/libs/core/controls.js +6 -14
  20. package/src/libs/core/cookies.js +55 -0
  21. package/src/libs/core/i18n.js +40 -6
  22. package/src/libs/core/validation.js +2 -2
  23. package/src/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.js +9 -1
  24. package/src/libs/hephaestus/MenuGenerator/menuGenerator.js +16 -4
  25. package/src/libs/hephaestus/auth/session.js +1 -1
  26. package/src/libs/hephaestus/dialogGenerator/dialogGenerator.js +25 -17
  27. package/src/libs/hephaestus/formGenerator/changePasswordFormGenerator.js +4 -4
  28. package/src/libs/hephaestus/formGenerator/formUtils.js +0 -4
  29. package/src/libs/hephaestus/formGenerator/loginFormGenerator.js +2 -3
  30. package/src/libs/hephaestus/formGenerator/registrationFormGenerator.js +3 -3
  31. package/src/libs/hephaestus/hephaestus.js +0 -10
  32. package/src/libs/hephaestus/inputGenerator/dropZoneGenerator.js +1 -1
  33. package/src/libs/hephaestus/modalGenerator/modalGenerator.js +13 -6
  34. package/src/libs/hephaestus/navigationGenerator/navigationGenerator.js +20 -24
  35. package/src/menu.js +6 -0
  36. package/src/navigation.js +6 -0
  37. package/src/res/themes/default/style.css +97 -100
  38. package/src/res/themes/tokens.css +96 -0
  39. package/src/router.js +6 -0
  40. package/src/sanitize.js +6 -0
  41. package/src/session.js +8 -0
  42. package/src/table.js +6 -0
  43. package/src/testing.js +11 -1
  44. package/src/theme.js +7 -0
  45. package/src/validation.js +6 -0
  46. package/types/athena-ui.d.ts +96 -0
  47. package/types/chart.d.ts +1 -0
  48. package/types/classic.d.ts +1 -0
  49. package/types/components.d.ts +1 -0
  50. package/types/controls.d.ts +3 -0
  51. package/types/csv.d.ts +1 -0
  52. package/types/dialog.d.ts +2 -0
  53. package/types/dom.d.ts +1 -0
  54. package/types/feedback.d.ts +1 -0
  55. package/types/format.d.ts +1 -0
  56. package/types/forms.d.ts +2 -0
  57. package/types/i18n.d.ts +1 -0
  58. package/types/inputs.d.ts +4 -0
  59. package/types/libs/config/config.d.ts +96 -0
  60. package/types/libs/config/hooks.d.ts +8 -0
  61. package/types/libs/core/combobox.d.ts +10 -0
  62. package/types/libs/core/controls.d.ts +28 -0
  63. package/types/libs/core/cookies.d.ts +27 -0
  64. package/types/libs/core/csv.d.ts +12 -0
  65. package/types/libs/core/dateRange.d.ts +72 -0
  66. package/types/libs/core/dom.d.ts +65 -0
  67. package/types/libs/core/elementGenerator.d.ts +30 -0
  68. package/types/libs/core/errors.d.ts +29 -0
  69. package/types/libs/core/focus.d.ts +6 -0
  70. package/types/libs/core/format.d.ts +21 -0
  71. package/types/libs/core/hungarianControls.d.ts +2 -0
  72. package/types/libs/core/i18n.d.ts +17 -0
  73. package/types/libs/core/pagination.d.ts +5 -0
  74. package/types/libs/core/sanitize.d.ts +6 -0
  75. package/types/libs/core/tableMath.d.ts +26 -0
  76. package/types/libs/core/theme.d.ts +39 -0
  77. package/types/libs/core/validation.d.ts +56 -0
  78. package/types/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.d.ts +10 -0
  79. package/types/libs/hephaestus/LayoutGenerator/footerContentGenerator.d.ts +4 -0
  80. package/types/libs/hephaestus/LayoutGenerator/headerContentGenerator.d.ts +20 -0
  81. package/types/libs/hephaestus/LayoutGenerator/wrapperContentGenerator.d.ts +1 -0
  82. package/types/libs/hephaestus/MenuGenerator/basicMenuGenerator.d.ts +14 -0
  83. package/types/libs/hephaestus/MenuGenerator/menuGenerator.d.ts +65 -0
  84. package/types/libs/hephaestus/auth/authState.d.ts +26 -0
  85. package/types/libs/hephaestus/auth/session.d.ts +26 -0
  86. package/types/libs/hephaestus/chartGenerator/chartGenerator.d.ts +91 -0
  87. package/types/libs/hephaestus/componentGenerator/componentGenerator.d.ts +222 -0
  88. package/types/libs/hephaestus/componentGenerator/themePicker.d.ts +24 -0
  89. package/types/libs/hephaestus/dialogGenerator/dialogGenerator.d.ts +120 -0
  90. package/types/libs/hephaestus/feedbackGenerator/feedbackGenerator.d.ts +86 -0
  91. package/types/libs/hephaestus/formGenerator/authForms.d.ts +122 -0
  92. package/types/libs/hephaestus/formGenerator/changePasswordFormGenerator.d.ts +6 -0
  93. package/types/libs/hephaestus/formGenerator/formBuilder.d.ts +113 -0
  94. package/types/libs/hephaestus/formGenerator/formUtils.d.ts +8 -0
  95. package/types/libs/hephaestus/formGenerator/loginFormGenerator.d.ts +11 -0
  96. package/types/libs/hephaestus/formGenerator/lostPasswordFormGenerator.d.ts +4 -0
  97. package/types/libs/hephaestus/formGenerator/registrationFormGenerator.d.ts +7 -0
  98. package/types/libs/hephaestus/hephaestus.d.ts +3 -0
  99. package/types/libs/hephaestus/inputGenerator/dropZoneGenerator.d.ts +48 -0
  100. package/types/libs/hephaestus/inputGenerator/inputGenerator.d.ts +185 -0
  101. package/types/libs/hephaestus/inputGenerator/richTextGenerator.d.ts +49 -0
  102. package/types/libs/hephaestus/modalGenerator/modalGenerator.d.ts +2 -0
  103. package/types/libs/hephaestus/navigationGenerator/navigationGenerator.d.ts +150 -0
  104. package/types/libs/hephaestus/router/matchRoute.d.ts +12 -0
  105. package/types/libs/hephaestus/router/router.d.ts +67 -0
  106. package/types/libs/hephaestus/tableGenerator/tableGenerator.d.ts +120 -0
  107. package/types/menu.d.ts +1 -0
  108. package/types/navigation.d.ts +1 -0
  109. package/types/res/themes/themes.d.ts +7 -0
  110. package/types/router.d.ts +1 -0
  111. package/types/sanitize.d.ts +1 -0
  112. package/types/session.d.ts +3 -0
  113. package/types/table.d.ts +1 -0
  114. package/types/testing.d.ts +27 -0
  115. package/types/theme-boot.d.ts +0 -0
  116. package/types/theme.d.ts +2 -0
  117. package/types/validation.d.ts +1 -0
  118. package/src/libs/crypto-js/LICENSE +0 -24
  119. package/src/libs/crypto-js/crypto-js.js +0 -6657
  120. package/src/libs/js-cookie/LICENSE +0 -21
  121. package/src/libs/js-cookie/src/api.mjs +0 -103
  122. package/src/libs/js-cookie/src/assign.mjs +0 -10
  123. package/src/libs/js-cookie/src/converter.mjs +0 -14
  124. package/src/libs/libs.js +0 -13
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2018 Copyright 2018 Klaus Hartl, Fagner Brack, GitHub Contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,103 +0,0 @@
1
- import assign from './assign.mjs'
2
- import defaultConverter from './converter.mjs'
3
-
4
- function init(converter, defaultAttributes) {
5
- function set(name, value, attributes) {
6
- if (typeof document === 'undefined') {
7
- return
8
- }
9
-
10
- attributes = assign({}, defaultAttributes, attributes)
11
-
12
- if (typeof attributes.expires === 'number') {
13
- attributes.expires = new Date(Date.now() + attributes.expires * 864e5)
14
- }
15
- if (attributes.expires) {
16
- attributes.expires = attributes.expires.toUTCString()
17
- }
18
-
19
- name = encodeURIComponent(name)
20
- .replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
21
- .replace(/[()]/g, escape)
22
-
23
- var stringifiedAttributes = ''
24
- for (var attributeName in attributes) {
25
- if (!attributes[attributeName]) {
26
- continue
27
- }
28
-
29
- stringifiedAttributes += '; ' + attributeName
30
-
31
- if (attributes[attributeName] === true) {
32
- continue
33
- }
34
-
35
- // Considers RFC 6265 section 5.2:
36
- // ...
37
- // 3. If the remaining unparsed-attributes contains a %x3B (";")
38
- // character:
39
- // Consume the characters of the unparsed-attributes up to,
40
- // not including, the first %x3B (";") character.
41
- // ...
42
- stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]
43
- }
44
-
45
- return (document.cookie =
46
- name + '=' + converter.write(value, name) + stringifiedAttributes)
47
- }
48
-
49
- function get(name) {
50
- if (typeof document === 'undefined' || (arguments.length && !name)) {
51
- return
52
- }
53
-
54
- // To prevent the for loop in the first place assign an empty array
55
- // in case there are no cookies at all.
56
- var cookies = document.cookie ? document.cookie.split('; ') : []
57
- var jar = {}
58
- for (var i = 0; i < cookies.length; i++) {
59
- var parts = cookies[i].split('=')
60
- var value = parts.slice(1).join('=')
61
-
62
- try {
63
- var found = decodeURIComponent(parts[0])
64
- if (!(found in jar)) jar[found] = converter.read(value, found)
65
- if (name === found) {
66
- break
67
- }
68
- } catch (_e) {
69
- // Do nothing...
70
- }
71
- }
72
-
73
- return name ? jar[name] : jar
74
- }
75
-
76
- return Object.create(
77
- {
78
- set: set,
79
- get: get,
80
- remove: function (name, attributes) {
81
- set(
82
- name,
83
- '',
84
- assign({}, attributes, {
85
- expires: -1
86
- })
87
- )
88
- },
89
- withAttributes: function (attributes) {
90
- return init(this.converter, assign({}, this.attributes, attributes))
91
- },
92
- withConverter: function (converter) {
93
- return init(assign({}, this.converter, converter), this.attributes)
94
- }
95
- },
96
- {
97
- attributes: { value: Object.freeze(defaultAttributes) },
98
- converter: { value: Object.freeze(converter) }
99
- }
100
- )
101
- }
102
-
103
- export default init(defaultConverter, { path: '/' })
@@ -1,10 +0,0 @@
1
- export default function (target) {
2
- for (var i = 1; i < arguments.length; i++) {
3
- var source = arguments[i]
4
- for (var key in source) {
5
- if (key === '__proto__') continue
6
- target[key] = source[key]
7
- }
8
- }
9
- return target
10
- }
@@ -1,14 +0,0 @@
1
- export default {
2
- read: function (value) {
3
- if (value[0] === '"') {
4
- value = value.slice(1, -1)
5
- }
6
- return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent)
7
- },
8
- write: function (value) {
9
- return encodeURIComponent(value).replace(
10
- /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
11
- decodeURIComponent
12
- )
13
- }
14
- }
package/src/libs/libs.js DELETED
@@ -1,13 +0,0 @@
1
- //libs 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
- // Classic (non-module) scripts that have to be loaded at runtime because they
7
- // register globals. Everything else is a regular ES module import.
8
- // `needs`: the script is only loaded when it is wanted ("crypto": enable_encrypt_password is on)
9
- const lib = (id, name, path, needs) => ({ id, name, needs, src: new URL(path, import.meta.url).href });
10
-
11
- export default [
12
- lib(10, "crypto-js", "crypto-js/crypto-js.js", "crypto")
13
- ];