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.
- package/.browserslistrc +9 -4
- package/.prettierrc +6 -0
- package/ACCESSIBILITY-COMPLIANCE.md +369 -0
- package/CHANGELOG.md +314 -0
- package/README.md +43 -7
- package/dist/css/adminlte.css +1417 -1269
- package/dist/css/adminlte.css.map +1 -1
- package/dist/css/adminlte.min.css +2 -2
- package/dist/css/adminlte.min.css.map +1 -1
- package/dist/css/adminlte.rtl.css +1437 -1263
- package/dist/css/adminlte.rtl.css.map +1 -1
- package/dist/css/adminlte.rtl.min.css +2 -2
- package/dist/css/adminlte.rtl.min.css.map +1 -1
- package/dist/js/adminlte.js +786 -345
- package/dist/js/adminlte.js.map +1 -1
- package/dist/js/adminlte.min.js +3 -3
- package/dist/js/adminlte.min.js.map +1 -1
- package/dist/pages/UI/general.html +1918 -889
- package/dist/pages/UI/icons.html +848 -450
- package/dist/pages/UI/timeline.html +926 -496
- package/dist/pages/docs/browser-support.html +855 -442
- package/dist/pages/docs/color-mode.html +1002 -549
- package/dist/pages/docs/components/main-header.html +1032 -543
- package/dist/pages/docs/components/main-sidebar.html +848 -441
- package/dist/pages/docs/faq.html +846 -438
- package/dist/pages/docs/how-to-contribute.html +918 -478
- package/dist/pages/docs/introduction.html +900 -465
- package/dist/pages/docs/javascript/treeview.html +853 -451
- package/dist/pages/docs/layout.html +867 -479
- package/dist/pages/docs/license.html +843 -440
- package/dist/pages/examples/lockscreen.html +141 -66
- package/dist/pages/examples/login-v2.html +169 -85
- package/dist/pages/examples/login.html +159 -80
- package/dist/pages/examples/register-v2.html +179 -88
- package/dist/pages/examples/register.html +164 -81
- package/dist/pages/forms/general.html +1255 -605
- package/dist/pages/generate/theme.html +861 -386
- package/dist/pages/index.html +1417 -801
- package/dist/pages/index2.html +1884 -1057
- package/dist/pages/index3.html +1215 -690
- package/dist/pages/layout/collapsed-sidebar.html +861 -446
- package/dist/pages/layout/fixed-complete.html +862 -0
- package/dist/pages/layout/fixed-footer.html +861 -0
- package/dist/pages/layout/fixed-header.html +861 -0
- package/dist/pages/layout/fixed-sidebar.html +861 -446
- package/dist/pages/layout/layout-custom-area.html +891 -464
- package/dist/pages/layout/layout-rtl.html +861 -446
- package/dist/pages/layout/logo-switch.html +498 -233
- package/dist/pages/layout/sidebar-mini.html +861 -446
- package/dist/pages/layout/unfixed-sidebar.html +859 -445
- package/dist/pages/tables/simple.html +1111 -692
- package/dist/pages/widgets/cards.html +1066 -550
- package/dist/pages/widgets/info-box.html +1084 -577
- package/dist/pages/widgets/small-box.html +946 -480
- package/eslint.config.js +81 -0
- package/package.json +40 -36
- package/src/scss/_accessibility.scss +292 -0
- package/src/scss/_app-footer.scss +8 -0
- package/src/scss/_app-header.scss +8 -0
- package/src/scss/_bootstrap-variables.scss +11 -9
- package/src/scss/_table.scss +1 -9
- package/src/scss/_variables.scss +2 -1
- package/src/scss/adminlte.scss +4 -1
- package/src/ts/accessibility.ts +533 -0
- package/src/ts/adminlte.ts +48 -9
- package/src/ts/card-widget.ts +1 -2
- package/src/ts/push-menu.ts +1 -2
- package/src/ts/util/index.ts +39 -7
- package/.astro/settings.json +0 -5
package/src/ts/util/index.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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 } =
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
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
|
}
|