neo.mjs 6.15.4 → 6.15.6
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/form/view/FormContainerController.mjs +1 -1
- package/apps/form/view/ViewportController.mjs +2 -2
- package/apps/portal/view/home/MainContainer.mjs +2 -2
- package/apps/portal/view/learn/ContentView.mjs +1 -1
- package/apps/portal/view/learn/LivePreview.mjs +0 -27
- package/apps/realworld2/view/user/LoginFormContainer.mjs +1 -1
- package/docs/app/view/MainContainer.mjs +1 -11
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/component/timer/MainContainerController.mjs +2 -2
- package/examples/component/toast/MainContainerController.mjs +2 -2
- package/examples/date/selectorContainer/MainContainer.mjs +215 -0
- package/examples/date/selectorContainer/app.mjs +6 -0
- package/examples/date/selectorContainer/index.html +11 -0
- package/examples/date/selectorContainer/neo-config.json +6 -0
- package/package.json +5 -5
- package/resources/data/deck/learnneo/pages/TestLivePreview.md +1 -2
- package/resources/data/deck/learnneo/pages/Welcome.md +68 -0
- package/resources/data/deck/learnneo/pages/WhyNeo-Multi-Threaded.md +2 -0
- package/resources/data/deck/learnneo/pages/WhyNeo-Multi-Window.md +3 -3
- package/resources/data/deck/learnneo/pages/WhyNeo-Speed.md +36 -12
- package/resources/data/deck/learnneo/tree.json +5 -4
- package/resources/scss/src/apps/portal/learn/PageContainer.scss +4 -3
- package/resources/scss/src/date/SelectorContainer.scss +120 -0
- package/resources/scss/theme-dark/date/SelectorContainer.scss +24 -0
- package/resources/scss/theme-light/date/SelectorContainer.scss +24 -0
- package/resources/scss/theme-neo-light/date/SelectorContainer.scss +24 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/Neo.mjs +5 -5
- package/src/component/Base.mjs +1 -1
- package/src/container/Base.mjs +42 -17
- package/src/controller/Component.mjs +5 -4
- package/src/core/Observable.mjs +30 -5
- package/src/core/Util.mjs +1 -1
- package/src/date/DayViewComponent.mjs +251 -0
- package/src/date/SelectorContainer.mjs +352 -0
- package/src/date/SelectorContainerModel.mjs +33 -0
- package/src/form/Container.mjs +10 -2
- package/src/form/field/Base.mjs +10 -2
- package/src/form/field/CheckBox.mjs +13 -5
- package/src/form/field/ComboBox.mjs +21 -15
- package/src/form/field/Date.mjs +2 -2
- package/src/form/field/Text.mjs +18 -17
- package/src/main/addon/IntersectionObserver.mjs +27 -20
- package/src/tab/Container.mjs +56 -55
- package/test/components/app.mjs +1 -0
- package/test/components/files/component/Base.mjs +88 -0
- package/test/components/siesta.js +1 -0
- package/docs/app/model/Tutorial.mjs +0 -41
- package/docs/app/store/Tutorials.mjs +0 -28
- package/docs/app/view/TutorialsTreeList.mjs +0 -51
- package/docs/tutorials/01_Concept.html +0 -45
- package/docs/tutorials/01_Concept.json +0 -123
- package/docs/tutorials/01_Concept.md +0 -55
- package/docs/tutorials/02_ClassSystem.html +0 -171
- package/docs/tutorials/02_ClassSystem.md +0 -187
- package/docs/tutorials/03_ComponentLifecycle.html +0 -28
- package/docs/tutorials/03_ComponentLifecycle.md +0 -23
- package/docs/tutorials/04_VdomVnode.html +0 -161
- package/docs/tutorials/05_RemoteMethodAccess.html +0 -82
- package/docs/tutorials/06_EcmaScript6Plus.html +0 -10
- package/docs/tutorials/07_WebWorkers.html +0 -9
- package/docs/tutorials/08_DomEvents.html +0 -7
- package/docs/tutorials/09_TodoList_version1.html +0 -503
- package/docs/tutorials/11_CreateApp.html +0 -94
- package/docs/tutorials/tutorials.json +0 -100
- package/resources/scss/src/apps/docs/TutorialsTreeList.scss +0 -7
package/apps/ServiceWorker.mjs
CHANGED
@@ -45,7 +45,7 @@ class FormContainerController extends Component {
|
|
45
45
|
*/
|
46
46
|
async onSaveButtonClick(data) {
|
47
47
|
let form = this.getReference('main-form'),
|
48
|
-
formValues = await form.
|
48
|
+
formValues = await form.getSubmitValues();
|
49
49
|
|
50
50
|
Neo.main.addon.LocalStorage.updateLocalStorageItem({
|
51
51
|
appName: this.component.appName,
|
@@ -20,7 +20,7 @@ class ViewportController extends Component {
|
|
20
20
|
let me = this,
|
21
21
|
form = me.getReference('main-form'),
|
22
22
|
formState = await form.getFormState(),
|
23
|
-
formValues = await form.
|
23
|
+
formValues = await form.getSubmitValues();
|
24
24
|
|
25
25
|
console.log('All pages', {formState, formValues});
|
26
26
|
|
@@ -34,7 +34,7 @@ class ViewportController extends Component {
|
|
34
34
|
let me = this,
|
35
35
|
activeIndex = me.getModel().data.activeIndex,
|
36
36
|
activeCard = me.getReference('pages-container').items[activeIndex],
|
37
|
-
formValues = await activeCard.
|
37
|
+
formValues = await activeCard.getSubmitValues();
|
38
38
|
|
39
39
|
await me.updateRecordValidityState(activeIndex)
|
40
40
|
|
@@ -207,33 +207,6 @@ class LivePreview extends Container {
|
|
207
207
|
return lastClassName
|
208
208
|
}
|
209
209
|
|
210
|
-
/**
|
211
|
-
* @param {String} reference
|
212
|
-
* @param {Object[]} items=this.items
|
213
|
-
* @returns {Object|Neo.component.Base|null}
|
214
|
-
*/
|
215
|
-
getItem(reference, items=this.items) {
|
216
|
-
let i = 0,
|
217
|
-
len = items.length,
|
218
|
-
item,
|
219
|
-
childItem;
|
220
|
-
|
221
|
-
for (; i < len; i++) {
|
222
|
-
item = items[i];
|
223
|
-
if (item.reference === reference) {
|
224
|
-
return item
|
225
|
-
} else if (item.items) {
|
226
|
-
childItem = this.getItem(reference, item.items);
|
227
|
-
|
228
|
-
if (childItem) {
|
229
|
-
return childItem
|
230
|
-
}
|
231
|
-
}
|
232
|
-
}
|
233
|
-
|
234
|
-
return null
|
235
|
-
}
|
236
|
-
|
237
210
|
/**
|
238
211
|
* @returns {Neo.component.Base|null}
|
239
212
|
*/
|
@@ -8,7 +8,6 @@ import MainContainerController from './MainContainerController.mjs';
|
|
8
8
|
import SourceViewComponent from './classdetails/SourceViewComponent.mjs';
|
9
9
|
import Splitter from '../../../src/component/Splitter.mjs';
|
10
10
|
import TutorialComponent from './classdetails/TutorialComponent.mjs';
|
11
|
-
import TutorialsTreeList from './TutorialsTreeList.mjs';
|
12
11
|
import Viewport from '../../../src/container/Viewport.mjs';
|
13
12
|
|
14
13
|
/**
|
@@ -71,15 +70,6 @@ class MainContainer extends Viewport {
|
|
71
70
|
iconCls: 'fa fa-code',
|
72
71
|
text : 'API'
|
73
72
|
}
|
74
|
-
}, {
|
75
|
-
module : TutorialsTreeList,
|
76
|
-
listeners: {leafItemClick: 'onTutorialListLeafClick'},
|
77
|
-
reference: 'tutorials-treelist',
|
78
|
-
|
79
|
-
tabButtonConfig: {
|
80
|
-
iconCls: 'fa fa-hands-helping',
|
81
|
-
text : 'Tutorials'
|
82
|
-
}
|
83
73
|
}, {
|
84
74
|
module : ExamplesTreeList,
|
85
75
|
listeners: {leafItemClick: 'onExamplesListLeafClick'},
|
@@ -123,7 +113,7 @@ class MainContainer extends Viewport {
|
|
123
113
|
}
|
124
114
|
|
125
115
|
// Disable the examples Tab for dist versions until the webpack builds can handle this (see: #140)
|
126
|
-
me.items[1].items[0].items[
|
116
|
+
me.items[1].items[0].items[1].tabButtonConfig.disabled = Neo.config.environment !== 'development';
|
127
117
|
}
|
128
118
|
|
129
119
|
/**
|
@@ -40,7 +40,7 @@ class MainContainerController extends ComponentController {
|
|
40
40
|
me.getReference('closable').value = data.value;
|
41
41
|
}
|
42
42
|
|
43
|
-
values = await form.
|
43
|
+
values = await form.getSubmitValues();
|
44
44
|
|
45
45
|
values.appName = me.component.appName;
|
46
46
|
button.disabled = !isValid;
|
@@ -61,7 +61,7 @@ class MainContainerController extends ComponentController {
|
|
61
61
|
async createToast() {
|
62
62
|
let me = this,
|
63
63
|
form = me.getReference('form'),
|
64
|
-
values = await form.
|
64
|
+
values = await form.getSubmitValues(),
|
65
65
|
clear = ['position', 'slideDirection', 'ui', 'minHeight', 'maxWidth', 'closable', 'timeout'];
|
66
66
|
|
67
67
|
// use the defaults from toast if not set
|
@@ -41,7 +41,7 @@ class MainContainerController extends ComponentController {
|
|
41
41
|
me.getReference('closable').value = data.value;
|
42
42
|
}
|
43
43
|
|
44
|
-
values = await form.
|
44
|
+
values = await form.getSubmitValues();
|
45
45
|
|
46
46
|
values.appName = me.component.appName;
|
47
47
|
button.disabled = !isValid;
|
@@ -62,7 +62,7 @@ class MainContainerController extends ComponentController {
|
|
62
62
|
async createToast() {
|
63
63
|
let me = this,
|
64
64
|
form = me.getReference('form'),
|
65
|
-
values = await form.
|
65
|
+
values = await form.getSubmitValues(),
|
66
66
|
clear = ['position', 'slideDirection', 'ui', 'minHeight', 'maxWidth', 'closable', 'timeout'];
|
67
67
|
|
68
68
|
// use the defaults from toast if not set
|
@@ -0,0 +1,215 @@
|
|
1
|
+
import CheckBox from '../../../src/form/field/CheckBox.mjs';
|
2
|
+
import ConfigurationViewport from '../../ConfigurationViewport.mjs';
|
3
|
+
import DateField from '../../../src/form/field/Date.mjs';
|
4
|
+
import DateSelector from '../../../src/date/SelectorContainer.mjs';
|
5
|
+
import Radio from '../../../src/form/field/Radio.mjs';
|
6
|
+
import NumberField from '../../../src/form/field/Number.mjs';
|
7
|
+
|
8
|
+
/**
|
9
|
+
* @class Neo.examples.date.selectorContainer.MainContainer
|
10
|
+
* @extends Neo.examples.ConfigurationViewport
|
11
|
+
*/
|
12
|
+
class MainContainer extends ConfigurationViewport {
|
13
|
+
static config = {
|
14
|
+
className: 'Neo.examples.date.selectorContainer.MainContainer'
|
15
|
+
}
|
16
|
+
|
17
|
+
createConfigurationComponents() {
|
18
|
+
let me = this,
|
19
|
+
exampleComponent = me.exampleComponent;
|
20
|
+
|
21
|
+
return [{
|
22
|
+
module : Radio,
|
23
|
+
checked : exampleComponent.currentDate.getMonth() === 0,
|
24
|
+
hideValueLabel: false,
|
25
|
+
labelText : 'currentDate (month)',
|
26
|
+
listeners : {change: me.onMonthRadioChange.bind(me, 0)},
|
27
|
+
name : 'month',
|
28
|
+
valueLabelText: 'Jan'
|
29
|
+
}, {
|
30
|
+
module : Radio,
|
31
|
+
checked : exampleComponent.currentDate.getMonth() === 1,
|
32
|
+
hideValueLabel: false,
|
33
|
+
labelText : '',
|
34
|
+
listeners : {change: me.onMonthRadioChange.bind(me, 1)},
|
35
|
+
name : 'month',
|
36
|
+
valueLabelText: 'Feb'
|
37
|
+
}, {
|
38
|
+
module : Radio,
|
39
|
+
checked : exampleComponent.currentDate.getMonth() === 2,
|
40
|
+
hideValueLabel: false,
|
41
|
+
labelText : '',
|
42
|
+
listeners : {change: me.onMonthRadioChange.bind(me, 2)},
|
43
|
+
name : 'month',
|
44
|
+
valueLabelText: 'Mar'
|
45
|
+
}, {
|
46
|
+
module : Radio,
|
47
|
+
checked : exampleComponent.currentDate.getMonth() === 3,
|
48
|
+
hideValueLabel: false,
|
49
|
+
labelText : '',
|
50
|
+
listeners : {change: me.onMonthRadioChange.bind(me, 3)},
|
51
|
+
name : 'month',
|
52
|
+
valueLabelText: 'Apr'
|
53
|
+
}, {
|
54
|
+
module : Radio,
|
55
|
+
checked : exampleComponent.currentDate.getFullYear() === 2025,
|
56
|
+
hideValueLabel: false,
|
57
|
+
labelText : 'currentDate (year)',
|
58
|
+
listeners : {change: me.onYearRadioChange.bind(me, 2025)},
|
59
|
+
name : 'year',
|
60
|
+
style : {marginTop: '10px'},
|
61
|
+
valueLabelText: '2025'
|
62
|
+
}, {
|
63
|
+
module : Radio,
|
64
|
+
checked : exampleComponent.currentDate.getFullYear() === 2024,
|
65
|
+
hideValueLabel: false,
|
66
|
+
labelText : '',
|
67
|
+
listeners : {change: me.onYearRadioChange.bind(me, 2024)},
|
68
|
+
name : 'year',
|
69
|
+
valueLabelText: '2024'
|
70
|
+
}, {
|
71
|
+
module : Radio,
|
72
|
+
checked : exampleComponent.currentDate.getFullYear() === 2023,
|
73
|
+
hideValueLabel: false,
|
74
|
+
labelText : '',
|
75
|
+
listeners : {change: me.onYearRadioChange.bind(me, 2023)},
|
76
|
+
name : 'year',
|
77
|
+
valueLabelText: '2023'
|
78
|
+
}, {
|
79
|
+
module : Radio,
|
80
|
+
checked : exampleComponent.currentDate.getFullYear() === 2022,
|
81
|
+
hideValueLabel: false,
|
82
|
+
labelText : '',
|
83
|
+
listeners : {change: me.onYearRadioChange.bind(me, 2022)},
|
84
|
+
name : 'year',
|
85
|
+
valueLabelText: '2022'
|
86
|
+
}, {
|
87
|
+
module : Radio,
|
88
|
+
checked : exampleComponent.dayNameFormat === 'narrow',
|
89
|
+
hideValueLabel: false,
|
90
|
+
labelText : 'dayNameFormat',
|
91
|
+
listeners : {change: me.onRadioChange.bind(me, 'dayNameFormat', 'narrow')},
|
92
|
+
name : 'dayNameFormat',
|
93
|
+
style : {marginTop: '10px'},
|
94
|
+
valueLabelText: 'narrow'
|
95
|
+
}, {
|
96
|
+
module : Radio,
|
97
|
+
checked : exampleComponent.dayNameFormat === 'short',
|
98
|
+
hideValueLabel: false,
|
99
|
+
labelText : '',
|
100
|
+
listeners : {change: me.onRadioChange.bind(me, 'dayNameFormat', 'short')},
|
101
|
+
name : 'dayNameFormat',
|
102
|
+
valueLabelText: 'short'
|
103
|
+
}, {
|
104
|
+
module : Radio,
|
105
|
+
checked : exampleComponent.dayNameFormat === 'long',
|
106
|
+
hideValueLabel: false,
|
107
|
+
labelText : '',
|
108
|
+
listeners : {change: me.onRadioChange.bind(me, 'dayNameFormat', 'long')},
|
109
|
+
name : 'dayNameFormat',
|
110
|
+
valueLabelText: 'long'
|
111
|
+
}, {
|
112
|
+
module : NumberField,
|
113
|
+
clearable : true,
|
114
|
+
labelText : 'height',
|
115
|
+
listeners : {change: me.onConfigChange.bind(me, 'height')},
|
116
|
+
maxValue : 800,
|
117
|
+
minValue : 230,
|
118
|
+
stepSize : 10,
|
119
|
+
style : {marginTop: '10px'},
|
120
|
+
value : exampleComponent.height
|
121
|
+
}, {
|
122
|
+
module : DateField,
|
123
|
+
labelText : 'maxValue',
|
124
|
+
listeners : {change: me.onConfigChange.bind(me, 'maxValue')},
|
125
|
+
matchPickerWidth: false,
|
126
|
+
value : exampleComponent.maxValue
|
127
|
+
}, {
|
128
|
+
module : DateField,
|
129
|
+
labelText : 'minValue',
|
130
|
+
listeners : {change: me.onConfigChange.bind(me, 'minValue')},
|
131
|
+
matchPickerWidth: false,
|
132
|
+
value : exampleComponent.minValue
|
133
|
+
}, {
|
134
|
+
module : CheckBox,
|
135
|
+
checked : exampleComponent.showCellBorders,
|
136
|
+
labelText: 'showCellBorders',
|
137
|
+
listeners: {change: me.onConfigChange.bind(me, 'showCellBorders')},
|
138
|
+
style : {marginTop: '10px'}
|
139
|
+
}, {
|
140
|
+
module : CheckBox,
|
141
|
+
checked : exampleComponent.showDisabledDays,
|
142
|
+
labelText: 'showDisabledDays',
|
143
|
+
listeners: {change: me.onConfigChange.bind(me, 'showDisabledDays')},
|
144
|
+
style : {marginTop: '10px'}
|
145
|
+
}, {
|
146
|
+
module : CheckBox,
|
147
|
+
checked : exampleComponent.useAnimations,
|
148
|
+
labelText: 'useAnimations',
|
149
|
+
listeners: {change: me.onConfigChange.bind(me, 'useAnimations')},
|
150
|
+
style : {marginTop: '10px'}
|
151
|
+
}, {
|
152
|
+
module : Radio,
|
153
|
+
checked : exampleComponent.weekStartDay === 6,
|
154
|
+
hideValueLabel: false,
|
155
|
+
labelText : 'weekStartDay',
|
156
|
+
listeners : {change: me.onRadioChange.bind(me, 'weekStartDay', 6)},
|
157
|
+
name : 'weekStartDay',
|
158
|
+
style : {marginTop: '10px'},
|
159
|
+
valueLabelText: '6 (Saturday)'
|
160
|
+
}, {
|
161
|
+
module : Radio,
|
162
|
+
checked : exampleComponent.weekStartDay === 0,
|
163
|
+
hideValueLabel: false,
|
164
|
+
labelText : '',
|
165
|
+
listeners : {change: me.onRadioChange.bind(me, 'weekStartDay', 0)},
|
166
|
+
name : 'weekStartDay',
|
167
|
+
valueLabelText: '0 (Sunday)'
|
168
|
+
}, {
|
169
|
+
module : Radio,
|
170
|
+
checked : exampleComponent.weekStartDay === 1,
|
171
|
+
hideValueLabel: false,
|
172
|
+
labelText : '',
|
173
|
+
listeners : {change: me.onRadioChange.bind(me, 'weekStartDay', 1)},
|
174
|
+
name : 'weekStartDay',
|
175
|
+
valueLabelText: '1 (Monday)'
|
176
|
+
}, {
|
177
|
+
module : NumberField,
|
178
|
+
clearable : true,
|
179
|
+
labelText : 'width',
|
180
|
+
listeners : {change: me.onConfigChange.bind(me, 'width')},
|
181
|
+
maxValue : 800,
|
182
|
+
minValue : 240,
|
183
|
+
stepSize : 10,
|
184
|
+
style : {marginTop: '10px'},
|
185
|
+
value : exampleComponent.width
|
186
|
+
}];
|
187
|
+
}
|
188
|
+
|
189
|
+
createExampleComponent() {
|
190
|
+
return Neo.create(DateSelector, {
|
191
|
+
height: 300,
|
192
|
+
width : 300
|
193
|
+
})
|
194
|
+
}
|
195
|
+
|
196
|
+
onMonthRadioChange(value, opts) {
|
197
|
+
if (opts.value === true) { // we only want to listen to check events, not uncheck
|
198
|
+
let date = this.exampleComponent.currentDate;
|
199
|
+
date?.setMonth(value);
|
200
|
+
this.exampleComponent.currentDate = date;
|
201
|
+
}
|
202
|
+
}
|
203
|
+
|
204
|
+
onYearRadioChange(value, opts) {
|
205
|
+
if (opts.value === true) { // we only want to listen to check events, not uncheck
|
206
|
+
let date = this.exampleComponent.currentDate;
|
207
|
+
date?.setFullYear(value);
|
208
|
+
this.exampleComponent.currentDate = date;
|
209
|
+
}
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
213
|
+
Neo.setupClass(MainContainer);
|
214
|
+
|
215
|
+
export default MainContainer;
|
@@ -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>Neo DateSelector</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<script src="../../../src/MicroLoader.mjs" type="module"></script>
|
10
|
+
</body>
|
11
|
+
</html>
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
{
|
3
3
|
"name": "neo.mjs",
|
4
|
-
"version": "6.15.
|
4
|
+
"version": "6.15.6",
|
5
5
|
"description": "The webworkers driven UI framework",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
@@ -44,22 +44,22 @@
|
|
44
44
|
},
|
45
45
|
"homepage": "https://neomjs.github.io/pages/",
|
46
46
|
"devDependencies": {
|
47
|
-
"@fortawesome/fontawesome-free": "^6.5.
|
47
|
+
"@fortawesome/fontawesome-free": "^6.5.2",
|
48
48
|
"autoprefixer": "^10.4.19",
|
49
49
|
"chalk": "^5.3.0",
|
50
50
|
"clean-webpack-plugin": "^4.0.0",
|
51
51
|
"commander": "^12.0.0",
|
52
52
|
"cssnano": "^6.1.2",
|
53
|
-
"envinfo": "^7.
|
53
|
+
"envinfo": "^7.12.0",
|
54
54
|
"fs-extra": "^11.2.0",
|
55
55
|
"highlightjs-line-numbers.js": "^2.8.0",
|
56
|
-
"inquirer": "^9.2.
|
56
|
+
"inquirer": "^9.2.17",
|
57
57
|
"marked": "^12.0.1",
|
58
58
|
"monaco-editor": "^0.47.0",
|
59
59
|
"neo-jsdoc": "1.0.1",
|
60
60
|
"neo-jsdoc-x": "1.0.5",
|
61
61
|
"postcss": "^8.4.38",
|
62
|
-
"sass": "^1.
|
62
|
+
"sass": "^1.75.0",
|
63
63
|
"siesta-lite": "5.5.2",
|
64
64
|
"url": "^0.11.3",
|
65
65
|
"webpack": "^5.91.0",
|
@@ -1,7 +1,6 @@
|
|
1
1
|
To code a live preview, enclose the code in a `pre` tag with the `data-neo` attribute.
|
2
2
|
|
3
|
-
<
|
4
|
-
</pre>
|
3
|
+
<code><pre data-neo>...</pre> <</code>
|
5
4
|
|
6
5
|
Imports are relative to the portal app running within the framework. That means
|
7
6
|
Neo.mjs imports should be coded to go up four levels, then look into the `src`
|
@@ -0,0 +1,68 @@
|
|
1
|
+
Welcome to Neo.mjs! This set of topics contains information to help you use Neo.mjs.
|
2
|
+
|
3
|
+
|
4
|
+
## Topics
|
5
|
+
|
6
|
+
### Why Neo?
|
7
|
+
|
8
|
+
Describes technical and business reasons for using Neo.mjs
|
9
|
+
|
10
|
+
### Getting Started
|
11
|
+
|
12
|
+
Install instructions, along with fundamental concepts that are good to understand before diving into Neo.mjs.
|
13
|
+
|
14
|
+
### Tutorials
|
15
|
+
|
16
|
+
Hands-on tutorials where you'll code a few simple Neo.mjs applications.
|
17
|
+
|
18
|
+
### Guides
|
19
|
+
|
20
|
+
These are in-depth discussions of various topics.
|
21
|
+
|
22
|
+
### Appendix
|
23
|
+
|
24
|
+
You can ignore this! It just holds a site style sheet and other miscellanea.
|
25
|
+
|
26
|
+
## Using these topics
|
27
|
+
|
28
|
+
### Layout
|
29
|
+
|
30
|
+
As you can see, the topics table of contents is on the left. Topic sections and sub-sections are shown on the right.
|
31
|
+
And content is here in the middle. There are "next" and "previous" buttons at the bottom of each page, to make it
|
32
|
+
easier to read several topics in sequence.
|
33
|
+
|
34
|
+
### Disclosure widgets
|
35
|
+
|
36
|
+
Topics sometimes contain "disclosure" widgets, which are just <details> tags. These are used in cases
|
37
|
+
where we want to present high-level points and reveal details when the disclosure is expanded.
|
38
|
+
|
39
|
+
<details>
|
40
|
+
<summary>This is a disclosure widget</summary>
|
41
|
+
<p style="background-color:lightgreen;padding:8px">This is a fascinating piece of information which is revealed when the widget is expanded.</p>
|
42
|
+
</details>
|
43
|
+
|
44
|
+
### Runnable examples
|
45
|
+
|
46
|
+
Topics also sometimes contain runnable examples. These are shown as tab panels with Source and Preview tabs.
|
47
|
+
|
48
|
+
You can also launch the preview in a window by going to the Preview tab, then clicking on the little window
|
49
|
+
icon on the right <span class="far fa-xs fa-window-maximize"></span>. This web site is a Neo.mjs application,
|
50
|
+
and the ability to launch browser windows — all integrated within a single app — is a unique feature of Neo.mjs!
|
51
|
+
|
52
|
+
<pre data-neo>
|
53
|
+
import Button from '../../../../src/button/Base.mjs';
|
54
|
+
import Container from '../../../../src/container/Base.mjs';
|
55
|
+
|
56
|
+
class MainView extends Container {
|
57
|
+
static config = {
|
58
|
+
className: 'Example.view.MainView',
|
59
|
+
layout : {ntype:'vbox', align:'start'},
|
60
|
+
items : [{
|
61
|
+
module : Button,
|
62
|
+
text : 'Button'
|
63
|
+
}]
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
Neo.setupClass(MainView);
|
68
|
+
</pre>
|
@@ -6,6 +6,8 @@ to the main browser thread, resulting in:
|
|
6
6
|
3. A <b>data</b> web-worker were HTTP and socket calls are run
|
7
7
|
4. A <b>view</b> web-worker that manages delta updates
|
8
8
|
|
9
|
+
<img src="https://s3.amazonaws.com/mjs.neo.learning.images/why/IndexHtmlFlow.png" width="120%"></img>
|
10
|
+
|
9
11
|
The benefits of using web workers is that each runs in parallel its own thread. In a typical framework
|
10
12
|
all code is run in the main thread, so processes compete for CPU cycles.
|
11
13
|
|
@@ -8,11 +8,11 @@ across windows, running seamlessly as a single application.
|
|
8
8
|
|
9
9
|
<details>
|
10
10
|
<summary><h3>Example</h3></summary>
|
11
|
-
An easy way to show this is by looking at a code preview example.
|
11
|
+
An easy way to show this is by looking at a code preview example. In the example below, click Preview,
|
12
12
|
then click on the new window icon on the right side of the toolbar. This launches a new window
|
13
13
|
running the code. Even though it's running in a new window, it's still part of the app.
|
14
|
-
(In this case, the app is the
|
15
|
-
share events,
|
14
|
+
(In this case, the app is the web site you're looking at now.) That means both the code in both windows
|
15
|
+
seamlessly share events, data, etc. — the code doesn't care that some code is running in a
|
16
16
|
separate window.
|
17
17
|
<pre data-neo>
|
18
18
|
import Button from '../../../../src/button/Base.mjs';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
The Neo.mjs web-worker processes are automatically run in parallel, on separate CPU cores.
|
2
2
|
|
3
3
|
By contrast, other JavaScript frameworks run in a single thread, so all business logic,
|
4
4
|
data handling, and DOM rendering compete for CPU resources.
|
@@ -12,16 +12,40 @@ If the default four threads aren't enough, you're free to launch additional web-
|
|
12
12
|
to run other specialized logic.
|
13
13
|
|
14
14
|
|
15
|
-
<details>
|
16
|
-
<summary>Example</summary>
|
17
|
-
Look at this example. It's complex. As you pan left and right, and zoom in and out, the upper-right
|
18
|
-
shows you the number of delta updates being applied. If you move really quickly, you might reach 20,000
|
19
|
-
or 30,000 delta updates per second. We've seen some examples that go over 40,000 updates per second —
|
20
|
-
but we've never actually hit the limit.
|
15
|
+
<details><summary>Example</summary>
|
21
16
|
|
22
|
-
|
17
|
+
Take a look at this example. It's the `Neo.component.Helix` component. Besides looking cool, it illustrates how quickly Neo.mjs can update a complex user interface.
|
23
18
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
Click on Preview, then use your mouse or trackpad to pan and zoom — the helix zooms and spirals accordingly, very very rapidly.
|
20
|
+
If you move quickly, you might reach 20,000 or 30,000 delta updates per second. We've seen some examples that go over 40,000 updates per
|
21
|
+
second — but we've never actually hit the limit.
|
22
|
+
|
23
|
+
<pre data-neo>
|
24
|
+
import Base from '../../../../src/container/Base.mjs';
|
25
|
+
import Helix from '../../../../src/component/Helix.mjs';
|
26
|
+
class Foo extends Base {
|
27
|
+
static config = {
|
28
|
+
className: 'Foo',
|
29
|
+
layout: 'fit',
|
30
|
+
items: [{
|
31
|
+
module: Helix,
|
32
|
+
imageField : 'image',
|
33
|
+
imageSource: '../../../../resources/examples/',
|
34
|
+
store: {
|
35
|
+
autoLoad: true,
|
36
|
+
model: {
|
37
|
+
fields: [ { name: 'image' , type: 'String' } ],
|
38
|
+
},
|
39
|
+
url: '../../../../resources/examples/data/ai_contacts.json'
|
40
|
+
}
|
41
|
+
}]
|
42
|
+
}
|
43
|
+
}
|
44
|
+
Neo.setupClass(Foo);
|
45
|
+
</pre>
|
46
|
+
|
47
|
+
|
48
|
+
If you're interested, there's <a href="../../examples/component/helix/index.html" target="_blank">a more full-featured helix example</a> that includes showing delta updates,
|
49
|
+
along with some other control. Look at the upper-right corner to see delta updates.
|
50
|
+
|
51
|
+
</details>
|