admin-lte 4.0.0-alpha1 → 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 +8 -8
- package/.cache/.eslintcache +1 -0
- package/.cache/.stylelintcache +1 -0
- package/.eslintignore +1 -0
- package/.eslintrc.json +16 -0
- 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/.stylelintrc.json +47 -0
- package/LICENSE +1 -1
- package/README.md +6 -7
- package/dist/assets/img/AdminLTEFullLogo.png +0 -0
- package/dist/css/adminlte.css +2716 -2710
- 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/{rtl/adminlte.rtl.css → adminlte.rtl.css} +2715 -2710
- package/dist/css/adminlte.rtl.css.map +1 -0
- package/dist/css/adminlte.rtl.min.css +7 -0
- package/dist/css/adminlte.rtl.min.css.map +1 -0
- package/dist/js/adminlte.js +204 -233
- package/dist/js/adminlte.js.map +1 -1
- package/dist/js/adminlte.min.js +6 -1
- package/dist/js/adminlte.min.js.map +1 -1
- package/dist/pages/UI/timeline.html +869 -0
- package/dist/pages/docs/browser-support.html +755 -0
- package/dist/pages/docs/color-mode.html +1067 -0
- package/dist/pages/docs/components/main-header.html +1137 -0
- 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 +788 -0
- package/dist/pages/docs/license.html +746 -0
- package/dist/pages/examples/lockscreen.html +107 -0
- package/dist/pages/examples/login-v2.html +148 -0
- package/dist/pages/examples/login.html +128 -196
- package/dist/pages/examples/register-v2.html +155 -0
- package/dist/pages/examples/register.html +131 -199
- package/dist/pages/forms/general.html +1065 -652
- package/dist/pages/index.html +1320 -0
- package/dist/pages/index2.html +1776 -0
- package/dist/pages/index3.html +1111 -0
- 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 +749 -654
- package/dist/pages/layout/layout-rtl.html +766 -0
- package/dist/pages/layout/logo-switch.html +433 -0
- package/dist/pages/layout/sidebar-mini.html +766 -0
- package/dist/pages/layout/unfixed-sidebar.html +747 -654
- package/dist/pages/tables/simple.html +1049 -946
- package/dist/pages/widgets/cards.html +974 -713
- package/dist/pages/widgets/info-box.html +1062 -966
- package/dist/pages/widgets/small-box.html +792 -694
- package/index.html +6 -15
- package/package.json +59 -39
- package/src/assets/img/AdminLTEFullLogo.png +0 -0
- package/src/config/assets.config.mjs +8 -0
- package/src/config/astro.config.mjs +19 -0
- package/src/config/postcss.config.mjs +15 -0
- package/src/config/rollup.config.js +20 -0
- package/src/html/.eslintrc.json +24 -0
- package/src/html/.prettierrc.js +11 -0
- package/src/html/.tsconfig.json +4 -0
- package/src/html/components/_head.astro +47 -0
- package/src/html/components/_scripts.astro +51 -0
- package/src/html/components/dashboard/_footer.astro +18 -0
- package/src/html/components/dashboard/_sidenav.astro +553 -0
- package/src/html/components/dashboard/_topbar.astro +213 -0
- package/src/html/components/docs/browser-support.mdx +23 -0
- package/src/html/components/docs/color-mode.mdx +169 -0
- package/src/{partials/dashboard/_topbar.html → html/components/docs/components/main-header.mdx} +67 -67
- 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.mdx +60 -0
- package/src/html/components/docs/license.mdx +9 -0
- package/src/html/components/javascript/treeview.mdx +39 -0
- package/src/html/env.d.ts +1 -0
- package/src/html/pages/UI/timeline.astro +221 -0
- package/src/html/pages/docs/browser-support.astro +71 -0
- package/src/html/pages/docs/color-mode.astro +271 -0
- package/src/html/pages/docs/components/main-header.astro +319 -0
- 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/introduction.astro +71 -0
- package/src/html/pages/docs/javascript/treeview.astro +71 -0
- package/src/html/pages/docs/layout.astro +120 -0
- 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/{pages/examples/login.html → html/pages/examples/login.astro} +40 -22
- package/src/html/pages/examples/register-v2.astro +116 -0
- package/src/{pages/examples/register.html → html/pages/examples/register.astro} +42 -24
- package/src/html/pages/forms/general.astro +624 -0
- package/src/html/pages/index.astro +790 -0
- package/src/html/pages/index2.astro +1345 -0
- package/src/html/pages/index3.astro +513 -0
- 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 +109 -0
- package/src/html/pages/layout/layout-rtl.astro +109 -0
- package/src/html/pages/layout/logo-switch.astro +212 -0
- package/src/html/pages/layout/sidebar-mini.astro +108 -0
- package/src/html/pages/layout/unfixed-sidebar.astro +107 -0
- package/src/html/pages/tables/simple.astro +472 -0
- package/src/html/pages/widgets/cards.astro +373 -0
- package/src/{pages/widgets/info-box.html → html/pages/widgets/info-box.astro} +110 -60
- package/src/html/pages/widgets/small-box.astro +182 -0
- package/src/scss/_app-content.scss +52 -0
- package/src/scss/_app-footer.scss +15 -0
- package/src/scss/_app-header.scss +26 -0
- package/src/scss/_app-main.scss +17 -0
- package/src/scss/_app-sidebar.scss +603 -0
- package/src/scss/{_wrapper.scss → _app-wrapper.scss} +8 -4
- package/src/scss/_bootstrap-variables.scss +42 -27
- package/src/scss/_callouts.scss +34 -0
- package/src/scss/_cards.scss +54 -224
- package/src/scss/_compact-mode.scss +79 -0
- package/src/scss/_direct-chat.scss +15 -9
- package/src/scss/_docs.scss +4 -0
- package/src/scss/_dropdown.scss +7 -5
- package/src/scss/_info-box.scss +2 -6
- package/src/scss/_miscellaneous.scss +0 -455
- package/src/scss/_mixins.scss +0 -6
- package/src/scss/_root.scss +2 -58
- package/src/scss/_small-box.scss +15 -41
- package/src/scss/_table.scss +0 -50
- package/src/scss/_timeline.scss +120 -0
- package/src/scss/_variables-dark.scss +15 -8
- package/src/scss/_variables.scss +48 -136
- package/src/scss/adminlte.scss +1 -1
- package/src/scss/mixins/_animations.scss +0 -1
- package/src/scss/mixins/_scrollbar.scss +2 -2
- package/src/scss/pages/_lockscreen.scss +74 -0
- package/src/scss/pages/_login_and_register.scss +1 -5
- package/src/scss/parts/_core.scss +9 -15
- package/src/scss/parts/_extra-components.scss +1 -2
- package/src/scss/parts/_pages.scss +1 -0
- package/src/ts/adminlte.ts +0 -2
- package/src/ts/card-widget.ts +57 -66
- package/src/ts/direct-chat.ts +35 -10
- package/src/ts/layout.ts +8 -6
- package/src/ts/push-menu.ts +90 -158
- package/src/ts/treeview.ts +30 -30
- package/src/ts/util/index.ts +14 -12
- package/src/utils/index.js +28 -0
- package/tsconfig.json +11 -3
- package/.stylelintrc +0 -40
- package/CHECKLIST.md +0 -0
- package/dist/css/rtl/adminlte.rtl.css.map +0 -1
- package/dist/css/rtl/adminlte.rtl.min.css +0 -7
- package/dist/css/rtl/adminlte.rtl.min.css.map +0 -1
- package/dist/index.html +0 -1065
- package/dist/index2.html +0 -1629
- package/dist/index3.html +0 -1015
- package/gulpfile.js +0 -315
- package/src/index.html +0 -476
- package/src/index2.html +0 -968
- package/src/index3.html +0 -430
- package/src/pages/forms/general.html +0 -97
- package/src/pages/layout/fixed-sidebar.html +0 -87
- package/src/pages/layout/unfixed-sidebar.html +0 -87
- package/src/pages/tables/simple.html +0 -336
- package/src/pages/widgets/cards.html +0 -143
- package/src/pages/widgets/small-box.html +0 -124
- package/src/partials/_head.html +0 -31
- package/src/partials/_scripts.html +0 -95
- package/src/partials/dashboard/_footer.html +0 -9
- package/src/partials/dashboard/_sidenav.html +0 -244
- package/src/scss/_brand-container.scss +0 -72
- package/src/scss/_content-header.scss +0 -9
- package/src/scss/_content-wrapper.scss +0 -6
- package/src/scss/_content.scss +0 -3
- package/src/scss/_layout-fixed.scss +0 -43
- package/src/scss/_layout-mobile.scss +0 -22
- package/src/scss/_main-footer.scss +0 -28
- package/src/scss/_main-header.scss +0 -40
- package/src/scss/_main-sidebar.scss +0 -63
- package/src/scss/_nav-sidebar.scss +0 -66
- package/src/scss/_products.scss +0 -55
- package/src/scss/_sidebar-close.scss +0 -6
- package/src/scss/_sidebar-collapse.scss +0 -120
- package/src/scss/_sidebar-horizontal.scss +0 -67
- package/src/scss/_sidebar.scss +0 -11
- package/src/scss/_users-list.scss +0 -45
- package/src/scss/mixins/_brand-variant.scss +0 -9
- package/src/scss/mixins/_cards.scss +0 -53
- package/src/scss/mixins/_direct-chat.scss +0 -17
- package/src/scss/mixins/_header-variant.scss +0 -22
- package/src/scss/mixins/_nav-treeview-dark.scss +0 -87
- package/src/scss/mixins/_nav-treeview-light.scss +0 -89
- package/src/scss/mixins/_sidebar-color.scss +0 -9
|
@@ -3,19 +3,13 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
@import "../root";
|
|
6
|
-
@import "../wrapper";
|
|
7
|
-
@import "../
|
|
8
|
-
@import "../
|
|
9
|
-
@import "../
|
|
10
|
-
@import "../
|
|
11
|
-
@import "../
|
|
12
|
-
@import "../sidebar-collapse";
|
|
13
|
-
// @import "../sidebar-horizontal";
|
|
14
|
-
@import "../sidebar-close";
|
|
15
|
-
@import "../content-wrapper";
|
|
16
|
-
@import "../content-header";
|
|
17
|
-
@import "../content";
|
|
18
|
-
@import "../main-footer";
|
|
19
|
-
@import "../layout-fixed";
|
|
20
|
-
@import "../layout-mobile";
|
|
6
|
+
@import "../app-wrapper";
|
|
7
|
+
@import "../app-content";
|
|
8
|
+
@import "../app-header";
|
|
9
|
+
@import "../app-sidebar";
|
|
10
|
+
@import "../app-main";
|
|
11
|
+
@import "../app-footer";
|
|
21
12
|
@import "../dropdown";
|
|
13
|
+
@import "../callouts";
|
|
14
|
+
@import "../compact-mode";
|
|
15
|
+
@import "../docs";
|
package/src/ts/adminlte.ts
CHANGED
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'
|
|
@@ -16,6 +16,14 @@ import {
|
|
|
16
16
|
* ====================================================
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
const DATA_KEY = 'lte.card-widget'
|
|
20
|
+
const EVENT_KEY = `.${DATA_KEY}`
|
|
21
|
+
const EVENT_COLLAPSED = `collapsed${EVENT_KEY}`
|
|
22
|
+
const EVENT_EXPANDED = `expanded${EVENT_KEY}`
|
|
23
|
+
const EVENT_REMOVE = `remove${EVENT_KEY}`
|
|
24
|
+
const EVENT_MAXIMIZED = `maximized${EVENT_KEY}`
|
|
25
|
+
const EVENT_MINIMIZED = `minimized${EVENT_KEY}`
|
|
26
|
+
|
|
19
27
|
const CLASS_NAME_CARD = 'card'
|
|
20
28
|
const CLASS_NAME_COLLAPSED = 'collapsed-card'
|
|
21
29
|
const CLASS_NAME_COLLAPSING = 'collapsing-card'
|
|
@@ -23,40 +31,33 @@ const CLASS_NAME_EXPANDING = 'expanding-card'
|
|
|
23
31
|
const CLASS_NAME_WAS_COLLAPSED = 'was-collapsed'
|
|
24
32
|
const CLASS_NAME_MAXIMIZED = 'maximized-card'
|
|
25
33
|
|
|
26
|
-
const SELECTOR_DATA_REMOVE = '[data-lte-
|
|
34
|
+
const SELECTOR_DATA_REMOVE = '[data-lte-toggle="card-remove"]'
|
|
27
35
|
const SELECTOR_DATA_COLLAPSE = '[data-lte-toggle="card-collapse"]'
|
|
28
36
|
const SELECTOR_DATA_MAXIMIZE = '[data-lte-toggle="card-maximize"]'
|
|
29
37
|
const SELECTOR_CARD = `.${CLASS_NAME_CARD}`
|
|
30
|
-
const SELECTOR_CARD_HEADER = '.card-header'
|
|
31
38
|
const SELECTOR_CARD_BODY = '.card-body'
|
|
32
39
|
const SELECTOR_CARD_FOOTER = '.card-footer'
|
|
33
40
|
|
|
34
|
-
const Default = {
|
|
35
|
-
animationSpeed: 500,
|
|
36
|
-
collapseTrigger: SELECTOR_DATA_COLLAPSE,
|
|
37
|
-
removeTrigger: SELECTOR_DATA_REMOVE,
|
|
38
|
-
maximizeTrigger: SELECTOR_DATA_MAXIMIZE,
|
|
39
|
-
collapseIcon: 'fa-minus',
|
|
40
|
-
expandIcon: 'fa-plus',
|
|
41
|
-
maximizeIcon: 'fa-expand',
|
|
42
|
-
minimizeIcon: 'fa-compress'
|
|
43
|
-
}
|
|
44
|
-
|
|
45
41
|
type Config = {
|
|
46
42
|
animationSpeed: number;
|
|
47
43
|
collapseTrigger: string;
|
|
48
44
|
removeTrigger: string;
|
|
49
45
|
maximizeTrigger: string;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const Default: Config = {
|
|
49
|
+
animationSpeed: 500,
|
|
50
|
+
collapseTrigger: SELECTOR_DATA_COLLAPSE,
|
|
51
|
+
removeTrigger: SELECTOR_DATA_REMOVE,
|
|
52
|
+
maximizeTrigger: SELECTOR_DATA_MAXIMIZE
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
class CardWidget {
|
|
57
56
|
_element: HTMLElement
|
|
58
57
|
_parent: HTMLElement | undefined
|
|
58
|
+
_clone: HTMLElement | undefined
|
|
59
59
|
_config: Config
|
|
60
|
+
|
|
60
61
|
constructor(element: HTMLElement, config: Config) {
|
|
61
62
|
this._element = element
|
|
62
63
|
this._parent = element.closest(SELECTOR_CARD) as HTMLElement | undefined
|
|
@@ -69,18 +70,18 @@ class CardWidget {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
collapse() {
|
|
73
|
+
const event = new Event(EVENT_COLLAPSED)
|
|
74
|
+
|
|
72
75
|
if (this._parent) {
|
|
73
76
|
this._parent.classList.add(CLASS_NAME_COLLAPSING)
|
|
74
77
|
|
|
75
78
|
const elm = this._parent?.querySelectorAll(`${SELECTOR_CARD_BODY}, ${SELECTOR_CARD_FOOTER}`)
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
slideUp(el, this._config.animationSpeed)
|
|
81
|
-
}
|
|
80
|
+
elm.forEach(el => {
|
|
81
|
+
if (el instanceof HTMLElement) {
|
|
82
|
+
slideUp(el, this._config.animationSpeed)
|
|
82
83
|
}
|
|
83
|
-
}
|
|
84
|
+
})
|
|
84
85
|
|
|
85
86
|
setTimeout(() => {
|
|
86
87
|
if (this._parent) {
|
|
@@ -90,27 +91,22 @@ class CardWidget {
|
|
|
90
91
|
}, this._config.animationSpeed)
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (icon) {
|
|
96
|
-
icon.classList.remove(this._config.collapseIcon)
|
|
97
|
-
icon.classList.add(this._config.expandIcon)
|
|
98
|
-
}
|
|
94
|
+
this._element?.dispatchEvent(event)
|
|
99
95
|
}
|
|
100
96
|
|
|
101
97
|
expand() {
|
|
98
|
+
const event = new Event(EVENT_EXPANDED)
|
|
99
|
+
|
|
102
100
|
if (this._parent) {
|
|
103
101
|
this._parent.classList.add(CLASS_NAME_EXPANDING)
|
|
104
102
|
|
|
105
103
|
const elm = this._parent?.querySelectorAll(`${SELECTOR_CARD_BODY}, ${SELECTOR_CARD_FOOTER}`)
|
|
106
104
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
slideDown(el, this._config.animationSpeed)
|
|
111
|
-
}
|
|
105
|
+
elm.forEach(el => {
|
|
106
|
+
if (el instanceof HTMLElement) {
|
|
107
|
+
slideDown(el, this._config.animationSpeed)
|
|
112
108
|
}
|
|
113
|
-
}
|
|
109
|
+
})
|
|
114
110
|
|
|
115
111
|
setTimeout(() => {
|
|
116
112
|
if (this._parent) {
|
|
@@ -120,18 +116,17 @@ class CardWidget {
|
|
|
120
116
|
}, this._config.animationSpeed)
|
|
121
117
|
}
|
|
122
118
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (icon) {
|
|
126
|
-
icon.classList.add(this._config.collapseIcon)
|
|
127
|
-
icon.classList.remove(this._config.expandIcon)
|
|
128
|
-
}
|
|
119
|
+
this._element?.dispatchEvent(event)
|
|
129
120
|
}
|
|
130
121
|
|
|
131
122
|
remove() {
|
|
123
|
+
const event = new Event(EVENT_REMOVE)
|
|
124
|
+
|
|
132
125
|
if (this._parent) {
|
|
133
126
|
slideUp(this._parent, this._config.animationSpeed)
|
|
134
127
|
}
|
|
128
|
+
|
|
129
|
+
this._element?.dispatchEvent(event)
|
|
135
130
|
}
|
|
136
131
|
|
|
137
132
|
toggle() {
|
|
@@ -144,16 +139,11 @@ class CardWidget {
|
|
|
144
139
|
}
|
|
145
140
|
|
|
146
141
|
maximize() {
|
|
147
|
-
|
|
148
|
-
const maxElm = this._parent.querySelector(`${this._config.maximizeTrigger} .${this._config.maximizeIcon}`)
|
|
149
|
-
|
|
150
|
-
if (maxElm) {
|
|
151
|
-
maxElm.classList.add(this._config.minimizeIcon)
|
|
152
|
-
maxElm.classList.remove(this._config.maximizeIcon)
|
|
153
|
-
}
|
|
142
|
+
const event = new Event(EVENT_MAXIMIZED)
|
|
154
143
|
|
|
155
|
-
|
|
156
|
-
this._parent.style.
|
|
144
|
+
if (this._parent) {
|
|
145
|
+
this._parent.style.height = `${this._parent.offsetHeight}px`
|
|
146
|
+
this._parent.style.width = `${this._parent.offsetWidth}px`
|
|
157
147
|
this._parent.style.transition = 'all .15s'
|
|
158
148
|
|
|
159
149
|
setTimeout(() => {
|
|
@@ -172,18 +162,17 @@ class CardWidget {
|
|
|
172
162
|
}
|
|
173
163
|
}, 150)
|
|
174
164
|
}
|
|
165
|
+
|
|
166
|
+
this._element?.dispatchEvent(event)
|
|
175
167
|
}
|
|
176
168
|
|
|
177
169
|
minimize() {
|
|
178
|
-
|
|
179
|
-
const minElm = this._parent.querySelector(`${this._config.maximizeTrigger} .${this._config.minimizeIcon}`)
|
|
180
|
-
|
|
181
|
-
if (minElm) {
|
|
182
|
-
minElm.classList.add(this._config.maximizeIcon)
|
|
183
|
-
minElm.classList.remove(this._config.minimizeIcon)
|
|
184
|
-
}
|
|
170
|
+
const event = new Event(EVENT_MINIMIZED)
|
|
185
171
|
|
|
186
|
-
|
|
172
|
+
if (this._parent) {
|
|
173
|
+
this._parent.style.height = 'auto'
|
|
174
|
+
this._parent.style.width = 'auto'
|
|
175
|
+
this._parent.style.transition = 'all .15s'
|
|
187
176
|
|
|
188
177
|
setTimeout(() => {
|
|
189
178
|
const htmlTag = document.querySelector('html')
|
|
@@ -201,6 +190,8 @@ class CardWidget {
|
|
|
201
190
|
}
|
|
202
191
|
}, 10)
|
|
203
192
|
}
|
|
193
|
+
|
|
194
|
+
this._element?.dispatchEvent(event)
|
|
204
195
|
}
|
|
205
196
|
|
|
206
197
|
toggleMaximize() {
|
|
@@ -219,39 +210,39 @@ class CardWidget {
|
|
|
219
210
|
* ====================================================
|
|
220
211
|
*/
|
|
221
212
|
|
|
222
|
-
|
|
213
|
+
onDOMContentLoaded(() => {
|
|
223
214
|
const collapseBtn = document.querySelectorAll(SELECTOR_DATA_COLLAPSE)
|
|
224
215
|
|
|
225
|
-
|
|
216
|
+
collapseBtn.forEach(btn => {
|
|
226
217
|
btn.addEventListener('click', event => {
|
|
227
218
|
event.preventDefault()
|
|
228
219
|
const target = event.target as HTMLElement
|
|
229
220
|
const data = new CardWidget(target, Default)
|
|
230
221
|
data.toggle()
|
|
231
222
|
})
|
|
232
|
-
}
|
|
223
|
+
})
|
|
233
224
|
|
|
234
225
|
const removeBtn = document.querySelectorAll(SELECTOR_DATA_REMOVE)
|
|
235
226
|
|
|
236
|
-
|
|
227
|
+
removeBtn.forEach(btn => {
|
|
237
228
|
btn.addEventListener('click', event => {
|
|
238
229
|
event.preventDefault()
|
|
239
230
|
const target = event.target as HTMLElement
|
|
240
231
|
const data = new CardWidget(target, Default)
|
|
241
232
|
data.remove()
|
|
242
233
|
})
|
|
243
|
-
}
|
|
234
|
+
})
|
|
244
235
|
|
|
245
236
|
const maxBtn = document.querySelectorAll(SELECTOR_DATA_MAXIMIZE)
|
|
246
237
|
|
|
247
|
-
|
|
238
|
+
maxBtn.forEach(btn => {
|
|
248
239
|
btn.addEventListener('click', event => {
|
|
249
240
|
event.preventDefault()
|
|
250
241
|
const target = event.target as HTMLElement
|
|
251
242
|
const data = new CardWidget(target, Default)
|
|
252
243
|
data.toggleMaximize()
|
|
253
244
|
})
|
|
254
|
-
}
|
|
245
|
+
})
|
|
255
246
|
})
|
|
256
247
|
|
|
257
248
|
export default CardWidget
|
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
|
/**
|
|
@@ -14,6 +14,11 @@ import {
|
|
|
14
14
|
* ====================================================
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
const DATA_KEY = 'lte.direct-chat'
|
|
18
|
+
const EVENT_KEY = `.${DATA_KEY}`
|
|
19
|
+
const EVENT_EXPANDED = `expanded${EVENT_KEY}`
|
|
20
|
+
const EVENT_COLLAPSED = `collapsed${EVENT_KEY}`
|
|
21
|
+
|
|
17
22
|
const SELECTOR_DATA_TOGGLE = '[data-lte-toggle="chat-pane"]'
|
|
18
23
|
const SELECTOR_DIRECT_CHAT = '.direct-chat'
|
|
19
24
|
|
|
@@ -25,9 +30,25 @@ const CLASS_NAME_DIRECT_CHAT_OPEN = 'direct-chat-contacts-open'
|
|
|
25
30
|
*/
|
|
26
31
|
|
|
27
32
|
class DirectChat {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
_element: HTMLElement
|
|
34
|
+
constructor(element: HTMLElement) {
|
|
35
|
+
this._element = element
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
toggle(): void {
|
|
39
|
+
if (this._element.classList.contains(CLASS_NAME_DIRECT_CHAT_OPEN)) {
|
|
40
|
+
const event = new Event(EVENT_COLLAPSED)
|
|
41
|
+
|
|
42
|
+
this._element.classList.remove(CLASS_NAME_DIRECT_CHAT_OPEN)
|
|
43
|
+
|
|
44
|
+
this._element.dispatchEvent(event)
|
|
45
|
+
} else {
|
|
46
|
+
const event = new Event(EVENT_EXPANDED)
|
|
47
|
+
|
|
48
|
+
this._element.classList.add(CLASS_NAME_DIRECT_CHAT_OPEN)
|
|
49
|
+
|
|
50
|
+
this._element.dispatchEvent(event)
|
|
51
|
+
}
|
|
31
52
|
}
|
|
32
53
|
}
|
|
33
54
|
|
|
@@ -37,17 +58,21 @@ class DirectChat {
|
|
|
37
58
|
* ====================================================
|
|
38
59
|
*/
|
|
39
60
|
|
|
40
|
-
|
|
61
|
+
onDOMContentLoaded(() => {
|
|
41
62
|
const button = document.querySelectorAll(SELECTOR_DATA_TOGGLE)
|
|
42
63
|
|
|
43
|
-
|
|
64
|
+
button.forEach(btn => {
|
|
44
65
|
btn.addEventListener('click', event => {
|
|
45
66
|
event.preventDefault()
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
|
|
67
|
+
const target = event.target as HTMLElement
|
|
68
|
+
const chatPane = target.closest(SELECTOR_DIRECT_CHAT) as HTMLElement | undefined
|
|
69
|
+
|
|
70
|
+
if (chatPane) {
|
|
71
|
+
const data = new DirectChat(chatPane)
|
|
72
|
+
data.toggle()
|
|
73
|
+
}
|
|
49
74
|
})
|
|
50
|
-
}
|
|
75
|
+
})
|
|
51
76
|
})
|
|
52
77
|
|
|
53
78
|
export default DirectChat
|
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
|
/**
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
const CLASS_NAME_HOLD_TRANSITIONS = 'hold-transition'
|
|
19
|
+
const CLASS_NAME_APP_LOADED = 'app-loaded'
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Class Definition
|
|
@@ -24,11 +25,9 @@ const CLASS_NAME_HOLD_TRANSITIONS = 'hold-transition'
|
|
|
24
25
|
|
|
25
26
|
class Layout {
|
|
26
27
|
_element: HTMLElement
|
|
27
|
-
_config: undefined
|
|
28
28
|
|
|
29
|
-
constructor(element: HTMLElement
|
|
29
|
+
constructor(element: HTMLElement) {
|
|
30
30
|
this._element = element
|
|
31
|
-
this._config = config as unknown as undefined
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
holdTransition(): void {
|
|
@@ -43,9 +42,12 @@ class Layout {
|
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
const data = new Layout(document.body
|
|
45
|
+
onDOMContentLoaded(() => {
|
|
46
|
+
const data = new Layout(document.body)
|
|
48
47
|
data.holdTransition()
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
document.body.classList.add(CLASS_NAME_APP_LOADED)
|
|
50
|
+
}, 400)
|
|
49
51
|
})
|
|
50
52
|
|
|
51
53
|
export default Layout
|