neo.mjs 8.0.0-alpha.2 → 8.0.0-beta.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/.github/CODING_GUIDELINES.md +5 -5
- package/.github/CONCEPT.md +10 -10
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/colors/view/Viewport.mjs +9 -9
- package/apps/colors/view/ViewportController.mjs +13 -13
- package/apps/colors/view/{ViewportModel.mjs → ViewportStateProvider.mjs} +8 -8
- package/apps/covid/view/MainContainer.mjs +22 -22
- package/apps/covid/view/MainContainerController.mjs +8 -10
- package/apps/covid/view/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +7 -7
- package/apps/covid/view/TableContainer.mjs +2 -2
- package/apps/covid/view/TableContainerController.mjs +1 -1
- package/apps/form/view/FormContainerController.mjs +2 -2
- package/apps/form/view/SideNavList.mjs +3 -3
- package/apps/form/view/Viewport.mjs +7 -7
- package/apps/form/view/ViewportController.mjs +4 -4
- package/apps/form/view/{ViewportModel.mjs → ViewportStateProvider.mjs} +8 -8
- package/apps/portal/index.html +1 -1
- package/apps/portal/resources/data/examples_devmode.json +3 -3
- package/apps/portal/resources/data/examples_dist_dev.json +3 -3
- package/apps/portal/resources/data/examples_dist_prod.json +3 -3
- package/apps/portal/view/Viewport.mjs +12 -12
- package/apps/portal/view/ViewportController.mjs +2 -2
- package/apps/portal/view/ViewportStateProvider.mjs +27 -0
- 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/portal/view/learn/ContentComponent.mjs +2 -2
- package/apps/portal/view/learn/ContentTreeList.mjs +1 -1
- package/apps/portal/view/learn/MainContainer.mjs +9 -9
- package/apps/portal/view/learn/MainContainerController.mjs +12 -12
- package/apps/portal/view/learn/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +7 -7
- package/apps/portal/view/learn/PageSectionsList.mjs +1 -1
- package/apps/realworld/view/article/CreateComponent.mjs +1 -1
- package/apps/realworld2/view/HomeContainer.mjs +7 -7
- package/apps/sharedcovid/view/GalleryContainer.mjs +2 -2
- package/apps/sharedcovid/view/HelixContainer.mjs +2 -2
- package/apps/sharedcovid/view/MainContainer.mjs +25 -25
- package/apps/sharedcovid/view/MainContainerController.mjs +10 -11
- package/apps/sharedcovid/view/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +8 -8
- package/apps/sharedcovid/view/TableContainer.mjs +2 -2
- package/apps/sharedcovid/view/TableContainerController.mjs +1 -1
- package/apps/sharedcovid/view/mapboxGl/Container.mjs +2 -2
- package/buildScripts/createApp.mjs +2 -2
- package/buildScripts/createClass.mjs +15 -17
- package/buildScripts/createComponent.mjs +4 -4
- package/docs/app/view/ContentTabContainer.mjs +1 -1
- package/docs/app/view/MainContainer.mjs +3 -3
- package/docs/app/view/MainContainerController.mjs +15 -15
- 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/{model → stateProvider}/advanced/MainContainer.mjs +12 -12
- package/examples/{model → stateProvider}/advanced/MainContainerController.mjs +10 -10
- package/examples/stateProvider/advanced/app.mjs +6 -0
- package/examples/{model/dialog → stateProvider/advanced}/index.html +1 -1
- package/examples/{model/inline → stateProvider/advanced}/neo-config.json +1 -1
- package/examples/{model → stateProvider}/dialog/EditUserDialog.mjs +3 -3
- package/examples/{model → stateProvider}/dialog/EditUserDialogController.mjs +5 -5
- package/examples/{model → stateProvider}/dialog/MainContainer.mjs +7 -7
- package/examples/{model → stateProvider}/dialog/MainContainerController.mjs +5 -5
- package/examples/{model → stateProvider}/dialog/app.mjs +1 -1
- package/examples/{model/multiWindow2 → stateProvider/dialog}/index.html +1 -1
- package/examples/{model → stateProvider}/dialog/neo-config.json +1 -1
- package/examples/{model → stateProvider}/extendedClass/MainContainer.mjs +13 -13
- package/examples/{model/inline → stateProvider/extendedClass}/MainContainerController.mjs +7 -7
- package/examples/stateProvider/extendedClass/MainContainerStateProvider.mjs +24 -0
- package/examples/stateProvider/extendedClass/app.mjs +6 -0
- package/examples/stateProvider/extendedClass/index.html +11 -0
- package/examples/stateProvider/extendedClass/neo-config.json +7 -0
- package/examples/{model → stateProvider}/inline/MainContainer.mjs +10 -10
- package/examples/{model/extendedClass → stateProvider/inline}/MainContainerController.mjs +7 -7
- package/examples/{model/extendedClass → stateProvider/inline}/app.mjs +1 -1
- package/examples/{model/extendedClass → stateProvider/inline}/index.html +1 -1
- package/examples/{model/extendedClass → stateProvider/inline}/neo-config.json +1 -1
- package/examples/{model/inlineNoModel → stateProvider/inlineNoStateProvider}/MainContainer.mjs +4 -4
- package/examples/{model/inlineNoModel → stateProvider/inlineNoStateProvider}/MainContainerController.mjs +3 -3
- package/examples/stateProvider/inlineNoStateProvider/README.md +8 -0
- package/examples/stateProvider/inlineNoStateProvider/app.mjs +6 -0
- package/examples/{model/inline → stateProvider/inlineNoStateProvider}/index.html +1 -1
- package/examples/stateProvider/inlineNoStateProvider/neo-config.json +7 -0
- package/examples/{model → stateProvider}/multiWindow/EditUserDialog.mjs +3 -3
- package/examples/{model → stateProvider}/multiWindow/EditUserDialogController.mjs +5 -5
- package/examples/{model → stateProvider}/multiWindow/MainContainer.mjs +3 -3
- package/examples/{model → stateProvider}/multiWindow/MainContainerController.mjs +6 -6
- package/examples/{model → stateProvider}/multiWindow/Viewport.mjs +3 -3
- package/examples/{model → stateProvider}/multiWindow/ViewportController.mjs +14 -14
- package/examples/{model/multiWindow2 → stateProvider/multiWindow}/app.mjs +1 -1
- package/examples/{model/advanced → stateProvider/multiWindow}/index.html +1 -1
- package/examples/{model → stateProvider}/multiWindow/neo-config.json +1 -1
- package/examples/{model → stateProvider}/multiWindow2/Viewport.mjs +3 -3
- package/examples/{model/multiWindow → stateProvider/multiWindow2}/app.mjs +1 -1
- package/examples/{model/multiWindow → stateProvider/multiWindow2}/index.html +1 -1
- package/examples/{model → stateProvider}/multiWindow2/neo-config.json +1 -1
- package/examples/{model → stateProvider}/nestedData/MainContainer.mjs +9 -9
- package/examples/{model → stateProvider}/nestedData/MainContainerController.mjs +7 -7
- package/examples/stateProvider/nestedData/app.mjs +6 -0
- package/examples/stateProvider/nestedData/index.html +11 -0
- package/examples/stateProvider/nestedData/neo-config.json +7 -0
- package/examples/{model → stateProvider}/table/MainContainer.mjs +8 -8
- package/examples/stateProvider/table/MainContainerStateProvider.mjs +24 -0
- package/examples/{model → stateProvider}/table/MainModel.mjs +2 -2
- package/examples/{model → stateProvider}/table/MainStore.mjs +2 -2
- package/examples/{model/advanced → stateProvider/table}/app.mjs +1 -1
- package/examples/{model/advanced → stateProvider/table}/neo-config.json +1 -1
- package/examples/{model → stateProvider}/twoWay/MainContainer.mjs +9 -9
- package/examples/{model/inline → stateProvider/twoWay}/app.mjs +1 -1
- package/examples/stateProvider/twoWay/index.html +11 -0
- package/examples/{model → stateProvider}/twoWay/neo-config.json +1 -1
- package/examples/tab/container/MainContainer.mjs +7 -9
- package/examples/table/nestedRecordFields/EditUserDialog.mjs +3 -3
- package/examples/table/nestedRecordFields/MainContainer.mjs +8 -8
- package/examples/table/nestedRecordFields/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +10 -10
- package/examples/tabs/MainContainer.mjs +3 -3
- package/examples/tabs/MainContainer2.mjs +4 -4
- package/examples/toolbar/paging/view/MainContainer.mjs +7 -7
- package/examples/toolbar/paging/view/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +8 -8
- package/examples/treeAccordion/MainContainer.mjs +2 -2
- 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/guides/{ViewModels.md → StateProviders.md} +52 -58
- package/resources/data/deck/learnneo/tree.json +46 -46
- 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/src/DefaultConfig.mjs +2 -2
- package/src/button/Base.mjs +7 -7
- package/src/calendar/view/EditEventContainer.mjs +3 -3
- package/src/calendar/view/MainContainer.mjs +27 -27
- package/src/calendar/view/{MainContainerModel.mjs → MainContainerStateProvider.mjs} +7 -7
- package/src/calendar/view/SettingsContainer.mjs +13 -28
- package/src/calendar/view/YearComponent.mjs +5 -5
- package/src/calendar/view/calendars/ColorsList.mjs +5 -0
- package/src/calendar/view/calendars/EditContainer.mjs +1 -1
- package/src/calendar/view/calendars/List.mjs +1 -1
- package/src/calendar/view/month/Component.mjs +6 -6
- package/src/calendar/view/settings/GeneralContainer.mjs +2 -2
- package/src/calendar/view/week/Component.mjs +10 -10
- package/src/calendar/view/week/EventDragZone.mjs +1 -1
- package/src/code/LivePreview.mjs +10 -10
- package/src/component/Base.mjs +123 -105
- package/src/container/Base.mjs +4 -4
- package/src/controller/Component.mjs +29 -12
- package/src/core/Base.mjs +0 -1
- package/src/core/Compare.mjs +128 -83
- package/src/date/SelectorContainer.mjs +12 -12
- package/src/date/{SelectorContainerModel.mjs → SelectorContainerStateProvider.mjs} +7 -7
- 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/Base.mjs +6 -6
- 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/{model/Component.mjs → state/Provider.mjs} +67 -69
- package/src/tab/Container.mjs +3 -5
- package/src/toolbar/Base.mjs +26 -8
- package/src/tree/Accordion.mjs +15 -13
- package/src/util/VNode.mjs +6 -8
- package/src/worker/App.mjs +2 -2
- package/apps/portal/view/ViewportModel.mjs +0 -27
- package/examples/model/extendedClass/MainContainerModel.mjs +0 -24
- package/examples/model/inlineNoModel/README.md +0 -8
- package/examples/model/inlineNoModel/app.mjs +0 -6
- package/examples/model/inlineNoModel/index.html +0 -11
- package/examples/model/inlineNoModel/neo-config.json +0 -7
- package/examples/model/nestedData/app.mjs +0 -6
- package/examples/model/nestedData/index.html +0 -11
- package/examples/model/nestedData/neo-config.json +0 -7
- package/examples/model/table/MainContainerModel.mjs +0 -24
- package/examples/model/table/app.mjs +0 -6
- package/examples/model/table/neo-config.json +0 -7
- package/examples/model/twoWay/app.mjs +0 -6
- package/examples/model/twoWay/index.html +0 -11
- /package/examples/{model → stateProvider}/table/index.html +0 -0
@@ -1,9 +1,9 @@
|
|
1
|
-
import BaseViewport
|
2
|
-
import Container
|
3
|
-
import HeaderToolbar
|
4
|
-
import NeoArray
|
5
|
-
import ViewportController
|
6
|
-
import
|
1
|
+
import BaseViewport from '../../../src/container/Viewport.mjs';
|
2
|
+
import Container from '../../../src/container/Base.mjs';
|
3
|
+
import HeaderToolbar from './HeaderToolbar.mjs';
|
4
|
+
import NeoArray from '../../../src/util/Array.mjs';
|
5
|
+
import ViewportController from './ViewportController.mjs';
|
6
|
+
import ViewportStateProvider from './ViewportStateProvider.mjs';
|
7
7
|
|
8
8
|
/**
|
9
9
|
* @class Portal.view.Viewport
|
@@ -55,10 +55,6 @@ class Viewport extends BaseViewport {
|
|
55
55
|
{module: () => import('../../../docs/app/view/MainContainer.mjs')}
|
56
56
|
]
|
57
57
|
}],
|
58
|
-
/**
|
59
|
-
* @member {Neo.model.Component} model=ViewportModel
|
60
|
-
*/
|
61
|
-
model: ViewportModel,
|
62
58
|
/**
|
63
59
|
* @member {Boolean} monitorSize=true
|
64
60
|
*/
|
@@ -67,7 +63,11 @@ class Viewport extends BaseViewport {
|
|
67
63
|
* Values are: large, medium, small, xSmall
|
68
64
|
* @member {String|null} size_=null
|
69
65
|
*/
|
70
|
-
size_: null
|
66
|
+
size_: null,
|
67
|
+
/**
|
68
|
+
* @member {Neo.state.Provider} stateProvider=ViewportStateProvider
|
69
|
+
*/
|
70
|
+
stateProvider: ViewportStateProvider
|
71
71
|
}
|
72
72
|
|
73
73
|
/**
|
@@ -96,7 +96,7 @@ class Viewport extends BaseViewport {
|
|
96
96
|
NeoArray.add( cls, 'portal-size-' + value);
|
97
97
|
me.cls = cls;
|
98
98
|
|
99
|
-
me.
|
99
|
+
me.stateProvider.setData({size: value});
|
100
100
|
|
101
101
|
me.controller.size = value
|
102
102
|
}
|
@@ -355,14 +355,14 @@ class ViewportController extends Controller {
|
|
355
355
|
NeoArray.toggle(cls, 'separate-bar', vertical)
|
356
356
|
}
|
357
357
|
|
358
|
-
headerSocialIcons.cls = cls
|
358
|
+
headerSocialIcons.cls = cls;
|
359
359
|
|
360
360
|
|
361
361
|
if (hidden && vertical) {
|
362
362
|
await me.timeout(200)
|
363
363
|
}
|
364
364
|
|
365
|
-
headerSocialIcons.hidden = hidden
|
365
|
+
headerSocialIcons.hidden = hidden
|
366
366
|
}
|
367
367
|
}
|
368
368
|
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import StateProvider from '../../../src/state/Provider.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Portal.view.ViewportStateProvider
|
5
|
+
* @extends Neo.state.Provider
|
6
|
+
*/
|
7
|
+
class ViewportStateProvider extends StateProvider {
|
8
|
+
static config = {
|
9
|
+
/**
|
10
|
+
* @member {String} className='Portal.view.ViewportStateProvider'
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
className: 'Portal.view.ViewportStateProvider',
|
14
|
+
/**
|
15
|
+
* @member {Object} data
|
16
|
+
*/
|
17
|
+
data: {
|
18
|
+
/**
|
19
|
+
* Values are: large, medium, small, xSmall, null
|
20
|
+
* @member {String|null} size
|
21
|
+
*/
|
22
|
+
size: null
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
export default Neo.setupClass(ViewportStateProvider);
|
@@ -42,27 +42,27 @@ class TabContainer extends Container {
|
|
42
42
|
* @member {Object[]} items
|
43
43
|
*/
|
44
44
|
items: [{
|
45
|
-
reference
|
46
|
-
store
|
47
|
-
|
45
|
+
reference: 'examples-devmode-list',
|
46
|
+
store : {module: ExampleStore, url: '../../apps/portal/resources/data/examples_devmode.json'},
|
47
|
+
header : {
|
48
48
|
iconCls: 'fa fa-chess-knight',
|
49
49
|
route : '/examples/devmode',
|
50
50
|
text : 'DevMode'
|
51
51
|
}
|
52
52
|
}, {
|
53
|
-
environment
|
54
|
-
reference
|
55
|
-
store
|
56
|
-
|
53
|
+
environment: 'dist/development',
|
54
|
+
reference : 'examples-dist-dev-list',
|
55
|
+
store : {module: ExampleStore, url: '../../apps/portal/resources/data/examples_dist_dev.json'},
|
56
|
+
header : {
|
57
57
|
iconCls: 'fa fa-chess-queen',
|
58
58
|
route : '/examples/dist_dev',
|
59
59
|
text : 'dist/dev'
|
60
60
|
}
|
61
61
|
}, {
|
62
|
-
environment
|
63
|
-
reference
|
64
|
-
store
|
65
|
-
|
62
|
+
environment: 'dist/production',
|
63
|
+
reference : 'examples-dist-prod-list',
|
64
|
+
store : {module: ExampleStore, url: '../../apps/portal/resources/data/examples_dist_prod.json'},
|
65
|
+
header : {
|
66
66
|
iconCls: 'fa fa-chess-king',
|
67
67
|
route : '/examples/dist_prod',
|
68
68
|
text : 'dist/prod'
|
@@ -40,8 +40,12 @@ class MainNeo extends BaseContainer {
|
|
40
40
|
}, {
|
41
41
|
cls : ['neo-h3'],
|
42
42
|
flex: 'none',
|
43
|
-
|
44
|
-
|
43
|
+
tag : 'h3',
|
44
|
+
|
45
|
+
html: [
|
46
|
+
'Neo.mjs provides a new approach for building feature-rich web applications. Increase productivity by leveraging ',
|
47
|
+
'a vast component library and harness the power of multi-threading for extreme real-time performance.'
|
48
|
+
].join('')
|
45
49
|
}, {
|
46
50
|
ntype: 'container',
|
47
51
|
cls : ['button-group'],
|
@@ -174,7 +174,7 @@ class ContentComponent extends Component {
|
|
174
174
|
async doFetchContent(record) {
|
175
175
|
let me = this,
|
176
176
|
{appName, windowId} = me,
|
177
|
-
path = me.
|
177
|
+
path = me.getStateProvider().getData('contentPath'),
|
178
178
|
baseConfigs, content, data, html, instance, modifiedHtml, neoComponents, neoDivs;
|
179
179
|
|
180
180
|
path += `/pages/${record.id.replaceAll('.', '/')}.md`;
|
@@ -380,7 +380,7 @@ class ContentComponent extends Component {
|
|
380
380
|
}
|
381
381
|
});
|
382
382
|
|
383
|
-
me.
|
383
|
+
me.getStateProvider().getStore('contentSections').data = storeData;
|
384
384
|
|
385
385
|
return contentArray.join('\n')
|
386
386
|
}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import Container
|
2
|
-
import ContentTreeList
|
3
|
-
import MainContainerController
|
4
|
-
import
|
5
|
-
import PageContainer
|
6
|
-
import PageSectionsContainer
|
7
|
-
import Splitter
|
1
|
+
import Container from '../../../../src/container/Base.mjs';
|
2
|
+
import ContentTreeList from './ContentTreeList.mjs';
|
3
|
+
import MainContainerController from './MainContainerController.mjs';
|
4
|
+
import MainContainerStateProvider from './MainContainerStateProvider.mjs';
|
5
|
+
import PageContainer from './PageContainer.mjs';
|
6
|
+
import PageSectionsContainer from './PageSectionsContainer.mjs';
|
7
|
+
import Splitter from '../../../../src/component/Splitter.mjs';
|
8
8
|
|
9
9
|
/**
|
10
10
|
* @class Portal.view.learn.MainContainer
|
@@ -64,9 +64,9 @@ class MainContainer extends Container {
|
|
64
64
|
*/
|
65
65
|
layout: {ntype: 'hbox', align: 'stretch'},
|
66
66
|
/**
|
67
|
-
* @member {Neo.
|
67
|
+
* @member {Neo.state.Provider} stateProvider=MainContainerStateProvider
|
68
68
|
*/
|
69
|
-
|
69
|
+
stateProvider: MainContainerStateProvider
|
70
70
|
}
|
71
71
|
}
|
72
72
|
|
@@ -34,7 +34,7 @@ class MainContainerController extends Controller {
|
|
34
34
|
path: 'location.search',
|
35
35
|
windowId
|
36
36
|
}).then(data => {
|
37
|
-
this.
|
37
|
+
this.setState({
|
38
38
|
deck: getSearchParams(data).deck || 'learnneo'
|
39
39
|
})
|
40
40
|
})
|
@@ -60,16 +60,16 @@ class MainContainerController extends Controller {
|
|
60
60
|
|
61
61
|
Neo.Main.getByPath({path: 'location.search'})
|
62
62
|
.then(data => {
|
63
|
-
me.
|
63
|
+
me.setState({
|
64
64
|
deck: getSearchParams(data).deck || 'learnneo'
|
65
|
-
})
|
65
|
+
})
|
66
66
|
});
|
67
67
|
|
68
68
|
// todo: target file does not exist inside the repo
|
69
69
|
/*fetch('../../../../resources/data/deck/EditorConfig.json')
|
70
70
|
.then(response => response.json()
|
71
71
|
.then(data =>
|
72
|
-
me.
|
72
|
+
me.setState('editorConfig', data)
|
73
73
|
))*/
|
74
74
|
}
|
75
75
|
|
@@ -78,7 +78,7 @@ class MainContainerController extends Controller {
|
|
78
78
|
* @returns {Promise<void>}
|
79
79
|
*/
|
80
80
|
async onContentEdit(data) {
|
81
|
-
const vm = this.
|
81
|
+
const vm = this.getStateProvider();
|
82
82
|
console.log(data);
|
83
83
|
const editorConfig = vm.getData('editorConfig');
|
84
84
|
const subDir = vm.getData('deck')
|
@@ -119,7 +119,7 @@ class MainContainerController extends Controller {
|
|
119
119
|
* @param {Object} data
|
120
120
|
*/
|
121
121
|
onNextPageButtonClick(data) {
|
122
|
-
this.navigateTo(this.
|
122
|
+
this.navigateTo(this.getStateProvider().getData('nextPageRecord').id)
|
123
123
|
}
|
124
124
|
|
125
125
|
/**
|
@@ -133,14 +133,14 @@ class MainContainerController extends Controller {
|
|
133
133
|
* @param {Object} data
|
134
134
|
*/
|
135
135
|
onPreviousPageButtonClick(data) {
|
136
|
-
this.navigateTo(this.
|
136
|
+
this.navigateTo(this.getStateProvider().getData('previousPageRecord').id)
|
137
137
|
}
|
138
138
|
|
139
139
|
/**
|
140
140
|
* @param {Object} data
|
141
141
|
*/
|
142
142
|
onRouteDefault(data) {
|
143
|
-
if (!this.
|
143
|
+
if (!this.getStateProvider().data.currentPageRecord) {
|
144
144
|
this.onRouteLearnItem({itemId: 'benefits.Introduction'})
|
145
145
|
}
|
146
146
|
}
|
@@ -150,14 +150,14 @@ class MainContainerController extends Controller {
|
|
150
150
|
* @param {String} data.itemId
|
151
151
|
*/
|
152
152
|
onRouteLearnItem(data) {
|
153
|
-
let
|
154
|
-
store
|
153
|
+
let stateProvider = this.getStateProvider(),
|
154
|
+
store = stateProvider.getStore('contentTree');
|
155
155
|
|
156
156
|
if (store.getCount() > 0) {
|
157
|
-
|
157
|
+
stateProvider.data.currentPageRecord = store.get(data.itemId)
|
158
158
|
} else {
|
159
159
|
store.on({
|
160
|
-
load : () => {
|
160
|
+
load : () => {stateProvider.data.currentPageRecord = store.get(data.itemId)},
|
161
161
|
delay: 10,
|
162
162
|
once : true
|
163
163
|
})
|
@@ -1,18 +1,18 @@
|
|
1
|
-
import Component from '../../../../src/model/Component.mjs';
|
2
1
|
import ContentSectionStore from '../../store/ContentSections.mjs';
|
3
2
|
import ContentStore from '../../store/Content.mjs';
|
3
|
+
import StateProvider from '../../../../src/state/Provider.mjs';
|
4
4
|
|
5
5
|
/**
|
6
|
-
* @class Portal.view.learn.
|
7
|
-
* @extends Neo.
|
6
|
+
* @class Portal.view.learn.MainContainerStateProvider
|
7
|
+
* @extends Neo.state.Provider
|
8
8
|
*/
|
9
|
-
class
|
9
|
+
class MainContainerStateProvider extends StateProvider {
|
10
10
|
static config = {
|
11
11
|
/**
|
12
|
-
* @member {String} className='Portal.view.learn.
|
12
|
+
* @member {String} className='Portal.view.learn.MainContainerStateProvider'
|
13
13
|
* @protected
|
14
14
|
*/
|
15
|
-
className: 'Portal.view.learn.
|
15
|
+
className: 'Portal.view.learn.MainContainerStateProvider',
|
16
16
|
/**
|
17
17
|
* @member {String} contentBasePath='../../resources/data/deck/'
|
18
18
|
*/
|
@@ -155,4 +155,4 @@ class MainContainerModel extends Component {
|
|
155
155
|
}
|
156
156
|
}
|
157
157
|
|
158
|
-
export default Neo.setupClass(
|
158
|
+
export default Neo.setupClass(MainContainerStateProvider);
|
@@ -190,7 +190,7 @@ class CreateComponent extends Component {
|
|
190
190
|
id : event.target.id,
|
191
191
|
attributes: 'value'
|
192
192
|
}).then(data => {
|
193
|
-
VNodeUtil.
|
193
|
+
VNodeUtil.find(me.vnode, {className: 'field-tags'}).vnode.attributes.value = data.value;
|
194
194
|
me.tagList = [...me._tagList, data.value];
|
195
195
|
});
|
196
196
|
}
|
@@ -56,14 +56,14 @@ class HomeContainer extends Container {
|
|
56
56
|
flex : 3,
|
57
57
|
|
58
58
|
items: [{
|
59
|
-
ntype
|
60
|
-
cls
|
61
|
-
|
62
|
-
|
63
|
-
vdom
|
59
|
+
ntype : 'component',
|
60
|
+
cls : ['neo-examples-tab-component'],
|
61
|
+
header: {iconCls: 'fa fa-user-ninja', text: 'Your Feed'},
|
62
|
+
style : {padding: '20px'},
|
63
|
+
vdom : {innerHTML: 'todo'}
|
64
64
|
}, {
|
65
|
-
module
|
66
|
-
|
65
|
+
module: PreviewList,
|
66
|
+
header: {iconCls: 'fa fa-globe-europe', text: 'Global Feed'}
|
67
67
|
}]
|
68
68
|
}, {
|
69
69
|
module: TagListComponent,
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import FooterContainer
|
2
|
-
import HeaderContainer
|
3
|
-
import MainContainerController
|
4
|
-
import
|
5
|
-
import TabContainer
|
6
|
-
import Viewport
|
1
|
+
import FooterContainer from './FooterContainer.mjs';
|
2
|
+
import HeaderContainer from './HeaderContainer.mjs';
|
3
|
+
import MainContainerController from './MainContainerController.mjs';
|
4
|
+
import MainContainerStateProvider from './MainContainerStateProvider.mjs';
|
5
|
+
import TabContainer from '../../../src/tab/Container.mjs';
|
6
|
+
import Viewport from '../../../src/container/Viewport.mjs';
|
7
7
|
|
8
8
|
/**
|
9
9
|
* @class SharedCovid.view.MainContainer
|
@@ -36,48 +36,48 @@ class MainContainer extends Viewport {
|
|
36
36
|
style : {margin: '10px', marginTop: 0},
|
37
37
|
|
38
38
|
items: [{
|
39
|
-
module
|
40
|
-
reference
|
41
|
-
|
39
|
+
module : () => import('./TableContainer.mjs'),
|
40
|
+
reference: 'table-container',
|
41
|
+
header : {
|
42
42
|
iconCls: 'fa fa-table',
|
43
43
|
route : 'mainview=table',
|
44
44
|
text : 'Table'
|
45
45
|
}
|
46
46
|
}, {
|
47
|
-
module
|
48
|
-
reference
|
49
|
-
|
47
|
+
module : () => import('./mapboxGl/Container.mjs'),
|
48
|
+
reference: 'mapbox-gl-container',
|
49
|
+
header : {
|
50
50
|
iconCls: 'fa fa-globe-americas',
|
51
51
|
route : 'mainview=mapboxglmap',
|
52
52
|
text : 'Mapbox GL Map'
|
53
53
|
}
|
54
54
|
}, {
|
55
|
-
module
|
56
|
-
|
55
|
+
module: () => import('./WorldMapContainer.mjs'),
|
56
|
+
header: {
|
57
57
|
iconCls: 'fa fa-globe-americas',
|
58
58
|
route : 'mainview=worldmap',
|
59
59
|
text : 'World Map'
|
60
60
|
}
|
61
61
|
}, {
|
62
|
-
module
|
63
|
-
reference
|
64
|
-
|
62
|
+
module : () => import('./GalleryContainer.mjs'),
|
63
|
+
reference: 'gallery-container',
|
64
|
+
header : {
|
65
65
|
iconCls: 'fa fa-images',
|
66
66
|
route : 'mainview=gallery',
|
67
67
|
text : 'Gallery'
|
68
68
|
}
|
69
69
|
}, {
|
70
|
-
module
|
71
|
-
reference
|
72
|
-
|
70
|
+
module : () => import('./HelixContainer.mjs'),
|
71
|
+
reference: 'helix-container',
|
72
|
+
header : {
|
73
73
|
iconCls: 'fa fa-dna',
|
74
74
|
route : 'mainview=helix',
|
75
75
|
text : 'Helix'
|
76
76
|
}
|
77
77
|
}, {
|
78
|
-
module
|
79
|
-
reference
|
80
|
-
|
78
|
+
module : () => import('./AttributionComponent.mjs'),
|
79
|
+
reference: 'attribution',
|
80
|
+
header : {
|
81
81
|
iconCls: 'fa fa-copyright',
|
82
82
|
route : 'mainview=attribution',
|
83
83
|
text : 'Attribution'
|
@@ -89,9 +89,9 @@ class MainContainer extends Viewport {
|
|
89
89
|
*/
|
90
90
|
layout: {ntype: 'vbox', align: 'stretch'},
|
91
91
|
/**
|
92
|
-
* @member {Neo.
|
92
|
+
* @member {Neo.state.Provider} stateProvider=MainContainerStateProvider
|
93
93
|
*/
|
94
|
-
|
94
|
+
stateProvider: MainContainerStateProvider
|
95
95
|
}
|
96
96
|
}
|
97
97
|
|
@@ -127,20 +127,19 @@ class MainContainerController extends ComponentController {
|
|
127
127
|
applySummaryData(data) {
|
128
128
|
let me = this,
|
129
129
|
container = me.getReference('total-stats'),
|
130
|
-
vdom
|
130
|
+
vdom;
|
131
131
|
|
132
132
|
me.summaryData = data;
|
133
133
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
container.update();
|
134
|
+
container.items[0].vdom.cn[1].html = Util.formatNumber({value: data.cases}); container.items[0].update();
|
135
|
+
container.items[1].vdom.cn[1].html = Util.formatNumber({value: data.active}); container.items[1].update();
|
136
|
+
container.items[2].vdom.cn[1].html = Util.formatNumber({value: data.recovered}); container.items[2].update();
|
137
|
+
container.items[3].vdom.cn[1].html = Util.formatNumber({value: data.deaths}); container.items[3].update();
|
140
138
|
|
141
139
|
container = me.getReference('last-update');
|
140
|
+
vdom = container.vdom;
|
142
141
|
|
143
|
-
|
142
|
+
vdom.html = 'Last Update: ' + new Intl.DateTimeFormat('default', {
|
144
143
|
hour : 'numeric',
|
145
144
|
minute: 'numeric',
|
146
145
|
second: 'numeric'
|
@@ -414,7 +413,7 @@ class MainContainerController extends ComponentController {
|
|
414
413
|
record = value && store.find('country', value)?.[0]
|
415
414
|
}
|
416
415
|
|
417
|
-
this.
|
416
|
+
this.setState({
|
418
417
|
country : value,
|
419
418
|
countryRecord: record || null
|
420
419
|
})
|
@@ -445,7 +444,7 @@ class MainContainerController extends ComponentController {
|
|
445
444
|
return
|
446
445
|
}
|
447
446
|
|
448
|
-
me.
|
447
|
+
me.setState({
|
449
448
|
country: country || null
|
450
449
|
});
|
451
450
|
|
@@ -471,7 +470,7 @@ class MainContainerController extends ComponentController {
|
|
471
470
|
me.mapboxglMapHasData = true;
|
472
471
|
}
|
473
472
|
|
474
|
-
countryRecord = me.
|
473
|
+
countryRecord = me.getStateProvider().data.countryRecord;
|
475
474
|
countryRecord && MainContainerController.selectMapboxGlCountry(me.mapBoxView, countryRecord);
|
476
475
|
|
477
476
|
me.mapBoxView.autoResize();
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import
|
1
|
+
import StateProvider from '../../../src/state/Provider.mjs';
|
2
2
|
|
3
3
|
/**
|
4
|
-
* @class SharedCovid.view.
|
5
|
-
* @extends Neo.
|
4
|
+
* @class SharedCovid.view.MainContainerStateProvider
|
5
|
+
* @extends Neo.state.Provider
|
6
6
|
*/
|
7
|
-
class
|
7
|
+
class MainContainerStateProvider extends StateProvider {
|
8
8
|
static config = {
|
9
9
|
/**
|
10
|
-
* @member {String} className='SharedCovid.view.
|
10
|
+
* @member {String} className='SharedCovid.view.MainContainerStateProvider'
|
11
11
|
* @protected
|
12
12
|
*/
|
13
|
-
className: 'SharedCovid.view.
|
13
|
+
className: 'SharedCovid.view.MainContainerStateProvider',
|
14
14
|
/**
|
15
15
|
* @member {Object} data
|
16
16
|
*/
|
@@ -39,10 +39,10 @@ class MainContainerModel extends Component {
|
|
39
39
|
if (key === 'country') {
|
40
40
|
Neo.Main.editRoute({
|
41
41
|
country: value
|
42
|
-
})
|
42
|
+
})
|
43
43
|
}
|
44
44
|
}
|
45
45
|
}
|
46
46
|
}
|
47
47
|
|
48
|
-
export default Neo.setupClass(
|
48
|
+
export default Neo.setupClass(MainContainerStateProvider);
|
@@ -132,7 +132,7 @@ class TableContainer extends Container {
|
|
132
132
|
reference: 'line-chart',
|
133
133
|
}],
|
134
134
|
|
135
|
-
|
135
|
+
header: {
|
136
136
|
iconCls: 'fa fa-chart-line',
|
137
137
|
text : 'Chart'
|
138
138
|
}
|
@@ -156,7 +156,7 @@ class TableContainer extends Container {
|
|
156
156
|
reference: 'historical-data-table',
|
157
157
|
windowId : me.windowId,
|
158
158
|
|
159
|
-
|
159
|
+
header: {
|
160
160
|
iconCls: 'fa fa-table',
|
161
161
|
text : 'Table'
|
162
162
|
},
|
@@ -97,7 +97,7 @@ class TableContainerController extends ComponentController {
|
|
97
97
|
}
|
98
98
|
|
99
99
|
// the array is sorted by date ASC
|
100
|
-
Object.assign(dataArray[0], {
|
100
|
+
dataArray[0] && Object.assign(dataArray[0], {
|
101
101
|
dailyActive : dataArray[0].active,
|
102
102
|
dailyCases : dataArray[0].cases,
|
103
103
|
dailyDeaths : dataArray[0].deaths,
|
@@ -232,13 +232,13 @@ if (programOpts.info) {
|
|
232
232
|
" },",
|
233
233
|
"",
|
234
234
|
" items: [{",
|
235
|
-
"
|
235
|
+
" header: {",
|
236
236
|
" iconCls: 'fa fa-home',",
|
237
237
|
" text : 'Tab 1'",
|
238
238
|
" },",
|
239
239
|
" vdom: {innerHTML: 'Welcome to your new Neo App.'}",
|
240
240
|
" }, {",
|
241
|
-
"
|
241
|
+
" header: {",
|
242
242
|
" iconCls: 'fa fa-play-circle',",
|
243
243
|
" text : 'Tab 2'",
|
244
244
|
" },",
|