neo.mjs 6.8.3 → 6.9.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.
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/learnneo/view/home/MainContainer.mjs +4 -3
- package/apps/learnneo/view/home/MainContainerController.mjs +24 -2
- package/apps/route/app.mjs +6 -0
- package/apps/route/index.html +11 -0
- package/apps/route/neo-config.json +6 -0
- package/apps/route/view/ButtonBar.mjs +57 -0
- package/apps/route/view/CenterContainer.mjs +37 -0
- package/apps/route/view/FooterContainer.mjs +47 -0
- package/apps/route/view/HeaderContainer.mjs +47 -0
- package/apps/route/view/MainView.mjs +66 -0
- package/apps/route/view/MainViewController.mjs +210 -0
- package/apps/route/view/MetaContainer.mjs +52 -0
- package/apps/route/view/Viewport.mjs +15 -0
- package/apps/route/view/center/CardAdministration.mjs +36 -0
- package/apps/route/view/center/CardAdministrationDenied.mjs +26 -0
- package/apps/route/view/center/CardContact.mjs +29 -0
- package/apps/route/view/center/CardHome.mjs +26 -0
- package/apps/route/view/center/CardSection1.mjs +26 -0
- package/apps/route/view/center/CardSection2.mjs +27 -0
- package/examples/ConfigurationViewport.mjs +1 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/form/field/select/MainContainer.mjs +1 -2
- package/examples/table/container/MainContainer.mjs +4 -2
- package/examples/table/container/MainModel.mjs +3 -0
- package/examples/table/container/MainStore.mjs +10 -10
- package/examples/toolbar/paging/view/MainContainer.mjs +31 -3
- package/package.json +1 -1
- package/resources/data/learnneo/content.json +9 -9
- package/resources/data/learnneo/pages/whyneo.md +76 -0
- package/resources/scss/src/apps/route/CenterContainer.scss +29 -0
- package/resources/scss/src/apps/route/HeaderContainer.scss +122 -0
- package/resources/scss/src/apps/route/MainView.scss +3 -0
- package/resources/scss/src/apps/route/MetaContainer.scss +44 -0
- package/resources/scss/src/apps/route/_all.scss +1 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/Neo.mjs +15 -14
- package/src/button/Base.mjs +2 -2
- package/src/component/Base.mjs +41 -50
- package/src/container/Base.mjs +59 -2
- package/src/controller/Base.mjs +84 -4
- package/src/controller/Component.mjs +22 -7
- package/src/core/Observable.mjs +50 -9
- package/src/form/field/Range.mjs +8 -0
- package/src/main/DomEvents.mjs +9 -3
- package/src/manager/DomEvent.mjs +3 -0
- package/src/menu/List.mjs +1 -1
- package/src/table/View.mjs +78 -53
- package/src/toolbar/Paging.mjs +68 -76
- package/src/tooltip/Base.mjs +111 -11
package/apps/ServiceWorker.mjs
CHANGED
@@ -22,9 +22,10 @@ class MainContainer extends Container {
|
|
22
22
|
* @member {Object[]} items
|
23
23
|
*/
|
24
24
|
items: [{
|
25
|
-
module: Container,
|
26
|
-
layout: 'fit',
|
27
|
-
|
25
|
+
module : Container,
|
26
|
+
layout : 'fit',
|
27
|
+
minWidth: 350,
|
28
|
+
width : 350,
|
28
29
|
|
29
30
|
items: [{
|
30
31
|
module : ContentTreeList,
|
@@ -16,10 +16,32 @@ class MainContainerController extends Component {
|
|
16
16
|
/**
|
17
17
|
* @param {Object} record
|
18
18
|
*/
|
19
|
-
onContentListLeafClick(record) {
|
20
|
-
|
19
|
+
async onContentListLeafClick(record) {
|
20
|
+
const
|
21
|
+
contentContainer = this.getReference('content-container'),
|
22
|
+
path = '../../../resources/data/learnneo/pages';
|
21
23
|
|
22
24
|
console.log('onContentListLeafClick', {contentContainer, record});
|
25
|
+
console.log('onContentListLeafClick', {contentContainer, record});
|
26
|
+
|
27
|
+
if (record.isLeaf && record.path) {
|
28
|
+
const data = await fetch(`${path}/${record.path}`);
|
29
|
+
const content = await data.text();
|
30
|
+
|
31
|
+
contentContainer.removeAll();
|
32
|
+
|
33
|
+
await this.timeout(50);
|
34
|
+
|
35
|
+
contentContainer.add({
|
36
|
+
ntype: 'component',
|
37
|
+
html : content
|
38
|
+
});
|
39
|
+
|
40
|
+
await this.timeout(50);
|
41
|
+
|
42
|
+
|
43
|
+
contentContainer.layout.activeIndex = 0;
|
44
|
+
}
|
23
45
|
}
|
24
46
|
}
|
25
47
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!DOCTYPE HTML>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
<title>Route</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<script src="../../src/MicroLoader.mjs" type="module"></script>
|
10
|
+
</body>
|
11
|
+
</html>
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import Base from '../../../src/container/Base.mjs';
|
2
|
+
import Button from '../../../src/button/Base.mjs';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @class Route.view.ButtonBar
|
6
|
+
* @extends Neo.container.Base
|
7
|
+
*/
|
8
|
+
class ButtonBar extends Base {
|
9
|
+
static config = {
|
10
|
+
/**
|
11
|
+
* @member {String} className='Route.view.ButtonBar'
|
12
|
+
* @protected
|
13
|
+
*/
|
14
|
+
className: 'Route.view.ButtonBar',
|
15
|
+
baseCls: ['route', 'neo-container'],
|
16
|
+
cls: ['route_buttonbar', 'centerPanel'],
|
17
|
+
/**
|
18
|
+
* @member {Object[]} items
|
19
|
+
*/
|
20
|
+
items: [{
|
21
|
+
module: Button,
|
22
|
+
flex: 'none',
|
23
|
+
handler: 'onSwitchButtonCardHome',
|
24
|
+
cls: ['route_button', 'neo-button'],
|
25
|
+
iconCls: 'fa-solid fa-home',
|
26
|
+
reference: 'home_button',
|
27
|
+
text: 'Home',
|
28
|
+
}, {
|
29
|
+
module: Button,
|
30
|
+
flex: 'none',
|
31
|
+
handler: 'onSwitchButtonCardSection1',
|
32
|
+
cls: ['route_button', 'neo-button'],
|
33
|
+
iconCls: 'fa-solid fa-globe',
|
34
|
+
text: 'Section 1'
|
35
|
+
}, {
|
36
|
+
module: Button,
|
37
|
+
flex: 'none',
|
38
|
+
handler: 'onSwitchButtonCardSection2',
|
39
|
+
cls: ['route_button', 'neo-button'],
|
40
|
+
iconCls: 'fa-solid fa-globe',
|
41
|
+
text: 'Section 2'
|
42
|
+
},{
|
43
|
+
module: Button,
|
44
|
+
flex: 'none',
|
45
|
+
handler: 'onSwitchButtonAdministration',
|
46
|
+
cls: ['route_button', 'neo-button'],
|
47
|
+
iconCls: 'fa-solid fa-building-user',
|
48
|
+
text: 'Administration',
|
49
|
+
}],
|
50
|
+
layout: { ntype: 'flexbox', wrap: 'wrap' },
|
51
|
+
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
Neo.applyClassConfig(ButtonBar);
|
56
|
+
|
57
|
+
export default ButtonBar;
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import Base from '../../../src/container/Base.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Route.view.CenterContainer
|
5
|
+
* @extends Neo.container.Base
|
6
|
+
*/
|
7
|
+
class CenterContainer extends Base {
|
8
|
+
static config = {
|
9
|
+
/**
|
10
|
+
* @member {String} className='Route.view.CenterContainer'
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
className: 'Route.view.CenterContainer',
|
14
|
+
baseCls: ['route_center', 'neo-container'],
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @member {Object[]} items
|
18
|
+
*/
|
19
|
+
items: [
|
20
|
+
{module: () => import('./center/CardContact.mjs')},
|
21
|
+
{module: () => import('./center/CardAdministration.mjs')},
|
22
|
+
{module: () => import('./center/CardSection1.mjs')},
|
23
|
+
{module: () => import('./center/CardSection2.mjs')},
|
24
|
+
{module: () => import('./center/CardHome.mjs')},
|
25
|
+
{module: () => import('./center/CardAdministrationDenied.mjs')},
|
26
|
+
],
|
27
|
+
|
28
|
+
/**
|
29
|
+
* @member {Object} layout={ntype: 'vbox', align: 'stretch'}
|
30
|
+
*/
|
31
|
+
layout: {ntype: 'card', align: 'stretch', activeIndex: 4},
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
Neo.applyClassConfig(CenterContainer);
|
36
|
+
|
37
|
+
export default CenterContainer;
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import Container from '../../../src/container/Base.mjs';
|
2
|
+
import Button from '../../../src/button/Base.mjs';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @class Route.view.FooterContainer
|
6
|
+
* @extends Neo.container.Base
|
7
|
+
*/
|
8
|
+
class FooterContainer extends Container {
|
9
|
+
static config = {
|
10
|
+
/**
|
11
|
+
* @member {String} className='Route.view.FooterContainer'
|
12
|
+
* @protected
|
13
|
+
*/
|
14
|
+
className: 'Route.view.FooterContainer',
|
15
|
+
|
16
|
+
baseCls: ['route_footer', 'neo-container'],
|
17
|
+
|
18
|
+
height: 55,
|
19
|
+
/**
|
20
|
+
* @member {Object[]} items
|
21
|
+
*/
|
22
|
+
items: [
|
23
|
+
{
|
24
|
+
module: Container,
|
25
|
+
reference: 'footer-container',
|
26
|
+
cls: ['centerPanel'],
|
27
|
+
items: [
|
28
|
+
{
|
29
|
+
module: Button,
|
30
|
+
flex: 'none',
|
31
|
+
handler: 'onSwitchButtonCardContact',
|
32
|
+
cls: ['route_button', 'neo-button'],
|
33
|
+
text: 'Contact'
|
34
|
+
}
|
35
|
+
],
|
36
|
+
layout: { ntype: 'hbox', align: 'stretch' },
|
37
|
+
|
38
|
+
}
|
39
|
+
|
40
|
+
],
|
41
|
+
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
Neo.applyClassConfig(FooterContainer);
|
46
|
+
|
47
|
+
export default FooterContainer;
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import Container from '../../../src/container/Base.mjs';
|
2
|
+
import Label from '../../../src/component/Label.mjs';
|
3
|
+
import Button from '../../../src/button/Base.mjs';
|
4
|
+
import Component from '../../../src/component/Base.mjs';
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @class Route.view.HeaderContainer
|
8
|
+
* @extends Neo.container.Base
|
9
|
+
*/
|
10
|
+
class HeaderContainer extends Container {
|
11
|
+
static config = {
|
12
|
+
/**
|
13
|
+
* @member {String} className='Route.view.HeaderContainer'
|
14
|
+
* @protected
|
15
|
+
*/
|
16
|
+
className: 'Route.view.HeaderContainer',
|
17
|
+
baseCls: ['route', 'neo-container', 'route_header'],
|
18
|
+
height: 242,
|
19
|
+
/**
|
20
|
+
* @member {Object[]} items
|
21
|
+
*/
|
22
|
+
items: [
|
23
|
+
{
|
24
|
+
module: Component,
|
25
|
+
reference: 'logo',
|
26
|
+
width: 140,
|
27
|
+
height: 140,
|
28
|
+
cls: ['center'],
|
29
|
+
vdom: {
|
30
|
+
tag: 'img',
|
31
|
+
src: 'https://raw.githubusercontent.com/neomjs/pages/master/resources/images/logo_rounded.svg'
|
32
|
+
}
|
33
|
+
},
|
34
|
+
{
|
35
|
+
module: Label,
|
36
|
+
text: 'neo.mjs routes showcase',
|
37
|
+
cls: ['headline-caption']
|
38
|
+
},
|
39
|
+
],
|
40
|
+
layout: { ntype: 'vbox', align: 'stretch' },
|
41
|
+
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
Neo.applyClassConfig(HeaderContainer);
|
46
|
+
|
47
|
+
export default HeaderContainer;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import MainViewController from './MainViewController.mjs';
|
2
|
+
import HeaderContainer from './HeaderContainer.mjs';
|
3
|
+
import FooterContainer from './FooterContainer.mjs';
|
4
|
+
import CenterContainer from './CenterContainer.mjs';
|
5
|
+
import ButtonBar from './ButtonBar.mjs';
|
6
|
+
import Panel from '../../../src/container/Panel.mjs';
|
7
|
+
import MetaContainer from './MetaContainer.mjs';
|
8
|
+
|
9
|
+
/**
|
10
|
+
* @class Route.view.MainContainer
|
11
|
+
* @extends Neo.container.Viewport
|
12
|
+
*/
|
13
|
+
class MainContainer extends Panel {
|
14
|
+
static config = {
|
15
|
+
/**
|
16
|
+
* @member {String} className='Route.view.MainContainer'
|
17
|
+
* @protected
|
18
|
+
*/
|
19
|
+
className: 'Route.view.MainView',
|
20
|
+
baseCls: ['route'],
|
21
|
+
/**
|
22
|
+
* @member {Boolean} autoMount=true
|
23
|
+
*/
|
24
|
+
// autoMount: true,
|
25
|
+
/**
|
26
|
+
* @member {Neo.controller.Component} controller=MainViewController
|
27
|
+
*/
|
28
|
+
controller: MainViewController,
|
29
|
+
/**
|
30
|
+
* @member {headers[]} items
|
31
|
+
*/
|
32
|
+
headers: [
|
33
|
+
{
|
34
|
+
module: HeaderContainer,
|
35
|
+
dock: 'top'
|
36
|
+
},
|
37
|
+
{
|
38
|
+
module: ButtonBar,
|
39
|
+
dock: 'top',
|
40
|
+
reference: 'buttonbar',
|
41
|
+
|
42
|
+
},
|
43
|
+
{
|
44
|
+
module: FooterContainer,
|
45
|
+
dock: 'bottom'
|
46
|
+
},
|
47
|
+
{
|
48
|
+
module: MetaContainer,
|
49
|
+
dock: 'bottom',
|
50
|
+
reference: 'metabar',
|
51
|
+
}
|
52
|
+
],
|
53
|
+
items: [
|
54
|
+
{
|
55
|
+
module: CenterContainer,
|
56
|
+
reference: 'center-container'
|
57
|
+
|
58
|
+
}
|
59
|
+
],
|
60
|
+
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
Neo.applyClassConfig(MainContainer);
|
65
|
+
|
66
|
+
export default MainContainer;
|
@@ -0,0 +1,210 @@
|
|
1
|
+
import Component from '../../../src/controller/Component.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Route.view.MainContainerController
|
5
|
+
* @extends Neo.controller.Component
|
6
|
+
*/
|
7
|
+
class MainContainerController extends Component {
|
8
|
+
static config = {
|
9
|
+
/**
|
10
|
+
* @member {String} className='Route.view.MainContainerController'
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
className: 'Route.view.MainContainerController',
|
14
|
+
|
15
|
+
|
16
|
+
routes: {
|
17
|
+
'/home': 'handleHomeRoute',
|
18
|
+
'/section1': 'handleSection1Route',
|
19
|
+
'/section2': 'handleSection2Route',
|
20
|
+
'/contact': 'handleContactRoute',
|
21
|
+
'/users/{userId}': { handler: 'handleUserRoute', preHandler: 'doPrehandling' },
|
22
|
+
// '/users/{userId}' : {handler: 'handleUserRoute', preHandler: 'doPrehandling'}, //example
|
23
|
+
// '/users/{userId}/posts/{postId}' : {handler:'handleUserPostsRoute', preHandler: 'doPrehandlingFalse'}, //example
|
24
|
+
// default: 'doDefaultHandling' //optional - example
|
25
|
+
},
|
26
|
+
|
27
|
+
//Demo data
|
28
|
+
data: {
|
29
|
+
users: [{ id: 1, name: 'Joe Doe' }, { id: 2, name: 'Max Mustermann' }],
|
30
|
+
activeUser: 0
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
onConstructed() {
|
35
|
+
super.onConstructed();
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Card sort order
|
40
|
+
* 0 - Contact
|
41
|
+
* 1 - Administration
|
42
|
+
* 2 - Section 1
|
43
|
+
* 3 - Section 2
|
44
|
+
* 4 - Home
|
45
|
+
*/
|
46
|
+
|
47
|
+
|
48
|
+
doPrehandling(value, oldValue, params = null) {
|
49
|
+
const userId = parseInt(params);
|
50
|
+
if (userId > 0 && userId === this.data.activeUser) {
|
51
|
+
return true;
|
52
|
+
}
|
53
|
+
|
54
|
+
const centerContainer = this.getReference('center-container');
|
55
|
+
centerContainer.layout.activeIndex = 5;
|
56
|
+
|
57
|
+
return false;
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
/**
|
62
|
+
* @param {Object} data
|
63
|
+
*/
|
64
|
+
onSwitchButtonCardContact(data) {
|
65
|
+
Neo.Main.redirectTo({ url: '#/contact' });
|
66
|
+
this.#removeFromButtonSelection();
|
67
|
+
this.#addButtonSelection(data);
|
68
|
+
}
|
69
|
+
|
70
|
+
/**
|
71
|
+
* @param {Object} data
|
72
|
+
*/
|
73
|
+
onSwitchButtonAdministration(data) {
|
74
|
+
|
75
|
+
Neo.Main.redirectTo({ url: `#/users/${this.data.activeUser}` });
|
76
|
+
this.#removeFromButtonSelection();
|
77
|
+
this.#addButtonSelection(data);
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
/**
|
82
|
+
* @param {Object} data
|
83
|
+
*/
|
84
|
+
onSwitchButtonCardSection1(data) {
|
85
|
+
Neo.Main.redirectTo({ url: '#/section1' });
|
86
|
+
this.#removeFromButtonSelection();
|
87
|
+
this.#addButtonSelection(data);
|
88
|
+
|
89
|
+
}
|
90
|
+
|
91
|
+
/**
|
92
|
+
* @param {Object} data
|
93
|
+
*/
|
94
|
+
onSwitchButtonCardSection2(data) {
|
95
|
+
Neo.Main.redirectTo({ url: '#/section2' });
|
96
|
+
this.#removeFromButtonSelection();
|
97
|
+
this.#addButtonSelection(data);
|
98
|
+
}
|
99
|
+
|
100
|
+
/**
|
101
|
+
* @param {Object} data
|
102
|
+
*/
|
103
|
+
onSwitchButtonCardHome(data) {
|
104
|
+
Neo.Main.redirectTo({ url: '#/home' });
|
105
|
+
this.#removeFromButtonSelection();
|
106
|
+
this.#addButtonSelection(data);
|
107
|
+
}
|
108
|
+
|
109
|
+
/**
|
110
|
+
* @param {Object} data
|
111
|
+
*/
|
112
|
+
onSwitchButtonMetaUser1(data) {
|
113
|
+
const currentUser = this.data.activeUser;
|
114
|
+
this.data.activeUser = 1;
|
115
|
+
this.#removeMetaButtonSelection();
|
116
|
+
this.#setUsername();
|
117
|
+
data.component?.addCls('route_meta_button_grant_selected');
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* @param {Object} data
|
122
|
+
*/
|
123
|
+
onSwitchButtonMetaUser2(data) {
|
124
|
+
const currentUser = this.data.activeUser;
|
125
|
+
this.data.activeUser = 2;
|
126
|
+
this.#removeMetaButtonSelection();
|
127
|
+
this.#setUsername();
|
128
|
+
data.component?.addCls('route_meta_button_grant_selected');
|
129
|
+
}
|
130
|
+
|
131
|
+
/**
|
132
|
+
* @param {Object} data
|
133
|
+
*/
|
134
|
+
onSwitchButtonMetaReset(data) {
|
135
|
+
const currentUser = this.data.activeUser;
|
136
|
+
this.data.activeUser = 0;
|
137
|
+
this.#setUsername();
|
138
|
+
this.#removeMetaButtonSelection();
|
139
|
+
}
|
140
|
+
|
141
|
+
handleHomeRoute(value, oldValue, params = null) {
|
142
|
+
const centerContainer = this.getReference('center-container');
|
143
|
+
centerContainer.layout.activeIndex = 4;
|
144
|
+
}
|
145
|
+
|
146
|
+
handleSection1Route(value, oldValue, params = null) {
|
147
|
+
const centerContainer = this.getReference('center-container');
|
148
|
+
centerContainer.layout.activeIndex = 2;
|
149
|
+
}
|
150
|
+
|
151
|
+
handleSection2Route(value, oldValue, params = null) {
|
152
|
+
const centerContainer = this.getReference('center-container');
|
153
|
+
centerContainer.layout.activeIndex = 3;
|
154
|
+
}
|
155
|
+
|
156
|
+
handleContactRoute(value, oldValue, params = null) {
|
157
|
+
const centerContainer = this.getReference('center-container');
|
158
|
+
centerContainer.layout.activeIndex = 0;
|
159
|
+
}
|
160
|
+
|
161
|
+
handleUserRoute(value, oldValue, params = null) {
|
162
|
+
const centerContainer = this.getReference('center-container');
|
163
|
+
centerContainer.layout.activeIndex = 1
|
164
|
+
}
|
165
|
+
|
166
|
+
#removeFromButtonSelection() {
|
167
|
+
const buttonbar = this.getReference('buttonbar');
|
168
|
+
buttonbar.items.forEach(element => {
|
169
|
+
element.removeCls('route_button_selected');
|
170
|
+
});
|
171
|
+
|
172
|
+
const footer = this.getReference('footer-container');
|
173
|
+
footer.items.forEach(element => {
|
174
|
+
element.removeCls('route_button_selected');
|
175
|
+
});
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
#addButtonSelection(data) {
|
180
|
+
data.component?.addCls('route_button_selected');
|
181
|
+
}
|
182
|
+
|
183
|
+
#removeMetaButtonSelection(user) {
|
184
|
+
const buttonbar = this.getReference('metabar');
|
185
|
+
buttonbar.items.forEach(element => {
|
186
|
+
element.removeCls('route_meta_button_grant_selected');
|
187
|
+
});
|
188
|
+
this.#removeFromButtonSelection();
|
189
|
+
const data = {
|
190
|
+
component: this.getReference('home_button')
|
191
|
+
}
|
192
|
+
this.#addButtonSelection(data);
|
193
|
+
Neo.Main.redirectTo({ url: '#/home' });
|
194
|
+
|
195
|
+
}
|
196
|
+
|
197
|
+
#setUsername() {
|
198
|
+
const user = this.data.users.find(item => { return item.id === this.data.activeUser });
|
199
|
+
|
200
|
+
const centerContainer = this.getReference('center-container');
|
201
|
+
const adminPage = centerContainer.items[1];
|
202
|
+
adminPage.username = user ? user.name : '';
|
203
|
+
|
204
|
+
}
|
205
|
+
|
206
|
+
}
|
207
|
+
|
208
|
+
Neo.applyClassConfig(MainContainerController);
|
209
|
+
|
210
|
+
export default MainContainerController;
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import Container from '../../../src/container/Base.mjs';
|
2
|
+
import Button from '../../../src/button/Base.mjs';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @class Route.view.MetaContainer
|
6
|
+
* @extends Neo.container.Base
|
7
|
+
*/
|
8
|
+
class MetaContainer extends Container {
|
9
|
+
static config = {
|
10
|
+
/**
|
11
|
+
* @member {String} className='Route.view.MetaContainer'
|
12
|
+
* @protected
|
13
|
+
*/
|
14
|
+
className: 'Route.view.MetaContainer',
|
15
|
+
|
16
|
+
baseCls: ['route_meta', 'route_meta_color','route_meta_center', 'neo-container'],
|
17
|
+
|
18
|
+
height: 55,
|
19
|
+
/**
|
20
|
+
* @member {Object[]} items
|
21
|
+
*/
|
22
|
+
items: [
|
23
|
+
{
|
24
|
+
module: Button,
|
25
|
+
flex: 'none',
|
26
|
+
handler: 'onSwitchButtonMetaUser1',
|
27
|
+
cls: ['route_meta_button_grant', 'neo-button'],
|
28
|
+
text: 'User 1'
|
29
|
+
},
|
30
|
+
{
|
31
|
+
module: Button,
|
32
|
+
flex: 'none',
|
33
|
+
handler: 'onSwitchButtonMetaUser2',
|
34
|
+
cls: ['route_meta_button_grant', 'neo-button'],
|
35
|
+
text: 'User 2'
|
36
|
+
},
|
37
|
+
{
|
38
|
+
module: Button,
|
39
|
+
flex: 'none',
|
40
|
+
handler: 'onSwitchButtonMetaReset',
|
41
|
+
cls: ['route_meta_button_remove', 'neo-button'],
|
42
|
+
text: 'Reset User'
|
43
|
+
}
|
44
|
+
],
|
45
|
+
layout: { ntype: 'hbox', align: 'stretch' },
|
46
|
+
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
Neo.applyClassConfig(MetaContainer);
|
51
|
+
|
52
|
+
export default MetaContainer;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
import Base from '../../../src/container/Viewport.mjs';
|
3
|
+
import MainView from './MainView.mjs';
|
4
|
+
|
5
|
+
class Viewport extends Base {
|
6
|
+
static config = {
|
7
|
+
className: 'Route.view.Viewport',
|
8
|
+
autoMount: true,
|
9
|
+
layout: { ntype: 'fit' },
|
10
|
+
items: [{ module: MainView }]
|
11
|
+
}
|
12
|
+
|
13
|
+
}
|
14
|
+
Neo.applyClassConfig(Viewport);
|
15
|
+
export default Viewport;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import Container from '../../../../src/container/Base.mjs';
|
2
|
+
import Label from '../../../../src/component/Label.mjs';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @class Route.view.center.CardAdministration
|
6
|
+
* @extends Neo.container.Base
|
7
|
+
*/
|
8
|
+
class CardAdministration extends Container {
|
9
|
+
static config = {
|
10
|
+
/**
|
11
|
+
* @member {String} className='Route.view.center.CardAdministration'
|
12
|
+
* @protected
|
13
|
+
*/
|
14
|
+
className: 'Route.view.center.CardAdministration',
|
15
|
+
baseCls: ['route_card_simple_page', 'neo-container'],
|
16
|
+
|
17
|
+
username_: '',
|
18
|
+
/**
|
19
|
+
* @member {Object[]} items
|
20
|
+
*/
|
21
|
+
|
22
|
+
vdom: {
|
23
|
+
tag: 'h1',
|
24
|
+
innerHTML: 'Access Granted.'
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
|
29
|
+
afterSetUsername(value, oldValue){
|
30
|
+
this.vdom.innerHTML = `Access Granted to ${this.username}.`;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
Neo.applyClassConfig(CardAdministration);
|
35
|
+
|
36
|
+
export default CardAdministration;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import Container from '../../../../src/container/Base.mjs';
|
2
|
+
import Label from '../../../../src/component/Label.mjs';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @class Route.view.center.CardAdministrationDenied
|
6
|
+
* @extends Neo.container.Base
|
7
|
+
*/
|
8
|
+
class CardAdministrationDenied extends Container {
|
9
|
+
static config = {
|
10
|
+
/**
|
11
|
+
* @member {String} className='Route.view.center.CardAdministrationDenied'
|
12
|
+
* @protected
|
13
|
+
*/
|
14
|
+
className: 'Route.view.center.CardAdministrationDenied',
|
15
|
+
baseCls: ['route_card_simple_page','neo-container'],
|
16
|
+
|
17
|
+
vdom: {
|
18
|
+
tag: 'h1',
|
19
|
+
innerHTML: 'Access Denied.'
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
Neo.applyClassConfig(CardAdministrationDenied);
|
25
|
+
|
26
|
+
export default CardAdministrationDenied;
|