admin-lte 4.0.0-alpha2 → 4.0.0-alpha3
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/.bundlewatch.config.json +6 -6
- package/.cache/.eslintcache +1 -1
- package/.cache/.stylelintcache +1 -1
- package/.gitpod.yml +1 -1
- package/.idea/AdminLTE.iml +4 -0
- package/.idea/codeStyles/Project.xml +24 -0
- package/.idea/dbnavigator.xml +421 -0
- package/.idea/git_toolbox_prj.xml +15 -0
- package/.idea/jsLibraryMappings.xml +6 -0
- package/.idea/jsLinters/eslint.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/README.md +3 -3
- package/dist/assets/img/AdminLTEFullLogo.png +0 -0
- package/dist/css/adminlte.css +695 -318
- package/dist/css/adminlte.css.map +1 -1
- package/dist/css/adminlte.min.css +1 -1
- package/dist/css/adminlte.min.css.map +1 -1
- package/dist/css/adminlte.rtl.css +693 -316
- package/dist/css/adminlte.rtl.css.map +1 -1
- package/dist/css/adminlte.rtl.min.css +1 -1
- package/dist/css/adminlte.rtl.min.css.map +1 -1
- package/dist/js/adminlte.js +43 -63
- package/dist/js/adminlte.js.map +1 -1
- package/dist/js/adminlte.min.js +2 -2
- package/dist/js/adminlte.min.js.map +1 -1
- package/dist/pages/UI/timeline.html +389 -218
- package/dist/pages/docs/browser-support.html +345 -204
- package/dist/pages/docs/color-mode.html +560 -348
- package/dist/pages/docs/components/main-header.html +579 -368
- package/dist/pages/docs/components/main-sidebar.html +858 -0
- package/dist/pages/docs/faq.html +743 -0
- package/dist/pages/docs/how-to-contribute.html +783 -0
- package/dist/pages/docs/introduction.html +767 -0
- package/dist/pages/docs/javascript/treeview.html +762 -0
- package/dist/pages/docs/layout.html +372 -201
- package/dist/pages/{docs.html → docs/license.html} +347 -218
- package/dist/pages/examples/lockscreen.html +107 -0
- package/dist/pages/examples/login-v2.html +148 -0
- package/dist/pages/examples/login.html +45 -40
- package/dist/pages/examples/register-v2.html +155 -0
- package/dist/pages/examples/register.html +46 -41
- package/dist/pages/forms/general.html +664 -202
- package/dist/pages/index.html +514 -285
- package/dist/pages/index2.html +665 -341
- package/dist/pages/index3.html +415 -254
- package/dist/pages/layout/collapsed-sidebar.html +766 -0
- package/dist/pages/layout/fixed-complete.html +867 -0
- package/dist/pages/layout/fixed-sidebar.html +344 -201
- package/dist/pages/layout/layout-rtl.html +344 -201
- package/dist/pages/layout/logo-switch.html +433 -0
- package/dist/pages/layout/sidebar-mini.html +345 -202
- package/dist/pages/layout/unfixed-sidebar.html +343 -201
- package/dist/pages/tables/simple.html +437 -233
- package/dist/pages/widgets/cards.html +389 -244
- package/dist/pages/widgets/info-box.html +398 -215
- package/dist/pages/widgets/small-box.html +349 -198
- package/index.html +6 -10
- package/package.json +27 -24
- package/src/assets/img/AdminLTEFullLogo.png +0 -0
- package/src/config/astro.config.mjs +3 -1
- package/src/html/.prettierrc.js +11 -0
- package/src/html/components/_head.astro +42 -26
- package/src/html/components/_scripts.astro +38 -27
- package/src/html/components/dashboard/_footer.astro +14 -8
- package/src/html/components/dashboard/_sidenav.astro +343 -113
- package/src/html/components/dashboard/_topbar.astro +90 -49
- package/src/html/components/docs/{browser-support/index.md → browser-support.mdx} +2 -1
- package/src/html/components/docs/color-mode.mdx +169 -0
- package/src/html/components/docs/components/{main-header-1.md → main-header.mdx} +60 -21
- package/src/html/components/docs/components/main-sidebar.mdx +129 -0
- package/src/html/components/docs/faq.mdx +11 -0
- package/src/html/components/docs/how-to-contribute.mdx +34 -0
- package/src/html/components/docs/{introduction/index.md → introduction.mdx} +27 -2
- package/src/html/components/docs/license.mdx +9 -0
- package/src/html/components/javascript/treeview.mdx +39 -0
- package/src/html/pages/UI/timeline.astro +111 -48
- package/src/html/pages/docs/browser-support.astro +24 -11
- package/src/html/pages/docs/color-mode.astro +89 -42
- package/src/html/pages/docs/components/main-header.astro +133 -46
- package/src/html/pages/docs/components/main-sidebar.astro +71 -0
- package/src/html/pages/docs/faq.astro +71 -0
- package/src/html/pages/docs/how-to-contribute.astro +71 -0
- package/src/html/pages/docs/{index.astro → introduction.astro} +24 -11
- package/src/html/pages/docs/javascript/treeview.astro +71 -0
- package/src/html/pages/docs/layout.astro +62 -19
- package/src/html/pages/docs/license.astro +71 -0
- package/src/html/pages/examples/lockscreen.astro +63 -0
- package/src/html/pages/examples/login-v2.astro +109 -0
- package/src/html/pages/examples/login.astro +34 -16
- package/src/html/pages/examples/register-v2.astro +116 -0
- package/src/html/pages/examples/register.astro +36 -18
- package/src/html/pages/forms/general.astro +567 -36
- package/src/html/pages/index.astro +389 -152
- package/src/html/pages/index2.astro +682 -250
- package/src/html/pages/index3.astro +290 -189
- package/src/html/pages/layout/collapsed-sidebar.astro +110 -0
- package/src/html/pages/layout/fixed-complete.astro +209 -0
- package/src/html/pages/layout/fixed-sidebar.astro +52 -27
- package/src/html/pages/layout/layout-rtl.astro +53 -28
- package/src/html/pages/layout/logo-switch.astro +212 -0
- package/src/html/pages/layout/sidebar-mini.astro +53 -28
- package/src/html/pages/layout/unfixed-sidebar.astro +51 -27
- package/src/html/pages/tables/simple.astro +206 -66
- package/src/html/pages/widgets/cards.astro +134 -69
- package/src/html/pages/widgets/info-box.astro +96 -41
- package/src/html/pages/widgets/small-box.astro +93 -32
- package/src/scss/_app-content.scss +52 -0
- package/src/scss/_app-footer.scss +1 -1
- package/src/scss/_app-main.scss +2 -5
- package/src/scss/_app-sidebar.scss +244 -70
- package/src/scss/_bootstrap-variables.scss +4 -4
- package/src/scss/_cards.scss +31 -7
- package/src/scss/_compact-mode.scss +79 -0
- package/src/scss/_small-box.scss +0 -3
- package/src/scss/_variables.scss +21 -4
- package/src/scss/mixins/_animations.scss +0 -5
- package/src/scss/pages/_lockscreen.scss +74 -0
- package/src/scss/pages/_login_and_register.scss +0 -3
- package/src/scss/parts/_core.scss +2 -0
- package/src/scss/parts/_pages.scss +1 -0
- package/src/ts/card-widget.ts +17 -50
- package/src/ts/direct-chat.ts +2 -2
- package/src/ts/layout.ts +2 -2
- package/src/ts/push-menu.ts +3 -20
- package/src/ts/treeview.ts +14 -8
- package/src/ts/util/index.ts +14 -12
- package/src/utils/index.js +20 -3
- package/src/html/components/docs/color-mode/navbar-html.md +0 -80
- package/src/html/components/docs/color-mode/toggle-script.md +0 -48
package/src/scss/_variables.scss
CHANGED
|
@@ -15,7 +15,9 @@ $lte-transition-fn: ease-in-out !default;
|
|
|
15
15
|
$lte-sidebar-width: 250px !default;
|
|
16
16
|
$lte-sidebar-breakpoint: lg !default;
|
|
17
17
|
$lte-sidebar-padding-x: .5rem !default;
|
|
18
|
+
$lte-sidebar-padding-x-compact: .5rem !default;
|
|
18
19
|
$lte-sidebar-padding-y: .5rem !default;
|
|
20
|
+
$lte-sidebar-padding-y-compact: .25rem !default;
|
|
19
21
|
$lte-sidebar-transition: min-width $lte-transition-speed $lte-transition-fn,
|
|
20
22
|
max-width $lte-transition-speed $lte-transition-fn,
|
|
21
23
|
margin-left $lte-transition-speed $lte-transition-fn,
|
|
@@ -40,25 +42,36 @@ $lte-sidebar-header-color: shade-color($gray-800, 5%) !default;
|
|
|
40
42
|
|
|
41
43
|
// SIDEBAR MINI
|
|
42
44
|
// --------------------------------------------------------
|
|
45
|
+
$nav-link-padding-x-compact: .25rem !default;
|
|
43
46
|
$lte-sidebar-mini-width: ($nav-link-padding-x + $lte-sidebar-padding-x + .8rem) * 2 !default;
|
|
47
|
+
$lte-sidebar-mini-width-compact: ($nav-link-padding-x-compact + $lte-sidebar-padding-x-compact + .8rem) * 2 !default;
|
|
44
48
|
$lte-sidebar-nav-icon-width: $lte-sidebar-mini-width - (($lte-sidebar-padding-x + $nav-link-padding-x) * 2) !default;
|
|
45
|
-
$lte-sidebar-user-image-width: $lte-sidebar-nav-icon-width + ($nav-link-padding-x * .
|
|
49
|
+
$lte-sidebar-user-image-width: $lte-sidebar-nav-icon-width + ($nav-link-padding-x * .4) !default;
|
|
46
50
|
|
|
47
51
|
// MAIN HEADER
|
|
48
52
|
// --------------------------------------------------------
|
|
53
|
+
$nav-link-height-compact: 1.75rem !default;
|
|
49
54
|
$lte-app-header-bottom-border-width: $border-width !default;
|
|
50
55
|
$lte-app-header-bottom-border-color: var(--#{$prefix}border-color) !default;
|
|
51
56
|
$lte-app-header-bottom-border: $lte-app-header-bottom-border-width solid $lte-app-header-bottom-border-color !default;
|
|
52
57
|
$lte-app-header-link-padding-y: $navbar-padding-y !default;
|
|
53
|
-
$lte-app-header-height
|
|
58
|
+
$lte-app-header-height: ($nav-link-height + ($lte-app-header-link-padding-y * 2)) !default;
|
|
59
|
+
$lte-app-header-height-compact: ($nav-link-height-compact + ($lte-app-header-link-padding-y * 2)) !default;
|
|
54
60
|
|
|
55
61
|
// Content padding
|
|
56
62
|
$lte-content-padding-y: 0 !default;
|
|
57
63
|
$lte-content-padding-x: .5rem !default;
|
|
58
64
|
|
|
65
|
+
// MAIN CONTENT
|
|
66
|
+
$lte-app-content-bottom-area-height-sm: 3.5rem !default;
|
|
67
|
+
$lte-app-content-bottom-area-height-md: 6rem !default;
|
|
68
|
+
$lte-app-content-bottom-area-height-lg: 9rem !default;
|
|
69
|
+
$lte-app-content-bottom-area-height-xl: 12rem !default;
|
|
70
|
+
|
|
59
71
|
// MAIN FOOTER
|
|
60
72
|
// --------------------------------------------------------
|
|
61
73
|
$lte-app-footer-padding: 1rem !default;
|
|
74
|
+
$lte-app-footer-padding-compact: .5rem !default;
|
|
62
75
|
$lte-app-footer-border-top-width: 1px !default;
|
|
63
76
|
$lte-app-footer-border-top-color: var(--#{$prefix}border-color) !default;
|
|
64
77
|
$lte-app-footer-border-top: $lte-app-footer-border-top-width solid $lte-app-footer-border-top-color !default;
|
|
@@ -67,8 +80,12 @@ $lte-app-footer-color: var(--#{$prefix}secondary-color) !default;
|
|
|
67
80
|
|
|
68
81
|
// BRAND LINK
|
|
69
82
|
// --------------------------------------------------------
|
|
70
|
-
$
|
|
71
|
-
$
|
|
83
|
+
$navbar-brand-padding-y-compact: $navbar-brand-padding-y * .75 !default;
|
|
84
|
+
$navbar-padding-y-compact: $navbar-padding-y * .5 !default;
|
|
85
|
+
$lte-brand-link-padding-y: $navbar-brand-padding-y + $navbar-padding-y !default;
|
|
86
|
+
$lte-brand-link-padding-y-compact: $navbar-brand-padding-y-compact + $navbar-padding-y-compact !default;
|
|
87
|
+
$lte-brand-link-padding-x: $lte-sidebar-padding-x !default;
|
|
88
|
+
$lte-brand-link-padding-x-compact: $lte-sidebar-padding-x-compact !default;
|
|
72
89
|
$lte-brand-link-border-buttom: 1px !default;
|
|
73
90
|
|
|
74
91
|
|
|
@@ -29,27 +29,22 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
32
|
@keyframes fadeIn {
|
|
34
33
|
from {
|
|
35
|
-
visibility: hidden;
|
|
36
34
|
opacity: 0;
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
to {
|
|
40
|
-
visibility: visible;
|
|
41
38
|
opacity: 1;
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
@keyframes fadeOut {
|
|
46
43
|
from {
|
|
47
|
-
visibility: visible;
|
|
48
44
|
opacity: 1;
|
|
49
45
|
}
|
|
50
46
|
|
|
51
47
|
to {
|
|
52
|
-
visibility: hidden;
|
|
53
48
|
opacity: 0;
|
|
54
49
|
}
|
|
55
50
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Pages: Lock Screen
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// ADD THIS CLASS TO THE <BODY> TAG
|
|
6
|
+
.lockscreen {
|
|
7
|
+
// User name [optional]
|
|
8
|
+
.lockscreen-name {
|
|
9
|
+
font-weight: 600;
|
|
10
|
+
text-align: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.lockscreen-logo {
|
|
14
|
+
margin-bottom: 25px;
|
|
15
|
+
font-size: 35px;
|
|
16
|
+
font-weight: 300;
|
|
17
|
+
text-align: center;
|
|
18
|
+
|
|
19
|
+
a {
|
|
20
|
+
color: var(--#{$prefix}emphasis-color);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.lockscreen-wrapper {
|
|
25
|
+
max-width: 400px;
|
|
26
|
+
margin: 0 auto;
|
|
27
|
+
margin-top: 10%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Will contain the image and the sign in form
|
|
31
|
+
.lockscreen-item {
|
|
32
|
+
position: relative;
|
|
33
|
+
width: 290px;
|
|
34
|
+
padding: 0;
|
|
35
|
+
margin: 10px auto 30px;
|
|
36
|
+
background-color: var(--#{$prefix}body-bg);
|
|
37
|
+
@include border-radius(4px);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// User image
|
|
41
|
+
.lockscreen-image {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: -25px;
|
|
44
|
+
left: -10px;
|
|
45
|
+
z-index: 10;
|
|
46
|
+
padding: 5px;
|
|
47
|
+
background-color: var(--#{$prefix}body-bg);
|
|
48
|
+
@include border-radius(50%);
|
|
49
|
+
|
|
50
|
+
> img {
|
|
51
|
+
@include border-radius(50%);
|
|
52
|
+
width: 70px;
|
|
53
|
+
height: 70px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Contains the password input and the login button
|
|
58
|
+
.lockscreen-credentials {
|
|
59
|
+
margin-left: 70px;
|
|
60
|
+
|
|
61
|
+
.form-control {
|
|
62
|
+
border: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.btn {
|
|
66
|
+
padding: 0 10px;
|
|
67
|
+
border: 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.lockscreen-footer {
|
|
72
|
+
margin-top: 10px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -46,8 +46,6 @@
|
|
|
46
46
|
|
|
47
47
|
.input-group {
|
|
48
48
|
.form-control {
|
|
49
|
-
border-right: 0;
|
|
50
|
-
|
|
51
49
|
&:focus {
|
|
52
50
|
box-shadow: none;
|
|
53
51
|
|
|
@@ -82,7 +80,6 @@
|
|
|
82
80
|
.input-group-text {
|
|
83
81
|
color: var(--#{$prefix}secondary-color);
|
|
84
82
|
background-color: transparent;
|
|
85
|
-
border-left: 0;
|
|
86
83
|
@include border-top-end-radius($border-radius);
|
|
87
84
|
@include border-bottom-end-radius($border-radius);
|
|
88
85
|
@include transition($input-transition);
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
@import "../root";
|
|
6
6
|
@import "../app-wrapper";
|
|
7
|
+
@import "../app-content";
|
|
7
8
|
@import "../app-header";
|
|
8
9
|
@import "../app-sidebar";
|
|
9
10
|
@import "../app-main";
|
|
10
11
|
@import "../app-footer";
|
|
11
12
|
@import "../dropdown";
|
|
12
13
|
@import "../callouts";
|
|
14
|
+
@import "../compact-mode";
|
|
13
15
|
@import "../docs";
|
package/src/ts/card-widget.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
onDOMContentLoaded,
|
|
10
10
|
slideUp,
|
|
11
11
|
slideDown
|
|
12
12
|
} from './util/index'
|
|
@@ -31,40 +31,33 @@ const CLASS_NAME_EXPANDING = 'expanding-card'
|
|
|
31
31
|
const CLASS_NAME_WAS_COLLAPSED = 'was-collapsed'
|
|
32
32
|
const CLASS_NAME_MAXIMIZED = 'maximized-card'
|
|
33
33
|
|
|
34
|
-
const SELECTOR_DATA_REMOVE = '[data-lte-
|
|
34
|
+
const SELECTOR_DATA_REMOVE = '[data-lte-toggle="card-remove"]'
|
|
35
35
|
const SELECTOR_DATA_COLLAPSE = '[data-lte-toggle="card-collapse"]'
|
|
36
36
|
const SELECTOR_DATA_MAXIMIZE = '[data-lte-toggle="card-maximize"]'
|
|
37
37
|
const SELECTOR_CARD = `.${CLASS_NAME_CARD}`
|
|
38
|
-
const SELECTOR_CARD_HEADER = '.card-header'
|
|
39
38
|
const SELECTOR_CARD_BODY = '.card-body'
|
|
40
39
|
const SELECTOR_CARD_FOOTER = '.card-footer'
|
|
41
40
|
|
|
42
|
-
const Default = {
|
|
43
|
-
animationSpeed: 500,
|
|
44
|
-
collapseTrigger: SELECTOR_DATA_COLLAPSE,
|
|
45
|
-
removeTrigger: SELECTOR_DATA_REMOVE,
|
|
46
|
-
maximizeTrigger: SELECTOR_DATA_MAXIMIZE,
|
|
47
|
-
collapseIcon: 'fa-minus',
|
|
48
|
-
expandIcon: 'fa-plus',
|
|
49
|
-
maximizeIcon: 'fa-expand',
|
|
50
|
-
minimizeIcon: 'fa-compress'
|
|
51
|
-
}
|
|
52
|
-
|
|
53
41
|
type Config = {
|
|
54
42
|
animationSpeed: number;
|
|
55
43
|
collapseTrigger: string;
|
|
56
44
|
removeTrigger: string;
|
|
57
45
|
maximizeTrigger: string;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const Default: Config = {
|
|
49
|
+
animationSpeed: 500,
|
|
50
|
+
collapseTrigger: SELECTOR_DATA_COLLAPSE,
|
|
51
|
+
removeTrigger: SELECTOR_DATA_REMOVE,
|
|
52
|
+
maximizeTrigger: SELECTOR_DATA_MAXIMIZE
|
|
62
53
|
}
|
|
63
54
|
|
|
64
55
|
class CardWidget {
|
|
65
56
|
_element: HTMLElement
|
|
66
57
|
_parent: HTMLElement | undefined
|
|
58
|
+
_clone: HTMLElement | undefined
|
|
67
59
|
_config: Config
|
|
60
|
+
|
|
68
61
|
constructor(element: HTMLElement, config: Config) {
|
|
69
62
|
this._element = element
|
|
70
63
|
this._parent = element.closest(SELECTOR_CARD) as HTMLElement | undefined
|
|
@@ -98,13 +91,6 @@ class CardWidget {
|
|
|
98
91
|
}, this._config.animationSpeed)
|
|
99
92
|
}
|
|
100
93
|
|
|
101
|
-
const icon = this._parent?.querySelector(`${SELECTOR_CARD_HEADER} ${this._config.collapseTrigger} .${this._config.collapseIcon}`)
|
|
102
|
-
|
|
103
|
-
if (icon) {
|
|
104
|
-
icon.classList.remove(this._config.collapseIcon)
|
|
105
|
-
icon.classList.add(this._config.expandIcon)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
94
|
this._element?.dispatchEvent(event)
|
|
109
95
|
}
|
|
110
96
|
|
|
@@ -130,13 +116,6 @@ class CardWidget {
|
|
|
130
116
|
}, this._config.animationSpeed)
|
|
131
117
|
}
|
|
132
118
|
|
|
133
|
-
const icon = this._parent?.querySelector(`${SELECTOR_CARD_HEADER} ${this._config.collapseTrigger} .${this._config.expandIcon}`)
|
|
134
|
-
|
|
135
|
-
if (icon) {
|
|
136
|
-
icon.classList.add(this._config.collapseIcon)
|
|
137
|
-
icon.classList.remove(this._config.expandIcon)
|
|
138
|
-
}
|
|
139
|
-
|
|
140
119
|
this._element?.dispatchEvent(event)
|
|
141
120
|
}
|
|
142
121
|
|
|
@@ -163,15 +142,8 @@ class CardWidget {
|
|
|
163
142
|
const event = new Event(EVENT_MAXIMIZED)
|
|
164
143
|
|
|
165
144
|
if (this._parent) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
if (maxElm) {
|
|
169
|
-
maxElm.classList.add(this._config.minimizeIcon)
|
|
170
|
-
maxElm.classList.remove(this._config.maximizeIcon)
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
this._parent.style.height = `${this._parent.scrollHeight}px`
|
|
174
|
-
this._parent.style.width = `${this._parent.scrollWidth}px`
|
|
145
|
+
this._parent.style.height = `${this._parent.offsetHeight}px`
|
|
146
|
+
this._parent.style.width = `${this._parent.offsetWidth}px`
|
|
175
147
|
this._parent.style.transition = 'all .15s'
|
|
176
148
|
|
|
177
149
|
setTimeout(() => {
|
|
@@ -198,14 +170,9 @@ class CardWidget {
|
|
|
198
170
|
const event = new Event(EVENT_MINIMIZED)
|
|
199
171
|
|
|
200
172
|
if (this._parent) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
minElm.classList.add(this._config.maximizeIcon)
|
|
205
|
-
minElm.classList.remove(this._config.minimizeIcon)
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
this._parent.style.cssText = `height: ${this._parent.style.height} !important; width: ${this._parent.style.width} !important; transition: all .15s;`
|
|
173
|
+
this._parent.style.height = 'auto'
|
|
174
|
+
this._parent.style.width = 'auto'
|
|
175
|
+
this._parent.style.transition = 'all .15s'
|
|
209
176
|
|
|
210
177
|
setTimeout(() => {
|
|
211
178
|
const htmlTag = document.querySelector('html')
|
|
@@ -243,7 +210,7 @@ class CardWidget {
|
|
|
243
210
|
* ====================================================
|
|
244
211
|
*/
|
|
245
212
|
|
|
246
|
-
|
|
213
|
+
onDOMContentLoaded(() => {
|
|
247
214
|
const collapseBtn = document.querySelectorAll(SELECTOR_DATA_COLLAPSE)
|
|
248
215
|
|
|
249
216
|
collapseBtn.forEach(btn => {
|
package/src/ts/direct-chat.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
onDOMContentLoaded
|
|
10
10
|
} from './util/index'
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -58,7 +58,7 @@ class DirectChat {
|
|
|
58
58
|
* ====================================================
|
|
59
59
|
*/
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
onDOMContentLoaded(() => {
|
|
62
62
|
const button = document.querySelectorAll(SELECTOR_DATA_TOGGLE)
|
|
63
63
|
|
|
64
64
|
button.forEach(btn => {
|
package/src/ts/layout.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
onDOMContentLoaded
|
|
10
10
|
} from './util/index'
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -42,7 +42,7 @@ class Layout {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
onDOMContentLoaded(() => {
|
|
46
46
|
const data = new Layout(document.body)
|
|
47
47
|
data.holdTransition()
|
|
48
48
|
setTimeout(() => {
|
package/src/ts/push-menu.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
onDOMContentLoaded
|
|
10
10
|
} from './util/index'
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -24,13 +24,11 @@ const EVENT_COLLAPSE = `collapse${EVENT_KEY}`
|
|
|
24
24
|
const CLASS_NAME_SIDEBAR_MINI = 'sidebar-mini'
|
|
25
25
|
const CLASS_NAME_SIDEBAR_COLLAPSE = 'sidebar-collapse'
|
|
26
26
|
const CLASS_NAME_SIDEBAR_OPEN = 'sidebar-open'
|
|
27
|
-
const CLASS_NAME_SIDEBAR_IS_HOVER = 'sidebar-is-hover'
|
|
28
27
|
const CLASS_NAME_SIDEBAR_EXPAND = 'sidebar-expand'
|
|
29
28
|
const CLASS_NAME_SIDEBAR_OVERLAY = 'sidebar-overlay'
|
|
30
29
|
const CLASS_NAME_MENU_OPEN = 'menu-open'
|
|
31
30
|
|
|
32
31
|
const SELECTOR_APP_SIDEBAR = '.app-sidebar'
|
|
33
|
-
const SELECTOR_SIDEBAR_WRAPPER = '.sidebar-wrapper'
|
|
34
32
|
const SELECTOR_SIDEBAR_MENU = '.sidebar-menu'
|
|
35
33
|
const SELECTOR_NAV_ITEM = '.nav-item'
|
|
36
34
|
const SELECTOR_NAV_TREEVIEW = '.nav-treeview'
|
|
@@ -97,20 +95,6 @@ class PushMenu {
|
|
|
97
95
|
this._element.dispatchEvent(event)
|
|
98
96
|
}
|
|
99
97
|
|
|
100
|
-
sidebarHover() {
|
|
101
|
-
const selSidebar = document.querySelector(SELECTOR_SIDEBAR_WRAPPER)
|
|
102
|
-
|
|
103
|
-
if (selSidebar) {
|
|
104
|
-
selSidebar.addEventListener('mouseover', () => {
|
|
105
|
-
document.body.classList.add(CLASS_NAME_SIDEBAR_IS_HOVER)
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
selSidebar.addEventListener('mouseout', () => {
|
|
109
|
-
document.body.classList.remove(CLASS_NAME_SIDEBAR_IS_HOVER)
|
|
110
|
-
})
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
98
|
addSidebarBreakPoint() {
|
|
115
99
|
const sidebarExpandList = document.querySelector(SELECTOR_SIDEBAR_EXPAND)?.classList ?? []
|
|
116
100
|
const sidebarExpand = Array.from(sidebarExpandList).find(className => className.startsWith(CLASS_NAME_SIDEBAR_EXPAND)) ?? ''
|
|
@@ -125,7 +109,7 @@ class PushMenu {
|
|
|
125
109
|
this.expand()
|
|
126
110
|
}
|
|
127
111
|
|
|
128
|
-
if (document.body.classList.contains(CLASS_NAME_SIDEBAR_MINI)) {
|
|
112
|
+
if (document.body.classList.contains(CLASS_NAME_SIDEBAR_MINI) && document.body.classList.contains(CLASS_NAME_SIDEBAR_COLLAPSE)) {
|
|
129
113
|
this.collapse()
|
|
130
114
|
}
|
|
131
115
|
}
|
|
@@ -141,7 +125,6 @@ class PushMenu {
|
|
|
141
125
|
|
|
142
126
|
init() {
|
|
143
127
|
this.addSidebarBreakPoint()
|
|
144
|
-
this.sidebarHover()
|
|
145
128
|
}
|
|
146
129
|
}
|
|
147
130
|
|
|
@@ -151,7 +134,7 @@ class PushMenu {
|
|
|
151
134
|
* ------------------------------------------------------------------------
|
|
152
135
|
*/
|
|
153
136
|
|
|
154
|
-
|
|
137
|
+
onDOMContentLoaded(() => {
|
|
155
138
|
const sidebar = document?.querySelector(SELECTOR_APP_SIDEBAR) as HTMLElement | undefined
|
|
156
139
|
|
|
157
140
|
if (sidebar) {
|
package/src/ts/treeview.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
onDOMContentLoaded,
|
|
10
10
|
slideDown,
|
|
11
11
|
slideUp
|
|
12
12
|
} from './util/index'
|
|
@@ -27,6 +27,7 @@ const EVENT_COLLAPSED = `collapsed${EVENT_KEY}`
|
|
|
27
27
|
|
|
28
28
|
const CLASS_NAME_MENU_OPEN = 'menu-open'
|
|
29
29
|
const SELECTOR_NAV_ITEM = '.nav-item'
|
|
30
|
+
const SELECTOR_NAV_LINK = '.nav-link'
|
|
30
31
|
const SELECTOR_TREEVIEW_MENU = '.nav-treeview'
|
|
31
32
|
const SELECTOR_DATA_TOGGLE = '[data-lte-toggle="treeview"]'
|
|
32
33
|
|
|
@@ -46,12 +47,10 @@ type Config = {
|
|
|
46
47
|
class Treeview {
|
|
47
48
|
_element: HTMLElement
|
|
48
49
|
_config: Config
|
|
49
|
-
_childNavItem: HTMLElement | undefined
|
|
50
50
|
|
|
51
51
|
constructor(element: HTMLElement, config: Config) {
|
|
52
52
|
this._element = element
|
|
53
53
|
this._config = { ...Default, ...config }
|
|
54
|
-
this._childNavItem = this._element.querySelector(SELECTOR_TREEVIEW_MENU) as HTMLElement | undefined
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
open(): void {
|
|
@@ -59,8 +58,9 @@ class Treeview {
|
|
|
59
58
|
|
|
60
59
|
this._element.classList.add(CLASS_NAME_MENU_OPEN)
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
const childElement = this._element?.querySelector(SELECTOR_TREEVIEW_MENU) as HTMLElement | undefined
|
|
62
|
+
if (childElement) {
|
|
63
|
+
slideDown(childElement, this._config.animationSpeed)
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
this._element.dispatchEvent(event)
|
|
@@ -71,8 +71,9 @@ class Treeview {
|
|
|
71
71
|
|
|
72
72
|
this._element.classList.remove(CLASS_NAME_MENU_OPEN)
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
const childElement = this._element?.querySelector(SELECTOR_TREEVIEW_MENU) as HTMLElement | undefined
|
|
75
|
+
if (childElement) {
|
|
76
|
+
slideUp(childElement, this._config.animationSpeed)
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
this._element.dispatchEvent(event)
|
|
@@ -93,13 +94,18 @@ class Treeview {
|
|
|
93
94
|
* ------------------------------------------------------------------------
|
|
94
95
|
*/
|
|
95
96
|
|
|
96
|
-
|
|
97
|
+
onDOMContentLoaded(() => {
|
|
97
98
|
const button = document.querySelectorAll(SELECTOR_DATA_TOGGLE)
|
|
98
99
|
|
|
99
100
|
button.forEach(btn => {
|
|
100
101
|
btn.addEventListener('click', event => {
|
|
101
102
|
const target = event.target as HTMLElement
|
|
102
103
|
const targetItem = target.closest(SELECTOR_NAV_ITEM) as HTMLElement | undefined
|
|
104
|
+
const targetLink = target.closest(SELECTOR_NAV_LINK) as HTMLAnchorElement | undefined
|
|
105
|
+
|
|
106
|
+
if (target?.getAttribute('href') === '#' || targetLink?.getAttribute('href') === '#') {
|
|
107
|
+
event.preventDefault()
|
|
108
|
+
}
|
|
103
109
|
|
|
104
110
|
if (targetItem) {
|
|
105
111
|
const data = new Treeview(targetItem, Default)
|
package/src/ts/util/index.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
const
|
|
1
|
+
const domContentLoadedCallbacks: Array<() => void> = []
|
|
2
|
+
|
|
3
|
+
const onDOMContentLoaded = (callback: () => void): void => {
|
|
2
4
|
if (document.readyState === 'loading') {
|
|
3
|
-
document
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
// add listener on the first call when the document is in loading state
|
|
6
|
+
if (!domContentLoadedCallbacks.length) {
|
|
7
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
8
|
+
for (const callback of domContentLoadedCallbacks) {
|
|
9
|
+
callback()
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
}
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
if (document.readyState === 'complete') {
|
|
11
|
-
callBack()
|
|
14
|
+
domContentLoadedCallbacks.push(callback)
|
|
12
15
|
} else {
|
|
13
|
-
|
|
16
|
+
callback()
|
|
14
17
|
}
|
|
15
18
|
}
|
|
16
19
|
|
|
@@ -91,8 +94,7 @@ const slideToggle = (target: HTMLElement, duration = 500) => {
|
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
export {
|
|
94
|
-
|
|
95
|
-
windowReady,
|
|
97
|
+
onDOMContentLoaded,
|
|
96
98
|
slideUp,
|
|
97
99
|
slideDown,
|
|
98
100
|
slideToggle
|
package/src/utils/index.js
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
function convertPathToHtml(path) {
|
|
2
|
-
let
|
|
2
|
+
let count = 0
|
|
3
|
+
let htmlPath = ''
|
|
3
4
|
while (path.startsWith('../')) {
|
|
5
|
+
count++
|
|
4
6
|
path = path.slice(3)
|
|
5
|
-
htmlpath += htmlpath.length < 2 ? '.' : '/..'
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
if (count === 2) {
|
|
10
|
+
htmlPath = '.'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (count === 3) {
|
|
14
|
+
htmlPath = '..'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (count === 4) {
|
|
18
|
+
htmlPath = '../..'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (count === 5) {
|
|
22
|
+
htmlPath = '../../..'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return htmlPath
|
|
9
26
|
}
|
|
10
27
|
|
|
11
28
|
export { convertPathToHtml }
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
```html
|
|
2
|
-
<!-- Navbar -->
|
|
3
|
-
<nav class="app-header navbar navbar-expand bg-body">
|
|
4
|
-
<div class="container-fluid">
|
|
5
|
-
<!-- Start navbar links -->
|
|
6
|
-
<ul class="navbar-nav">
|
|
7
|
-
<li class="nav-item">
|
|
8
|
-
<a
|
|
9
|
-
class="nav-link"
|
|
10
|
-
data-lte-toggle="sidebar"
|
|
11
|
-
href="#"
|
|
12
|
-
role="button"><i class="fa-solid fa-bars"></i></a
|
|
13
|
-
>
|
|
14
|
-
</li>
|
|
15
|
-
<li class="nav-item d-none d-md-block">
|
|
16
|
-
<a href="#" class="nav-link">Home</a>
|
|
17
|
-
</li>
|
|
18
|
-
<li class="nav-item d-none d-md-block">
|
|
19
|
-
<a href="#" class="nav-link">Contact</a>
|
|
20
|
-
</li>
|
|
21
|
-
</ul>
|
|
22
|
-
<ul class="navbar-nav ms-auto">
|
|
23
|
-
<li class="nav-item dropdown">
|
|
24
|
-
<button
|
|
25
|
-
class="btn btn-link nav-link py-2 px-0 px-lg-2 dropdown-toggle d-flex align-items-center"
|
|
26
|
-
id="bd-theme"
|
|
27
|
-
type="button"
|
|
28
|
-
aria-expanded="false"
|
|
29
|
-
data-bs-toggle="dropdown"
|
|
30
|
-
data-bs-display="static"
|
|
31
|
-
>
|
|
32
|
-
<span class="theme-icon-active">
|
|
33
|
-
<i class="my-1"></i>
|
|
34
|
-
</span>
|
|
35
|
-
</button>
|
|
36
|
-
<ul
|
|
37
|
-
class="dropdown-menu dropdown-menu-end"
|
|
38
|
-
aria-labelledby="bd-theme"
|
|
39
|
-
style="--bs-dropdown-min-width: 8rem;"
|
|
40
|
-
>
|
|
41
|
-
<li>
|
|
42
|
-
<button
|
|
43
|
-
type="button"
|
|
44
|
-
class="dropdown-item d-flex align-items-center active"
|
|
45
|
-
data-bs-theme-value="light"
|
|
46
|
-
>
|
|
47
|
-
<i class="fa-regular fa-sun me-2"></i>
|
|
48
|
-
Light
|
|
49
|
-
<i class="fa-solid fa-check ms-auto d-none"></i>
|
|
50
|
-
</button>
|
|
51
|
-
</li>
|
|
52
|
-
<li>
|
|
53
|
-
<button
|
|
54
|
-
type="button"
|
|
55
|
-
class="dropdown-item d-flex align-items-center"
|
|
56
|
-
data-bs-theme-value="dark"
|
|
57
|
-
>
|
|
58
|
-
<i class="fa-solid fa-moon me-2"></i>
|
|
59
|
-
Dark
|
|
60
|
-
<i class="fa-solid fa-check ms-auto d-none"></i>
|
|
61
|
-
</button>
|
|
62
|
-
</li>
|
|
63
|
-
<li>
|
|
64
|
-
<button
|
|
65
|
-
type="button"
|
|
66
|
-
class="dropdown-item d-flex align-items-center"
|
|
67
|
-
data-bs-theme-value="auto"
|
|
68
|
-
>
|
|
69
|
-
<i class="fa-solid fa-circle-half-stroke me-2"
|
|
70
|
-
></i>
|
|
71
|
-
Auto
|
|
72
|
-
<i class="fa-solid fa-check ms-auto d-none"></i>
|
|
73
|
-
</button>
|
|
74
|
-
</li>
|
|
75
|
-
</ul>
|
|
76
|
-
</li>
|
|
77
|
-
</ul>
|
|
78
|
-
</div>
|
|
79
|
-
</nav>
|
|
80
|
-
```
|