neo.mjs 8.0.0-alpha.1 → 8.0.0-beta.1
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/.github/CODING_GUIDELINES.md +5 -5
- package/.github/CONCEPT.md +10 -10
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/covid/view/MainContainer.mjs +14 -14
- package/apps/covid/view/TableContainer.mjs +2 -2
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/ViewportController.mjs +2 -2
- package/apps/portal/view/examples/TabContainer.mjs +11 -11
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/apps/portal/view/home/parts/MainNeo.mjs +6 -2
- package/apps/realworld/view/article/CreateComponent.mjs +1 -1
- package/apps/realworld2/view/HomeContainer.mjs +7 -7
- package/apps/sharedcovid/view/MainContainer.mjs +17 -17
- package/apps/sharedcovid/view/TableContainer.mjs +2 -2
- package/buildScripts/createApp.mjs +2 -2
- package/buildScripts/createClass.mjs +4 -6
- package/docs/app/view/ContentTabContainer.mjs +1 -1
- package/docs/app/view/MainContainer.mjs +3 -3
- package/docs/app/view/MainContainerController.mjs +9 -9
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/component/mwc/buttons/MainContainer.mjs +2 -2
- package/examples/component/mwc/textFields/MainContainer.mjs +2 -2
- package/examples/fields/MainContainer.mjs +197 -228
- package/examples/preloadingAssets/view/MainContainer.mjs +2 -2
- package/examples/tab/container/MainContainer.mjs +7 -9
- package/examples/tabs/MainContainer.mjs +3 -3
- package/examples/tabs/MainContainer2.mjs +4 -4
- package/examples/videoMove/MainContainer.mjs +14 -7
- package/examples/viewport/MainContainer.mjs +3 -3
- package/package.json +6 -6
- package/resources/data/deck/learnneo/pages/benefits/FormsEngine.md +13 -13
- package/resources/data/deck/learnneo/pages/benefits/Speed.md +5 -4
- package/resources/data/deck/training/pages/2022-12-27T21-55-23-144Z.md +2 -2
- package/resources/data/deck/training/pages/2022-12-28T17-11-34-653Z.md +6 -6
- package/resources/data/deck/training/pages/2022-12-29T18-36-08-226Z.md +2 -2
- package/resources/data/deck/training/pages/2022-12-29T18-36-56-893Z.md +2 -2
- package/resources/data/deck/training/pages/2022-12-29T20-37-08-919Z.md +2 -2
- package/resources/data/deck/training/pages/2022-12-29T20-37-20-344Z.md +2 -2
- package/resources/data/deck/training/pages/2023-01-01T21-11-58-025Z.md +3 -3
- package/resources/data/deck/training/pages/2023-01-16T20-24-09-690Z.md +4 -4
- package/resources/data/deck/training/pages/2023-02-05T17-44-53-815Z.md +3 -3
- package/resources/data/deck/training/pages/2023-02-05T17-45-40-114Z.md +1 -1
- package/resources/scss/src/calendar/view/week/Component.scss +6 -0
- package/resources/scss/src/component/DateSelector.scss +1 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/calendar/view/MainContainer.mjs +4 -1
- package/src/calendar/view/SettingsContainer.mjs +13 -28
- package/src/calendar/view/YearComponent.mjs +0 -3
- package/src/calendar/view/calendars/ColorsList.mjs +5 -0
- package/src/calendar/view/calendars/List.mjs +8 -0
- package/src/code/LivePreview.mjs +10 -10
- package/src/component/Base.mjs +88 -55
- package/src/container/Base.mjs +2 -2
- package/src/form/field/Text.mjs +1 -1
- package/src/form/field/Time.mjs +5 -3
- package/src/form/field/trigger/Time.mjs +2 -1
- package/src/layout/Card.mjs +10 -6
- package/src/layout/Cube.mjs +15 -4
- package/src/list/Base.mjs +7 -1
- package/src/list/Color.mjs +3 -3
- package/src/main/DomEvents.mjs +1 -1
- package/src/main/DomUtils.mjs +39 -36
- package/src/tab/Container.mjs +3 -5
- package/src/toolbar/Base.mjs +26 -8
- package/src/util/VNode.mjs +6 -8
- package/src/vdom/Helper.mjs +19 -6
@@ -147,12 +147,12 @@ class MainView extends FormContainer {
|
|
147
147
|
}, {
|
148
148
|
module: TabContainer,
|
149
149
|
items : [{
|
150
|
-
module
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
tag
|
150
|
+
module : FormContainer,
|
151
|
+
header : {text: 'User'},
|
152
|
+
itemDefaults: {module: TextField, labelPosition: 'inline'},
|
153
|
+
layout : {ntype:'vbox', align:'start'},
|
154
|
+
reference : 'user-form',
|
155
|
+
tag : 'div',
|
156
156
|
|
157
157
|
items: [{
|
158
158
|
labelText: 'Firstname',
|
@@ -165,12 +165,12 @@ class MainView extends FormContainer {
|
|
165
165
|
value : 'Doe'
|
166
166
|
}]
|
167
167
|
}, {
|
168
|
-
module
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
tag
|
168
|
+
module : FormContainer,
|
169
|
+
header : {text: 'Product'},
|
170
|
+
itemDefaults: {module: TextField, labelPosition: 'inline'},
|
171
|
+
layout : {ntype:'vbox', align:'start'},
|
172
|
+
reference : 'product-form',
|
173
|
+
tag : 'div',
|
174
174
|
|
175
175
|
items: [{
|
176
176
|
labelText: 'Name',
|
@@ -189,7 +189,7 @@ class MainView extends FormContainer {
|
|
189
189
|
itemDefaults: {module: Button},
|
190
190
|
layout : {ntype: 'hbox'},
|
191
191
|
|
192
|
-
items
|
192
|
+
items: [{
|
193
193
|
handler: 'up.getMainFormValues',
|
194
194
|
text : 'Get Main Values'
|
195
195
|
}, {
|
@@ -21,9 +21,10 @@ If you move quickly, you might reach 20,000 or 30,000 delta updates per second.
|
|
21
21
|
second — but we've never actually hit the limit.
|
22
22
|
|
23
23
|
<pre data-neo>
|
24
|
-
import Base
|
24
|
+
import Base from '../container/Base.mjs';
|
25
25
|
import Helix from '../component/Helix.mjs';
|
26
|
-
|
26
|
+
|
27
|
+
class MainView extends Base {
|
27
28
|
static config = {
|
28
29
|
className: 'Benefits.speed.MainView',
|
29
30
|
layout : 'fit',
|
@@ -34,14 +35,14 @@ class Foo extends Base {
|
|
34
35
|
store: {
|
35
36
|
autoLoad: true,
|
36
37
|
model: {
|
37
|
-
fields: [
|
38
|
+
fields: [{name: 'image', type: 'String'}],
|
38
39
|
},
|
39
40
|
url: '../../../../resources/examples/data/ai_contacts.json'
|
40
41
|
}
|
41
42
|
}]
|
42
43
|
}
|
43
44
|
}
|
44
|
-
|
45
|
+
MainView = Neo.setupClass(MainView);
|
45
46
|
</pre>
|
46
47
|
|
47
48
|
|
@@ -23,13 +23,13 @@ class MainContainer extends Viewport {
|
|
23
23
|
style: { padding: '20px' }
|
24
24
|
},
|
25
25
|
items: [{
|
26
|
-
|
26
|
+
header: {
|
27
27
|
iconCls: 'fa fa-home',
|
28
28
|
text: 'Tab 1'
|
29
29
|
},
|
30
30
|
vdom: { innerHTML: 'Welcome to your new Neo App.' }
|
31
31
|
}, {
|
32
|
-
|
32
|
+
header: {
|
33
33
|
iconCls: 'fa fa-play-circle',
|
34
34
|
text: 'Tab 2'
|
35
35
|
},
|
@@ -13,18 +13,18 @@ Give it the `ntype:'yelp-businesses-tabs',`.
|
|
13
13
|
|
14
14
|
It needs *two* tabs, with the tab button text set to 'Map' and 'Table'.
|
15
15
|
|
16
|
-
Remember that a tab is configured with the `
|
16
|
+
Remember that a tab is configured with the `header`, and you'll use the
|
17
17
|
`html` config as a placeholder to indicate that a map and a table will eventually
|
18
18
|
be used. The generated class already has two tabs.
|
19
19
|
|
20
|
-
The first tab
|
20
|
+
The first tab should end up looking like this.
|
21
21
|
|
22
22
|
{
|
23
|
-
ntype: 'component',
|
24
|
-
html: 'The map goes here',
|
25
|
-
|
23
|
+
ntype : 'component',
|
24
|
+
html : 'The map goes here',
|
25
|
+
header: {
|
26
26
|
text: 'Map'
|
27
|
-
}
|
27
|
+
}
|
28
28
|
}
|
29
29
|
|
30
30
|
|
@@ -33,7 +33,7 @@ to inspect it, and run methods on it.
|
|
33
33
|
Now add a new tab:
|
34
34
|
|
35
35
|
tabContainer.add({
|
36
|
-
|
36
|
+
header: {
|
37
37
|
iconCls: 'fa fa-home',
|
38
38
|
text: 'Hi there!'
|
39
39
|
},
|
@@ -103,4 +103,4 @@ and change the value.
|
|
103
103
|
Clear the console and do another _Ctrl-right-click_, then right-click on the button component logged in
|
104
104
|
the console and choose _Store object as global variable_. It'll use a value like _temp1_.
|
105
105
|
|
106
|
-
Rather than drilling-down, assign a new text value by entering `temp1.text = 'hi there'`.
|
106
|
+
Rather than drilling-down, assign a new text value by entering `temp1.text = 'hi there'`.
|
@@ -80,7 +80,7 @@ class MainContainer extends Viewport {
|
|
80
80
|
},
|
81
81
|
|
82
82
|
items: [{
|
83
|
-
|
83
|
+
header: {
|
84
84
|
iconCls: 'fa fa-home',
|
85
85
|
text: 'Tab 1'
|
86
86
|
},
|
@@ -88,7 +88,7 @@ class MainContainer extends Viewport {
|
|
88
88
|
innerHTML: 'Welcome to your new Neo App.'
|
89
89
|
}
|
90
90
|
}, {
|
91
|
-
|
91
|
+
header: {
|
92
92
|
iconCls: 'fa fa-play-circle',
|
93
93
|
text: 'Tab 2'
|
94
94
|
},
|
@@ -26,13 +26,13 @@ class MainContainer extends Viewport {
|
|
26
26
|
style: { padding: '20px' }
|
27
27
|
},
|
28
28
|
items: [{
|
29
|
-
|
29
|
+
header: {
|
30
30
|
iconCls: 'fa fa-home',
|
31
31
|
text: 'Tab 1'
|
32
32
|
},
|
33
33
|
vdom: { innerHTML: 'Welcome to your new Neo App.' }
|
34
34
|
}, {
|
35
|
-
|
35
|
+
header: {
|
36
36
|
iconCls: 'fa fa-play-circle',
|
37
37
|
text: 'Tab 2'
|
38
38
|
},
|
@@ -23,13 +23,13 @@ class MainContainer extends Viewport {
|
|
23
23
|
style: { padding: '20px' }
|
24
24
|
},
|
25
25
|
items: [{
|
26
|
-
|
26
|
+
header: {
|
27
27
|
iconCls: 'fa fa-home',
|
28
28
|
text: 'Tab 1'
|
29
29
|
},
|
30
30
|
vdom: { innerHTML: 'Welcome to your new Neo App.' }
|
31
31
|
}, {
|
32
|
-
|
32
|
+
header: {
|
33
33
|
iconCls: 'fa fa-play-circle',
|
34
34
|
text: 'Tab 2'
|
35
35
|
},
|
@@ -14,12 +14,12 @@ class Simple extends Base {
|
|
14
14
|
items: [{
|
15
15
|
module: Simple
|
16
16
|
|
17
|
-
|
17
|
+
header: {iconCls: 'fa fa-home', text: 'Simple'},
|
18
18
|
|
19
19
|
}, {
|
20
20
|
module: Simple
|
21
21
|
foo: 2, // This value is used for the instance
|
22
22
|
|
23
|
-
|
23
|
+
header: {iconCls: 'fa fa-home', text: 'Simple'},
|
24
24
|
}],
|
25
|
-
</pre>
|
25
|
+
</pre>
|
@@ -1,23 +1,23 @@
|
|
1
1
|
A tab container is a card-layout container with a tab bar and styled buttons.
|
2
2
|
Do not specify a `layout` for tab containers.
|
3
3
|
|
4
|
-
The buttons are configured via `
|
4
|
+
The buttons are configured via `header`
|
5
5
|
|
6
6
|
activeIndex: 2,
|
7
7
|
tabBarPosition: 'left', // top, right, bottom, left
|
8
8
|
itemDefaults: { module: Button },
|
9
9
|
items: [{
|
10
|
-
|
10
|
+
header: {
|
11
11
|
iconCls: 'fa fa-home',
|
12
12
|
text: 'Tab 1'
|
13
13
|
}
|
14
14
|
}, {
|
15
|
-
|
15
|
+
header: {
|
16
16
|
iconCls: 'fa fa-play-circle',
|
17
17
|
text: 'Tab 2'
|
18
18
|
}
|
19
19
|
}, {
|
20
|
-
|
20
|
+
header: {
|
21
21
|
iconCls: 'fa fa-bell',
|
22
22
|
text: 'Tab 3'
|
23
23
|
}
|
@@ -19,7 +19,7 @@ in the `afterSetBusiness()` method.
|
|
19
19
|
items: [{
|
20
20
|
module: Component,
|
21
21
|
reference: 'view',
|
22
|
-
|
22
|
+
header: {
|
23
23
|
text: 'View'
|
24
24
|
},
|
25
25
|
style: {
|
@@ -33,7 +33,7 @@ in the `afterSetBusiness()` method.
|
|
33
33
|
}
|
34
34
|
}, {
|
35
35
|
reference: 'form',
|
36
|
-
|
36
|
+
header: {
|
37
37
|
text: 'Edit'
|
38
38
|
}
|
39
39
|
}]
|
@@ -192,4 +192,4 @@ Here's one way to code it. How does this compare to your solution?
|
|
192
192
|
|
193
193
|
The view tab will become more and more complicated as we add content.
|
194
194
|
It should be refactored into its own view class to isolate that complexity.
|
195
|
-
We won't bother, but on a project that would be the right thing to do.
|
195
|
+
We won't bother, but on a project that would be the right thing to do.
|
package/src/DefaultConfig.mjs
CHANGED
@@ -262,12 +262,12 @@ const DefaultConfig = {
|
|
262
262
|
useVdomWorker: true,
|
263
263
|
/**
|
264
264
|
* buildScripts/injectPackageVersion.mjs will update this value
|
265
|
-
* @default '8.0.0-
|
265
|
+
* @default '8.0.0-beta.1'
|
266
266
|
* @memberOf! module:Neo
|
267
267
|
* @name config.version
|
268
268
|
* @type String
|
269
269
|
*/
|
270
|
-
version: '8.0.0-
|
270
|
+
version: '8.0.0-beta.1'
|
271
271
|
};
|
272
272
|
|
273
273
|
Object.assign(DefaultConfig, {
|
@@ -259,6 +259,9 @@ class MainContainer extends Container {
|
|
259
259
|
style = sideBar.style || {};
|
260
260
|
|
261
261
|
if (value) {
|
262
|
+
me.updateDepth = -1;
|
263
|
+
|
264
|
+
// todo: updates colliding with parent updates need to pass the update depth for the next parent update cycle
|
262
265
|
delete sideBar.vdom.removeDom;
|
263
266
|
|
264
267
|
me.promiseUpdate().then(() => {
|
@@ -274,7 +277,7 @@ class MainContainer extends Container {
|
|
274
277
|
sideBar._style = style; // silent update
|
275
278
|
sideBar._vdom.style = style; // silent update
|
276
279
|
|
277
|
-
|
280
|
+
sideBar.promiseUpdate().then(() => {
|
278
281
|
me.timeout(400).then(() => {
|
279
282
|
sideBar.vdom.removeDom = true;
|
280
283
|
sideBar.update();
|
@@ -89,44 +89,29 @@ class SettingsContainer extends Container {
|
|
89
89
|
items: [{
|
90
90
|
module: () => import('./settings/GeneralContainer.mjs'),
|
91
91
|
flag : 'general',
|
92
|
-
|
93
|
-
|
94
|
-
tabButtonConfig: {
|
95
|
-
text: 'General'
|
96
|
-
}
|
92
|
+
header: {text: 'General'},
|
93
|
+
style : {padding: '20px'}
|
97
94
|
}, {
|
98
|
-
ntype: 'component',
|
99
|
-
flag
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
tabButtonConfig: {
|
104
|
-
text: 'Day'
|
105
|
-
}
|
95
|
+
ntype : 'component',
|
96
|
+
flag : 'day',
|
97
|
+
header: {text: 'Day'},
|
98
|
+
html : 'Day',
|
99
|
+
style : {padding: '20px'}
|
106
100
|
}, {
|
107
101
|
module: () => import('./settings/WeekContainer.mjs'),
|
108
102
|
flag : 'week',
|
109
|
-
|
110
|
-
|
111
|
-
tabButtonConfig: {
|
112
|
-
text: 'Week'
|
113
|
-
}
|
103
|
+
header: {text: 'Week'},
|
104
|
+
style : {padding: '20px'}
|
114
105
|
}, {
|
115
106
|
module: () => import('./settings/MonthContainer.mjs'),
|
116
107
|
flag : 'month',
|
117
|
-
|
118
|
-
|
119
|
-
tabButtonConfig: {
|
120
|
-
text: 'Month'
|
121
|
-
}
|
108
|
+
header: {text: 'Month'},
|
109
|
+
style : {padding: '20px'}
|
122
110
|
}, {
|
123
111
|
module: () => import('./settings/YearContainer.mjs'),
|
124
112
|
flag : 'year',
|
125
|
-
|
126
|
-
|
127
|
-
tabButtonConfig: {
|
128
|
-
text: 'Year'
|
129
|
-
}
|
113
|
+
header: {text: 'Year'},
|
114
|
+
style : {padding: '20px'}
|
130
115
|
}],
|
131
116
|
|
132
117
|
listeners: {
|
@@ -21,6 +21,11 @@ class ColorsList extends List {
|
|
21
21
|
bind: {
|
22
22
|
store: 'stores.colors'
|
23
23
|
},
|
24
|
+
/**
|
25
|
+
* Set this to true in case a keyboard navigation should immediately select the focussed item
|
26
|
+
* @member {Boolean} selectOnFocus=true
|
27
|
+
*/
|
28
|
+
selectOnFocus: true,
|
24
29
|
/**
|
25
30
|
* @member {Boolean} useWrapperNode=false
|
26
31
|
*/
|
@@ -150,6 +150,14 @@ class List extends ComponentList {
|
|
150
150
|
onSelect(items) {
|
151
151
|
this.getModel().setData('activeCalendarId', this.getItemRecordId(items[0]))
|
152
152
|
}
|
153
|
+
|
154
|
+
/**
|
155
|
+
* Disabling the super class logic for now, since the collection.Base mutation event already covers the sorting
|
156
|
+
* @param {Object} data
|
157
|
+
*/
|
158
|
+
sortItems(data) {
|
159
|
+
|
160
|
+
}
|
153
161
|
}
|
154
162
|
|
155
163
|
export default Neo.setupClass(List);
|
package/src/code/LivePreview.mjs
CHANGED
@@ -63,16 +63,16 @@ class LivePreview extends Container {
|
|
63
63
|
removeInactiveCards: false,
|
64
64
|
|
65
65
|
items: [{
|
66
|
-
module
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
66
|
+
module : MonacoEditor,
|
67
|
+
header : {text: 'Source'},
|
68
|
+
hideLabel: true,
|
69
|
+
listeners: {editorChange: 'up.onEditorChange'},
|
70
|
+
style : {height: '100%'},
|
71
|
+
reference: 'editor'
|
72
72
|
}, {
|
73
|
-
module
|
74
|
-
|
75
|
-
|
73
|
+
module : Container,
|
74
|
+
header : {text: 'Preview'},
|
75
|
+
reference: 'preview'
|
76
76
|
}]
|
77
77
|
}],
|
78
78
|
/**
|
@@ -410,7 +410,7 @@ class LivePreview extends Container {
|
|
410
410
|
ui : 'ghost'
|
411
411
|
});
|
412
412
|
|
413
|
-
items
|
413
|
+
items.unshift('->');
|
414
414
|
|
415
415
|
// we want to add a normal (non-header) button
|
416
416
|
tabContainer.getTabBar().add(items);
|