neo.mjs 4.6.0 → 4.6.2
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/README.md +0 -8
- package/docs/app/view/MainContainerController.mjs +12 -11
- package/docs/app/view/classdetails/SourceViewComponent.mjs +12 -12
- package/examples/form/field/text/MainContainer.mjs +6 -0
- package/examples/toast/MainContainer.mjs +131 -0
- package/examples/toast/MainContainerController.mjs +95 -0
- package/examples/toast/app.mjs +7 -0
- package/examples/toast/index.html +27 -0
- package/examples/toast/neo-config.json +7 -0
- package/examples/toast/resources/highlight/CHANGES.md +1739 -0
- package/examples/toast/resources/highlight/LICENSE +24 -0
- package/examples/toast/resources/highlight/README.md +186 -0
- package/examples/toast/resources/highlight/highlight.pack.js +2 -0
- package/examples/toast/resources/highlightjs-custom-dark-theme.css +120 -0
- package/examples/toast/resources/highlightjs-custom-github-theme.css +136 -0
- package/package.json +1 -1
- package/resources/scss/src/dialog/Toast.scss +34 -8
- package/resources/scss/src/form/field/Text.scss +38 -0
- package/resources/scss/theme-dark/dialog/Toast.scss +13 -0
- package/resources/scss/theme-dark/form/field/Text.scss +44 -34
- package/resources/scss/theme-light/dialog/Toast.scss +25 -0
- package/resources/scss/theme-light/form/field/Text.scss +44 -34
- package/src/component/Base.mjs +1 -17
- package/src/form/field/CheckBox.mjs +3 -3
- package/src/form/field/Text.mjs +27 -4
- package/src/main/addon/HighlightJS.mjs +28 -15
- package/src/manager/Toast.mjs +1 -1
package/README.md
CHANGED
@@ -36,7 +36,6 @@ No need to take care of a workers setup, and the cross channel communication on
|
|
36
36
|
11. <a href="#story--vision">Story & Vision</a>
|
37
37
|
12. <a href="#contributors">neo.mjs is in need of more contributors!</a>
|
38
38
|
13. <a href="#sponsors">neo.mjs is in need of more sponsors!</a>
|
39
|
-
14. <a href="#jobs">Jobs</a>
|
40
39
|
|
41
40
|
</br></br>
|
42
41
|
<h2 id="slack-channel">1. Slack Channel for questions, ideas & feedback</h2>
|
@@ -234,13 +233,6 @@ The benefit of doing so is getting results delivered faster.
|
|
234
233
|
|
235
234
|
More infos: <a href="./BACKERS.md">Sponsors & Backers</a>
|
236
235
|
|
237
|
-
</br></br>
|
238
|
-
<h2 id="jobs">14. Jobs</h2>
|
239
|
-
Accenture is hiring multiple neo.mjs developers for the new Cloud Technology Studio in Kaiserslauern (Germany):
|
240
|
-
<a href="https://www.accenture.com/de-de/careers/jobdetails?id=R00057924_de">Senior neo.mjs Frontend Developer /Architect (all genders)</a></br></br>
|
241
|
-
|
242
|
-
These full-time roles are based on German contracts, so they require living in (or relocating to) Germany.
|
243
|
-
Ping us on LinkedIn or Slack for details.
|
244
236
|
|
245
237
|
</br></br>
|
246
238
|
Logo contributed by <a href="https://www.linkedin.com/in/torsten-dinkheller-614516231/">Torsten Dinkheller</a>.
|
@@ -69,9 +69,9 @@ class MainContainerController extends Component {
|
|
69
69
|
/* webpackIgnore: true */
|
70
70
|
record.path).then((module) => {
|
71
71
|
contentTabContainer.add({
|
72
|
-
module
|
73
|
-
id
|
74
|
-
tabButtonConfig
|
72
|
+
module: module.default,
|
73
|
+
id : name,
|
74
|
+
tabButtonConfig
|
75
75
|
});
|
76
76
|
}
|
77
77
|
);
|
@@ -86,15 +86,15 @@ class MainContainerController extends Component {
|
|
86
86
|
modules.forEach(module => {
|
87
87
|
items.push({
|
88
88
|
module: module.default
|
89
|
-
})
|
89
|
+
})
|
90
90
|
});
|
91
91
|
|
92
92
|
contentTabContainer.add({
|
93
|
-
ntype
|
94
|
-
id
|
95
|
-
items
|
96
|
-
style
|
97
|
-
tabButtonConfig
|
93
|
+
ntype: 'container',
|
94
|
+
id : name,
|
95
|
+
items,
|
96
|
+
style: {padding: '10px'},
|
97
|
+
tabButtonConfig
|
98
98
|
});
|
99
99
|
})
|
100
100
|
}
|
@@ -164,8 +164,9 @@ class MainContainerController extends Component {
|
|
164
164
|
}
|
165
165
|
|
166
166
|
Neo.main.addon.Stylesheet.swapStyleSheet({
|
167
|
-
|
168
|
-
|
167
|
+
appName: me.component.appName,
|
168
|
+
href,
|
169
|
+
id : 'hljs-theme'
|
169
170
|
}).then(data => {
|
170
171
|
button.text = buttonText;
|
171
172
|
});
|
@@ -60,11 +60,11 @@ class SourceViewComponent extends Component {
|
|
60
60
|
construct(config) {
|
61
61
|
super.construct(config);
|
62
62
|
|
63
|
-
let me
|
64
|
-
url
|
63
|
+
let me = this,
|
64
|
+
url = '../../' + me.structureData.srcPath;
|
65
65
|
|
66
66
|
Neo.Xhr.promiseRequest({
|
67
|
-
url
|
67
|
+
url
|
68
68
|
}).then(data => {
|
69
69
|
me.applySourceCode(data.response);
|
70
70
|
});
|
@@ -79,11 +79,9 @@ class SourceViewComponent extends Component {
|
|
79
79
|
afterSetMounted(value, oldValue) {
|
80
80
|
super.afterSetMounted(value, oldValue);
|
81
81
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
}, 50);
|
86
|
-
}
|
82
|
+
value && setTimeout(() => {
|
83
|
+
this.syntaxHighlight();
|
84
|
+
}, 50);
|
87
85
|
}
|
88
86
|
|
89
87
|
/**
|
@@ -99,10 +97,11 @@ class SourceViewComponent extends Component {
|
|
99
97
|
setTimeout(() => {
|
100
98
|
Neo.main.addon.HighlightJS.syntaxHighlightLine({
|
101
99
|
addLine : me.line,
|
100
|
+
appName : me.appName,
|
102
101
|
removeLine: me.previousLine,
|
103
102
|
vnodeId : me.vdom.cn[0].id
|
104
103
|
});
|
105
|
-
}, 50)
|
104
|
+
}, 50)
|
106
105
|
}
|
107
106
|
}
|
108
107
|
|
@@ -120,7 +119,7 @@ class SourceViewComponent extends Component {
|
|
120
119
|
}
|
121
120
|
|
122
121
|
if (me.isHighlighted) {
|
123
|
-
me.afterSetIsHighlighted(true, false)
|
122
|
+
me.afterSetIsHighlighted(true, false)
|
124
123
|
}
|
125
124
|
}
|
126
125
|
|
@@ -135,7 +134,7 @@ class SourceViewComponent extends Component {
|
|
135
134
|
node.cn[0].innerHTML = data; // code tag
|
136
135
|
me.update();
|
137
136
|
|
138
|
-
me.mounted && me.syntaxHighlight()
|
137
|
+
me.mounted && me.syntaxHighlight()
|
139
138
|
}
|
140
139
|
|
141
140
|
/**
|
@@ -145,6 +144,7 @@ class SourceViewComponent extends Component {
|
|
145
144
|
let me = this;
|
146
145
|
|
147
146
|
Neo.main.addon.HighlightJS.syntaxHighlight({
|
147
|
+
appName: me.appName,
|
148
148
|
vnodeId: me.vdom.cn[0].id
|
149
149
|
}).then(() => {
|
150
150
|
if (!me.isHighlighted) {
|
@@ -152,7 +152,7 @@ class SourceViewComponent extends Component {
|
|
152
152
|
} else {
|
153
153
|
me.afterSetIsHighlighted(true, false);
|
154
154
|
}
|
155
|
-
})
|
155
|
+
})
|
156
156
|
}
|
157
157
|
}
|
158
158
|
|
@@ -132,6 +132,12 @@ class MainContainer extends ConfigurationViewport {
|
|
132
132
|
labelText: 'placeholderText',
|
133
133
|
listeners: {change: me.onConfigChange.bind(me, 'placeholderText')},
|
134
134
|
value : me.exampleComponent.placeholderText
|
135
|
+
}, {
|
136
|
+
module : CheckBox,
|
137
|
+
checked : me.exampleComponent.readOnly,
|
138
|
+
labelText: 'readOnly',
|
139
|
+
listeners: {change: me.onConfigChange.bind(me, 'readOnly')},
|
140
|
+
style : {marginTop: '10px'}
|
135
141
|
}, {
|
136
142
|
module : CheckBox,
|
137
143
|
checked : me.exampleComponent.required,
|
@@ -0,0 +1,131 @@
|
|
1
|
+
import Button from '../../src/button/Base.mjs';
|
2
|
+
import CheckBox from '../../src/form/field/CheckBox.mjs';
|
3
|
+
import Component from '../../src/component/Base.mjs';
|
4
|
+
import FormContainer from '../../src/form/Container.mjs';
|
5
|
+
import MainContainerController from './MainContainerController.mjs';
|
6
|
+
import NumberField from '../../src/form/field/Number.mjs';
|
7
|
+
import SelectField from '../../src/form/field/Select.mjs';
|
8
|
+
import TextField from '../../src/form/field/Text.mjs';
|
9
|
+
import Viewport from '../../src/container/Viewport.mjs';
|
10
|
+
|
11
|
+
/**
|
12
|
+
* @class Neo.examples.toast.MainContainer
|
13
|
+
* @extends Neo.container.Viewport
|
14
|
+
*/
|
15
|
+
class MainContainer extends Viewport {
|
16
|
+
static getConfig() {return {
|
17
|
+
className : 'Neo.examples.toast.MainContainer',
|
18
|
+
autoMount : true,
|
19
|
+
controller: MainContainerController,
|
20
|
+
layout: {ntype: 'hbox', align: 'stretch'},
|
21
|
+
|
22
|
+
items: [{
|
23
|
+
module : FormContainer,
|
24
|
+
flex : 'none',
|
25
|
+
layout : {ntype: 'vbox'},
|
26
|
+
style : {margin: '20px'},
|
27
|
+
reference: 'form',
|
28
|
+
|
29
|
+
itemDefaults: {
|
30
|
+
height : 27,
|
31
|
+
labelPosition : 'inline',
|
32
|
+
listeners : {change: 'onChange'},
|
33
|
+
maxValue : 4000,
|
34
|
+
style : {marginLeft: '10px'},
|
35
|
+
useSpinButtons: false,
|
36
|
+
width : 150
|
37
|
+
},
|
38
|
+
|
39
|
+
items: [{
|
40
|
+
module : TextField,
|
41
|
+
labelText: 'msg',
|
42
|
+
name : 'msg',
|
43
|
+
required : true,
|
44
|
+
style : {paddingBottom: '40px', marginLeft: '10px'}
|
45
|
+
}, {
|
46
|
+
module : TextField,
|
47
|
+
labelText: 'tile',
|
48
|
+
name : 'title'
|
49
|
+
}, {
|
50
|
+
module : TextField,
|
51
|
+
labelText: 'iconCls',
|
52
|
+
name : 'iconCls'
|
53
|
+
}, {
|
54
|
+
module : SelectField,
|
55
|
+
labelText: 'position',
|
56
|
+
name : 'position',
|
57
|
+
store : {data: [{name: 'tl'}, {name: 'tc'}, {name: 'tr'}, {name: 'bl'}, {name: 'bc'}, {name: 'br'}]}
|
58
|
+
}, {
|
59
|
+
module : SelectField,
|
60
|
+
labelText: 'slideDirection',
|
61
|
+
name : 'slideDirection',
|
62
|
+
store : {data: [{name: 'down'}, {name: 'up'}, {name: 'left'}, {name: 'right'}]}
|
63
|
+
}, {
|
64
|
+
module : SelectField,
|
65
|
+
labelText: 'ui',
|
66
|
+
name : 'ui',
|
67
|
+
store : {data: [{name: 'info'}, {name: 'danger'}, {name: 'success'}]}
|
68
|
+
}, {
|
69
|
+
module : NumberField,
|
70
|
+
labelText: 'minHeight',
|
71
|
+
name : 'minHeight'
|
72
|
+
}, {
|
73
|
+
module : NumberField,
|
74
|
+
labelText: 'maxWidth',
|
75
|
+
name : 'maxWidth'
|
76
|
+
}, {
|
77
|
+
module : CheckBox,
|
78
|
+
labelText : 'Closable',
|
79
|
+
labelWidth: 70,
|
80
|
+
name : 'closable',
|
81
|
+
reference : 'closable',
|
82
|
+
style : {padding: '8px 0 10px 9px'}
|
83
|
+
}, {
|
84
|
+
module : Button,
|
85
|
+
reference: 'creation-button',
|
86
|
+
disabled : true,
|
87
|
+
handler : 'createToast',
|
88
|
+
height : 27,
|
89
|
+
iconCls : 'fa-solid fa-window-maximize',
|
90
|
+
style : {marginLeft: '10px'},
|
91
|
+
text : 'create toast'
|
92
|
+
}]
|
93
|
+
}, {
|
94
|
+
module: Component,
|
95
|
+
reference: 'output',
|
96
|
+
cls: ['output'],
|
97
|
+
vdom:
|
98
|
+
{cn: [
|
99
|
+
{tag: 'pre', cn: [
|
100
|
+
{tag: 'code', class: 'javascript'}
|
101
|
+
]}
|
102
|
+
]},
|
103
|
+
|
104
|
+
itemTpl: data => {
|
105
|
+
return [
|
106
|
+
{cls: 'import', innerHTML: 'import Toast from \'../../../../node_modules/neo.mjs/src/dialog/Toast.mjs\';'},
|
107
|
+
{innerHTML: 'Neo.toast({'},
|
108
|
+
{cls: 'tab', cn: [
|
109
|
+
{cls: 'grey', innerHTML: '/* mandatory */'},
|
110
|
+
{innerHTML: `appName: '${data.appName}',`},
|
111
|
+
{innerHTML: `msg: '${data.msg}',`},
|
112
|
+
{innerHTML: '/* optional */'},
|
113
|
+
{innerHTML: `title: '${data.title}',`, removeDom: !data.title},
|
114
|
+
{innerHTML: `iconCls: '${data.iconCls}',`, removeDom: !data.iconCls},
|
115
|
+
{innerHTML: `closable: ${data.closable},`, removeDom: !data.closable},
|
116
|
+
{innerHTML: `position: '${data.position}',`, removeDom: !data.position},
|
117
|
+
{innerHTML: `slideDirection: '${data.slideDirection}',`, removeDom: !data.slideDirection},
|
118
|
+
{innerHTML: `maxWidth: ${data.maxWidth},`, removeDom: !data.maxWidth},
|
119
|
+
{innerHTML: `minHeight: ${data.minHeight},`, removeDom: !data.minHeight},
|
120
|
+
{innerHTML: `ui: '${data.ui}'`, removeDom: !data.ui},
|
121
|
+
]},
|
122
|
+
{innerHTML: '})'}
|
123
|
+
]
|
124
|
+
}
|
125
|
+
}]
|
126
|
+
}}
|
127
|
+
}
|
128
|
+
|
129
|
+
Neo.applyClassConfig(MainContainer);
|
130
|
+
|
131
|
+
export default MainContainer;
|
@@ -0,0 +1,95 @@
|
|
1
|
+
import ComponentController from '../../src/controller/Component.mjs';
|
2
|
+
import Toast from '../../src/dialog/Toast.mjs';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @class Neo.examples.toast.MainContainerController
|
6
|
+
* @extends Neo.controller.Component
|
7
|
+
*/
|
8
|
+
class MainContainerController extends ComponentController {
|
9
|
+
static getConfig() {return {
|
10
|
+
/**
|
11
|
+
* @member {String} className='Neo.examples.toast.MainContainerController'
|
12
|
+
* @protected
|
13
|
+
*/
|
14
|
+
className: 'Neo.examples.toast.MainContainerController'
|
15
|
+
}}
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @param {Object} config
|
19
|
+
*/
|
20
|
+
construct(config) {
|
21
|
+
super.construct(config);
|
22
|
+
Neo.main.addon.HighlightJS.switchTheme('dark');
|
23
|
+
}
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Whenever any field changes we update the output
|
27
|
+
* @param {Object} data
|
28
|
+
* @returns {Promise<void>}
|
29
|
+
*/
|
30
|
+
async onChange(data) {
|
31
|
+
let me = this,
|
32
|
+
form = me.getReference('form'),
|
33
|
+
output = me.getReference('output'),
|
34
|
+
button = me.getReference('creation-button'),
|
35
|
+
oVdom = output.vdom.cn[0].cn[0],
|
36
|
+
isValid = form.isValid(),
|
37
|
+
values;
|
38
|
+
|
39
|
+
if (Neo.isBoolean(data.value)) {
|
40
|
+
me.getReference('closable').value = data.value;
|
41
|
+
}
|
42
|
+
|
43
|
+
values = form.getValues();
|
44
|
+
|
45
|
+
values.appName = me.component.appName;
|
46
|
+
button.disabled = !isValid;
|
47
|
+
|
48
|
+
if (form.validate()) {
|
49
|
+
oVdom.cn = output.itemTpl(values);
|
50
|
+
|
51
|
+
output.update();
|
52
|
+
|
53
|
+
await Neo.timeout(20)
|
54
|
+
me.syntaxHighlight();
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
/**
|
59
|
+
* Cleanup the values and show the toast
|
60
|
+
*/
|
61
|
+
createToast() {
|
62
|
+
let me = this,
|
63
|
+
form = me.getReference('form'),
|
64
|
+
values = form.getValues(),
|
65
|
+
clear = ['position', 'slideDirection', 'ui', 'minHeight', 'maxWidth', 'closable'];
|
66
|
+
|
67
|
+
// use the defaults from toast if not set
|
68
|
+
clear.forEach(item => {
|
69
|
+
if (values[item] === null) {
|
70
|
+
delete values[item];
|
71
|
+
}
|
72
|
+
})
|
73
|
+
|
74
|
+
values.appName = me.component.appName;
|
75
|
+
Neo.toast(values);
|
76
|
+
}
|
77
|
+
|
78
|
+
/**
|
79
|
+
* 3rd party tool to highlight the code
|
80
|
+
*/
|
81
|
+
syntaxHighlight() {
|
82
|
+
let me = this,
|
83
|
+
output = me.getReference('output'),
|
84
|
+
oVdom = output.vdom;
|
85
|
+
|
86
|
+
Neo.main.addon.HighlightJS.syntaxHighlight({
|
87
|
+
appName: me.component.appName,
|
88
|
+
vnodeId: oVdom.cn[0].id
|
89
|
+
});
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
Neo.applyClassConfig(MainContainerController);
|
94
|
+
|
95
|
+
export default MainContainerController;
|
@@ -0,0 +1,27 @@
|
|
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>Neo GoogleMaps Component</title>
|
7
|
+
|
8
|
+
<style>
|
9
|
+
.output {
|
10
|
+
background: #2b2b2b;
|
11
|
+
padding: 50px 40px;
|
12
|
+
font-weight: 700;
|
13
|
+
color: #2b2b2b;
|
14
|
+
}
|
15
|
+
.import {
|
16
|
+
padding-bottom: 40px;
|
17
|
+
}
|
18
|
+
.tab {
|
19
|
+
padding-left: 40px;
|
20
|
+
}
|
21
|
+
</style>
|
22
|
+
</head>
|
23
|
+
</head>
|
24
|
+
<body>
|
25
|
+
<script src="../../src/MicroLoader.mjs" type="module"></script>
|
26
|
+
</body>
|
27
|
+
</html>
|