admin-lte 4.0.0-beta2 → 4.0.0-rc2

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 (69) hide show
  1. package/.browserslistrc +9 -4
  2. package/.prettierrc +6 -0
  3. package/ACCESSIBILITY-COMPLIANCE.md +369 -0
  4. package/CHANGELOG.md +314 -0
  5. package/README.md +43 -7
  6. package/dist/css/adminlte.css +1417 -1269
  7. package/dist/css/adminlte.css.map +1 -1
  8. package/dist/css/adminlte.min.css +2 -2
  9. package/dist/css/adminlte.min.css.map +1 -1
  10. package/dist/css/adminlte.rtl.css +1437 -1263
  11. package/dist/css/adminlte.rtl.css.map +1 -1
  12. package/dist/css/adminlte.rtl.min.css +2 -2
  13. package/dist/css/adminlte.rtl.min.css.map +1 -1
  14. package/dist/js/adminlte.js +786 -345
  15. package/dist/js/adminlte.js.map +1 -1
  16. package/dist/js/adminlte.min.js +3 -3
  17. package/dist/js/adminlte.min.js.map +1 -1
  18. package/dist/pages/UI/general.html +1918 -889
  19. package/dist/pages/UI/icons.html +848 -450
  20. package/dist/pages/UI/timeline.html +926 -496
  21. package/dist/pages/docs/browser-support.html +855 -442
  22. package/dist/pages/docs/color-mode.html +1002 -549
  23. package/dist/pages/docs/components/main-header.html +1032 -543
  24. package/dist/pages/docs/components/main-sidebar.html +848 -441
  25. package/dist/pages/docs/faq.html +846 -438
  26. package/dist/pages/docs/how-to-contribute.html +918 -478
  27. package/dist/pages/docs/introduction.html +900 -465
  28. package/dist/pages/docs/javascript/treeview.html +853 -451
  29. package/dist/pages/docs/layout.html +867 -479
  30. package/dist/pages/docs/license.html +843 -440
  31. package/dist/pages/examples/lockscreen.html +141 -66
  32. package/dist/pages/examples/login-v2.html +169 -85
  33. package/dist/pages/examples/login.html +159 -80
  34. package/dist/pages/examples/register-v2.html +179 -88
  35. package/dist/pages/examples/register.html +164 -81
  36. package/dist/pages/forms/general.html +1255 -605
  37. package/dist/pages/generate/theme.html +861 -386
  38. package/dist/pages/index.html +1417 -801
  39. package/dist/pages/index2.html +1884 -1057
  40. package/dist/pages/index3.html +1215 -690
  41. package/dist/pages/layout/collapsed-sidebar.html +861 -446
  42. package/dist/pages/layout/fixed-complete.html +862 -0
  43. package/dist/pages/layout/fixed-footer.html +861 -0
  44. package/dist/pages/layout/fixed-header.html +861 -0
  45. package/dist/pages/layout/fixed-sidebar.html +861 -446
  46. package/dist/pages/layout/layout-custom-area.html +891 -464
  47. package/dist/pages/layout/layout-rtl.html +861 -446
  48. package/dist/pages/layout/logo-switch.html +498 -233
  49. package/dist/pages/layout/sidebar-mini.html +861 -446
  50. package/dist/pages/layout/unfixed-sidebar.html +859 -445
  51. package/dist/pages/tables/simple.html +1111 -692
  52. package/dist/pages/widgets/cards.html +1066 -550
  53. package/dist/pages/widgets/info-box.html +1084 -577
  54. package/dist/pages/widgets/small-box.html +946 -480
  55. package/eslint.config.js +81 -0
  56. package/package.json +40 -36
  57. package/src/scss/_accessibility.scss +292 -0
  58. package/src/scss/_app-footer.scss +8 -0
  59. package/src/scss/_app-header.scss +8 -0
  60. package/src/scss/_bootstrap-variables.scss +11 -9
  61. package/src/scss/_table.scss +1 -9
  62. package/src/scss/_variables.scss +2 -1
  63. package/src/scss/adminlte.scss +4 -1
  64. package/src/ts/accessibility.ts +533 -0
  65. package/src/ts/adminlte.ts +48 -9
  66. package/src/ts/card-widget.ts +1 -2
  67. package/src/ts/push-menu.ts +1 -2
  68. package/src/ts/util/index.ts +39 -7
  69. package/.astro/settings.json +0 -5
@@ -17,6 +17,35 @@ const onDOMContentLoaded = (callback: () => void): void => {
17
17
  }
18
18
  }
19
19
 
20
+ /* ES2022 UTILITY FUNCTIONS */
21
+
22
+ /**
23
+ * Check if an element has a specific data attribute using ES2022 Object.hasOwn()
24
+ */
25
+ const hasDataAttribute = (element: HTMLElement, attribute: string): boolean => {
26
+ return Object.hasOwn(element.dataset, attribute)
27
+ }
28
+
29
+ /**
30
+ * Get the last element from a NodeList using ES2022 Array.at()
31
+ */
32
+ const getLastElement = <T extends Element>(elements: NodeListOf<T> | T[]): T | undefined => {
33
+ const elementsArray = Array.from(elements)
34
+ return elementsArray.at(-1)
35
+ }
36
+
37
+ /**
38
+ * Safe property access with better error handling
39
+ */
40
+ const safePropertyAccess = (obj: Record<string, unknown>, property: string): unknown => {
41
+ try {
42
+ return Object.hasOwn(obj, property) ? obj[property] : undefined
43
+ } catch (error) {
44
+ // ES2022 Error cause
45
+ throw new Error(`Failed to access property '${property}'`, { cause: error })
46
+ }
47
+ }
48
+
20
49
  /* SLIDE UP */
21
50
  const slideUp = (target: HTMLElement, duration = 500) => {
22
51
  target.style.transitionProperty = 'height, margin, padding'
@@ -25,7 +54,7 @@ const slideUp = (target: HTMLElement, duration = 500) => {
25
54
  target.style.height = `${target.offsetHeight}px`
26
55
  target.style.overflow = 'hidden'
27
56
 
28
- window.setTimeout(() => {
57
+ globalThis.setTimeout(() => {
29
58
  target.style.height = '0'
30
59
  target.style.paddingTop = '0'
31
60
  target.style.paddingBottom = '0'
@@ -33,7 +62,7 @@ const slideUp = (target: HTMLElement, duration = 500) => {
33
62
  target.style.marginBottom = '0'
34
63
  }, 1)
35
64
 
36
- window.setTimeout(() => {
65
+ globalThis.setTimeout(() => {
37
66
  target.style.display = 'none'
38
67
  target.style.removeProperty('height')
39
68
  target.style.removeProperty('padding-top')
@@ -49,7 +78,7 @@ const slideUp = (target: HTMLElement, duration = 500) => {
49
78
  /* SLIDE DOWN */
50
79
  const slideDown = (target: HTMLElement, duration = 500) => {
51
80
  target.style.removeProperty('display')
52
- let { display } = window.getComputedStyle(target)
81
+ let { display } = globalThis.getComputedStyle(target)
53
82
 
54
83
  if (display === 'none') {
55
84
  display = 'block'
@@ -64,7 +93,7 @@ const slideDown = (target: HTMLElement, duration = 500) => {
64
93
  target.style.marginTop = '0'
65
94
  target.style.marginBottom = '0'
66
95
 
67
- window.setTimeout(() => {
96
+ globalThis.setTimeout(() => {
68
97
  target.style.boxSizing = 'border-box'
69
98
  target.style.transitionProperty = 'height, margin, padding'
70
99
  target.style.transitionDuration = `${duration}ms`
@@ -75,7 +104,7 @@ const slideDown = (target: HTMLElement, duration = 500) => {
75
104
  target.style.removeProperty('margin-bottom')
76
105
  }, 1)
77
106
 
78
- window.setTimeout(() => {
107
+ globalThis.setTimeout(() => {
79
108
  target.style.removeProperty('height')
80
109
  target.style.removeProperty('overflow')
81
110
  target.style.removeProperty('transition-duration')
@@ -85,7 +114,7 @@ const slideDown = (target: HTMLElement, duration = 500) => {
85
114
 
86
115
  /* TOGGLE */
87
116
  const slideToggle = (target: HTMLElement, duration = 500) => {
88
- if (window.getComputedStyle(target).display === 'none') {
117
+ if (globalThis.getComputedStyle(target).display === 'none') {
89
118
  slideDown(target, duration)
90
119
  return
91
120
  }
@@ -97,5 +126,8 @@ export {
97
126
  onDOMContentLoaded,
98
127
  slideUp,
99
128
  slideDown,
100
- slideToggle
129
+ slideToggle,
130
+ hasDataAttribute,
131
+ getLastElement,
132
+ safePropertyAccess
101
133
  }
@@ -1,5 +0,0 @@
1
- {
2
- "_variables": {
3
- "lastUpdateCheck": 1724617064155
4
- }
5
- }