neo.mjs 6.18.3 → 6.19.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.
Files changed (81) hide show
  1. package/README.md +28 -214
  2. package/apps/ServiceWorker.mjs +2 -2
  3. package/apps/colors/view/ViewportController.mjs +7 -3
  4. package/apps/portal/data/blog.json +13 -0
  5. package/apps/portal/view/HeaderToolbar.mjs +2 -2
  6. package/apps/portal/view/Viewport.mjs +4 -2
  7. package/apps/portal/view/ViewportController.mjs +89 -8
  8. package/apps/portal/view/blog/Container.mjs +8 -8
  9. package/apps/portal/view/blog/List.mjs +6 -6
  10. package/apps/portal/view/home/MainContainer.mjs +3 -2
  11. package/apps/portal/view/home/parts/Colors.mjs +2 -2
  12. package/apps/portal/view/home/parts/How.mjs +3 -3
  13. package/apps/portal/view/home/parts/MainNeo.mjs +6 -7
  14. package/apps/portal/view/home/parts/References.mjs +88 -0
  15. package/apps/portal/view/learn/MainContainer.mjs +3 -2
  16. package/apps/portal/view/learn/MainContainerController.mjs +11 -0
  17. package/apps/portal/view/learn/PageContainer.mjs +5 -3
  18. package/apps/portal/view/services/Component.mjs +73 -0
  19. package/apps/website/data/blog.json +13 -0
  20. package/examples/ServiceWorker.mjs +2 -2
  21. package/examples/component/carousel/MainContainer.mjs +42 -33
  22. package/examples/layout/cube/MainContainer.mjs +217 -0
  23. package/examples/layout/cube/app.mjs +6 -0
  24. package/examples/layout/cube/index.html +11 -0
  25. package/examples/layout/cube/neo-config.json +6 -0
  26. package/package.json +6 -6
  27. package/resources/data/deck/learnneo/pages/Earthquakes-01-goals.md +32 -0
  28. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-01-generate-a-workspace.md +47 -0
  29. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-02-generate-the-starter-app.md +150 -0
  30. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-03-debugging.md +136 -0
  31. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-04-fetch-data.md +146 -0
  32. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-05-refactor-the-table.md +146 -0
  33. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-06-use-a-view-model.md +301 -0
  34. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-07-use-the-google-maps-addon.md +175 -0
  35. package/resources/data/deck/learnneo/pages/Earthquakes-Lab-08-events.md +38 -0
  36. package/resources/data/deck/learnneo/pages/Earthquakes.md +8 -8
  37. package/resources/data/deck/learnneo/pages/Glossary.md +0 -0
  38. package/resources/data/deck/learnneo/pages/GuideEvents.md +80 -1
  39. package/resources/data/deck/learnneo/tree.json +2 -1
  40. package/resources/images/apps/portal/neo-references.png +0 -0
  41. package/resources/scss/src/apps/portal/Viewport.scss +18 -0
  42. package/resources/scss/src/apps/portal/blog/Container.scss +7 -7
  43. package/resources/scss/src/apps/portal/blog/List.scss +20 -16
  44. package/resources/scss/src/apps/portal/home/parts/MainNeo.scss +4 -5
  45. package/resources/scss/src/apps/portal/home/parts/References.scss +46 -0
  46. package/resources/scss/src/apps/portal/learn/ContentTreeList.scss +20 -0
  47. package/resources/scss/src/apps/portal/learn/ContentView.scss +4 -0
  48. package/resources/scss/src/apps/portal/learn/MainContainer.scss +1 -1
  49. package/resources/scss/src/apps/portal/learn/PageContainer.scss +22 -16
  50. package/resources/scss/src/apps/portal/services/Component.scss +20 -0
  51. package/resources/scss/src/component/Carousel.scss +21 -0
  52. package/resources/scss/src/examples/layout/cube/MainContainer.scss +7 -0
  53. package/resources/scss/src/layout/Cube.scss +80 -0
  54. package/resources/scss/src/tab/Container.scss +10 -10
  55. package/resources/scss/theme-neo-light/apps/portal/blog/Container.scss +3 -0
  56. package/resources/scss/theme-neo-light/form/field/Search.scss +1 -1
  57. package/resources/scss/theme-neo-light/tooltip/Base.scss +1 -1
  58. package/src/DefaultConfig.mjs +2 -2
  59. package/src/Main.mjs +15 -1
  60. package/src/Neo.mjs +14 -3
  61. package/src/component/Base.mjs +18 -1
  62. package/src/container/Base.mjs +3 -1
  63. package/src/dialog/Base.mjs +1 -2
  64. package/src/layout/Base.mjs +43 -6
  65. package/src/layout/Card.mjs +21 -59
  66. package/src/layout/Cube.mjs +428 -0
  67. package/src/layout/Fit.mjs +9 -38
  68. package/src/layout/Flexbox.mjs +16 -17
  69. package/src/layout/Form.mjs +13 -70
  70. package/src/layout/Grid.mjs +6 -18
  71. package/src/main/mixin/DeltaUpdates.mjs +16 -3
  72. package/src/util/Array.mjs +36 -0
  73. package/src/vdom/Helper.mjs +328 -445
  74. package/src/vdom/VNode.mjs +12 -1
  75. package/test/siesta/siesta.js +16 -1
  76. package/test/siesta/tests/VdomCalendar.mjs +2111 -37
  77. package/test/siesta/tests/VdomHelper.mjs +283 -47
  78. package/test/siesta/tests/vdom/Advanced.mjs +367 -0
  79. package/test/siesta/tests/vdom/layout/Cube.mjs +189 -0
  80. package/test/siesta/tests/vdom/table/Container.mjs +133 -0
  81. package/resources/scss/theme-neo-light/apps/portal/learn/ContentTreeList.scss +0 -23
@@ -27,17 +27,17 @@ class How extends BaseContainer {
27
27
  style : {padding: '2rem'},
28
28
  layout: {ntype: 'vbox', align: 'center', pack: 'center'},
29
29
  items : [{
30
- cls : 'neo-h1',
30
+ cls : ['neo-h1'],
31
31
  flex: 'none',
32
32
  html: 'How?',
33
33
  vdom: {tag: 'h1'}
34
34
  }, {
35
- cls : 'neo-h2',
35
+ cls : ['neo-h2'],
36
36
  flex: 'none',
37
37
  html: 'How Does Neo.mjs Do It?',
38
38
  vdom: {tag: 'h2'}
39
39
  }, {
40
- cls : 'neo-h3',
40
+ cls : ['neo-h3'],
41
41
  flex: 'none',
42
42
  vdom: {tag: 'p'},
43
43
  html: [
@@ -28,19 +28,18 @@ class MainNeo extends BaseContainer {
28
28
  }, {
29
29
  cls : ['neo-h1'],
30
30
  flex: 'none',
31
- html: 'The High-Performance Web Framework for Next Generation Interfaces',
31
+ html: 'Harness the Power of Multi-Threading for Ultra-Fast Frontends',
32
32
  vdom: {tag: 'h1'}
33
33
  }, {
34
34
  ntype: 'container',
35
35
  cls : ['button-group'],
36
36
  flex : 'none',
37
-
38
37
  items: [{
39
- module : Button,
40
- cls : ['get-started-button'],
41
- text : 'Get started',
42
- flex : 'none',
43
- route : '/learn'
38
+ module: Button,
39
+ cls : ['get-started-button'],
40
+ flex : 'none',
41
+ route : '/learn',
42
+ text : 'Get started'
44
43
  }, {
45
44
  module: Button,
46
45
  cls : ['neo-github'],
@@ -0,0 +1,88 @@
1
+ import BaseContainer from './BaseContainer.mjs';
2
+ import Carousel from "../../../../../src/component/Carousel.mjs";
3
+
4
+ /**
5
+ * @class Portal.view.home.parts.References
6
+ * @extends Portal.view.home.parts.BaseContainer
7
+ */
8
+ class References extends BaseContainer {
9
+ static config = {
10
+ /**
11
+ * @member {String} className='Portal.view.home.parts.References'
12
+ * @protected
13
+ */
14
+ className: 'Portal.view.home.parts.References',
15
+ /**
16
+ * @member {String} cls='portal-references'
17
+ */
18
+ cls: 'portal-references',
19
+ /**
20
+ * @member {Object} layout={ntype:'vbox',align:'stretch',pack:'center'}
21
+ */
22
+ layout: {ntype: 'vbox', align: 'stretch', pack: 'center'},
23
+ /**
24
+ * @member {Object[]} items
25
+ */
26
+ items: [{
27
+ ntype: 'container',
28
+ flex : '1 1 100%'
29
+ }, {
30
+ cls : 'neo-h1',
31
+ flex: 'none',
32
+ html: 'References',
33
+ vdom: {tag: 'h1'}
34
+ }, {
35
+ cls : 'neo-h2',
36
+ flex: 'none',
37
+ html: 'What people think about Neo',
38
+ vdom: {tag: 'h2'}
39
+ }, {
40
+ module: Carousel,
41
+ // will automatically change to the next extry every 5500 ms
42
+ // if not set or 0, this will show arrows to navigate
43
+ autoRun: 5500,
44
+ store : {
45
+ model: {
46
+ fields: [
47
+ // @formatter:off
48
+ {name: 'quote', type: 'String'},
49
+ {name: 'publisher', type: 'String'},
50
+ {name: 'date', type: 'String'}
51
+ // @formatter:on
52
+ ]
53
+ },
54
+ data : [{
55
+ quote : 'Neo has inspired me to try out new ways and pursue more modern approaches.',
56
+ publisher: 'Torsten Dinkheller',
57
+ date : 'Mai 2024'
58
+ }, {
59
+ quote : 'With Neo, I no longer lose sight of important customers. I can finally use 2 monitors for my work.',
60
+ publisher: 'Pat Wemerson',
61
+ date : 'June 2024'
62
+ }, {
63
+ quote : 'Up-to-dateness is everything in my job, so Neo\'s data processing speed is just right for me.',
64
+ publisher: 'Texas Ranger',
65
+ date : 'Juli 2024'
66
+ }, {
67
+ quote : 'Starting a project with Neo has brought me back up to speed. Always one step ahead of the browser.',
68
+ publisher: 'Future Developer',
69
+ date : 'April 2024'
70
+ }]
71
+ },
72
+ // custom item cls
73
+ itemCls: 'example-carousel-item',
74
+ // each item will be created like the itemTpl structure
75
+ itemTpl: data => [{
76
+ cls : 'neo-quote',
77
+ html: data.quote
78
+ }, {
79
+ cls : 'neo-details',
80
+ html: `${data.publisher} - ${data.date}`
81
+ }]
82
+ }]
83
+ }
84
+ }
85
+
86
+ Neo.setupClass(References);
87
+
88
+ export default References;
@@ -18,9 +18,9 @@ class MainContainer extends Container {
18
18
  */
19
19
  className: 'Portal.view.learn.MainContainer',
20
20
  /**
21
- * @member {String[]} cls=['learnneo-maincontainer']
21
+ * @member {String[]} cls=['portal-learn-maincontainer']
22
22
  */
23
- cls: ['learnneo-maincontainer'],
23
+ cls: ['portal-learn-maincontainer'],
24
24
  /**
25
25
  * @member {Neo.controller.Component} controller=MainContainerController
26
26
  */
@@ -34,6 +34,7 @@ class MainContainer extends Container {
34
34
  cls : ['sidenav-container'],
35
35
  layout : 'fit',
36
36
  minWidth: 350,
37
+ tag :'aside',
37
38
  width : 350,
38
39
 
39
40
  items: [{
@@ -16,6 +16,7 @@ class MainContainerController extends Controller {
16
16
  * @member {Object} routes
17
17
  */
18
18
  routes: {
19
+ '/learn' : 'onRouteDefault',
19
20
  '/learn/{itemId}': 'onRouteLearnItem'
20
21
  }
21
22
  }
@@ -130,6 +131,16 @@ class MainContainerController extends Controller {
130
131
  /**
131
132
  * @param {Object} data
132
133
  */
134
+ onRouteDefault(data) {
135
+ if (!this.getModel().data.currentPageRecord) {
136
+ this.onRouteLearnItem({itemId: 'WhyNeo-Intro'})
137
+ }
138
+ }
139
+
140
+ /**
141
+ * @param {Object} data
142
+ * @param {String} data.itemId
143
+ */
133
144
  onRouteLearnItem(data) {
134
145
  let model = this.getModel(),
135
146
  store = model.getStore('contentTree');
@@ -14,10 +14,10 @@ class PageContainer extends Container {
14
14
  */
15
15
  className: 'Portal.view.learn.PageContainer',
16
16
  /**
17
- * @member {String[]} baseCls=['learn-content-container','neo-container']
17
+ * @member {String[]} baseCls=['portal-learn-page-container','neo-container']
18
18
  * @protected
19
19
  */
20
- baseCls: ['learn-content-container', 'neo-container'],
20
+ baseCls: ['portal-learn-page-container', 'neo-container'],
21
21
  /**
22
22
  * @member {Object} bind
23
23
  */
@@ -38,7 +38,9 @@ class PageContainer extends Container {
38
38
  }, {
39
39
  module: Toolbar,
40
40
  flex : 'none',
41
- cls : 'content-bottom-toolbar',
41
+ cls : ['content-bottom-toolbar'],
42
+ layout: 'grid',
43
+ tag : 'nav',
42
44
  items : [{
43
45
  cls : ['content-bottom-toolbar-previous'],
44
46
  handler : 'onPreviousPageButtonClick',
@@ -0,0 +1,73 @@
1
+ import BaseComponent from '../../../../src/component/Base.mjs';
2
+
3
+ /**
4
+ * @class Portal.view.services.Component
5
+ * @extends Neo.component.Base
6
+ */
7
+ class Component extends BaseComponent {
8
+ static config = {
9
+ /**
10
+ * @member {String} className='Portal.view.services.Component'
11
+ * @protected
12
+ */
13
+ className: 'Portal.view.services.Component',
14
+ /**
15
+ * @member {String[]} cls=['portal-services-component']
16
+ */
17
+ cls: ['portal-services-component'],
18
+ /**
19
+ * @member {Object} vdom
20
+ */
21
+ vdom:
22
+ {cn: [
23
+ {tag: 'h1', html: 'Services'},
24
+ {cls: ['info-block'], cn: [
25
+ {tag: 'h2', html: 'Weekly Workshops'},
26
+ {tag: 'p', html: [
27
+ 'We are doing weekly workshops on Thursdays 17:30 CEST (11:30am EST) for 60m free of charge.</br>',
28
+ 'Ping us inside our ',
29
+ '<a href="https://join.slack.com/t/neomjs/shared_invite/zt-6c50ueeu-3E1~M4T9xkNnb~M_prEEOA">Slack Channel</a>, ',
30
+ 'in case you would like to join us.'
31
+ ].join('')},
32
+ ]},
33
+ {cls: ['info-block'], cn: [
34
+ {tag: 'h2', html: 'Professional Trainings'},
35
+ {tag: 'p', html: [
36
+ 'While we do have a self-study based Learning Section online, you can also hire us ',
37
+ 'in case you prefer an Instructor-led Training for bringing your team up to speed.'
38
+ ].join('')},
39
+ {tag: 'ul', cn: [
40
+ {tag: 'li', html: 'One week packed with 40h of intense training.'},
41
+ {tag: 'li', html: 'Including hands-on Labs'},
42
+ {tag: 'li', html: '6 - 12 attendees'},
43
+ {tag: 'li', html: 'While Remote Trainings are possible, we strongly recommend On-Site Trainings instead.'},
44
+ ]},
45
+ {tag: 'p', html: [
46
+ 'Feel free to send us an <a href="mailto:trainings@neomjs.com">Email</a> to plan your training timeframe.',
47
+ ].join('')},
48
+ ]},
49
+ {cls: ['info-block'], cn: [
50
+ {tag: 'h2', html: 'Professional Services'},
51
+ {tag: 'p', html: [
52
+ 'We can help you to ensure your Neo.mjs based projects run successfully.',
53
+ ].join('')},
54
+ {tag: 'ul', cn: [
55
+ {tag: 'li', html: 'Feasibility Analysis: Is Neo.mjs a good fit for your project needs?'},
56
+ {tag: 'li', html: 'Creating a Neo.mjs PoC which matches your specific needs'},
57
+ {tag: 'li', html: 'Code Reviews'},
58
+ {tag: 'li', html: 'Frontend-Architecture Guidance'},
59
+ {tag: 'li', html: 'Application & Framework Debugging'},
60
+ {tag: 'li', html: 'Creation of Custom Components, Design Themes & new Features'},
61
+ {tag: 'li', html: 'Hands-On Application Development Support'}
62
+ ]},
63
+ {tag: 'p', html: [
64
+ 'In case you need help, send us an <a href="mailto:services@neomjs.com">Email</a>.',
65
+ ].join('')}
66
+ ]}
67
+ ]}
68
+ }
69
+ }
70
+
71
+ Neo.setupClass(Component);
72
+
73
+ export default Component;
@@ -1,4 +1,17 @@
1
1
  [
2
+ {
3
+ "author" : "Tobias Uhlig",
4
+ "authorImage" : "author_TobiasUhlig.jpeg",
5
+ "date" : "Jul 12, 2024",
6
+ "id" : 59,
7
+ "image" : "transform_dom_tree.png",
8
+ "name" : "A blazing-fast algorithm to transform one DOM tree into another",
9
+ "provider" : "Medium",
10
+ "publisher" : "ITNEXT",
11
+ "selectedInto": [],
12
+ "type" : "Blog Post",
13
+ "url" : "https://itnext.io/a-blazing-fast-algorithm-to-transform-one-dom-tree-into-another-4ff9c934bc49?source=friends_link&sk=f1de46dbd464095b8d0b0a271644cb75"
14
+ },
2
15
  {
3
16
  "author" : "Tobias Uhlig",
4
17
  "authorImage" : "author_TobiasUhlig.jpeg",
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.18.3'
23
+ * @member {String} version='6.19.0'
24
24
  */
25
- version: '6.18.3'
25
+ version: '6.19.0'
26
26
  }
27
27
 
28
28
  /**
@@ -22,21 +22,21 @@ class MainContainer extends ConfigurationViewport {
22
22
  labelText: 'autoRun',
23
23
  listeners: {change: me.onConfigChange.bind(me, 'autoRun')}
24
24
  }, {
25
- module : RangeField,
26
- labelText : 'height',
27
- listeners : {change: me.onConfigChange.bind(me, 'height')},
28
- maxValue : 800,
29
- minValue : 200,
30
- stepSize : 1,
31
- value : me.exampleComponent.height
25
+ module : RangeField,
26
+ labelText: 'height',
27
+ listeners: {change: me.onConfigChange.bind(me, 'height')},
28
+ maxValue : 800,
29
+ minValue : 200,
30
+ stepSize : 1,
31
+ value : me.exampleComponent.height
32
32
  }, {
33
- module : RangeField,
34
- labelText : 'width',
35
- listeners : {change: me.onConfigChange.bind(me, 'width')},
36
- maxValue : 800,
37
- minValue : 200,
38
- stepSize : 1,
39
- value : me.exampleComponent.width
33
+ module : RangeField,
34
+ labelText: 'width',
35
+ listeners: {change: me.onConfigChange.bind(me, 'width')},
36
+ maxValue : 800,
37
+ minValue : 200,
38
+ stepSize : 1,
39
+ value : me.exampleComponent.width
40
40
  }];
41
41
  }
42
42
 
@@ -48,33 +48,42 @@ class MainContainer extends ConfigurationViewport {
48
48
  // if not set or 0, this will show arrows to navigate
49
49
  // cannot be changed after created
50
50
  autoRun: 5500,
51
- store: {
52
- data: [{
53
- "quote": "We love the German inspired dishes on the menu",
54
- "publisher": "Trip Advisor",
55
- "date": "Dezember 2020"
56
- },{
57
- "quote": "Everything about this place was excellent, from start to finish",
58
- "publisher": "Trip Advisor",
59
- "date": "Dezember 2021"
60
- },{
61
- "quote": "We had three courses and everything was great",
62
- "publisher": "Trip Advisor",
63
- "date": "September 2020"
64
- },{
65
- "quote": "Excellent Food, Wine and Service",
66
- "publisher": "Best Food",
67
- "date": "August 2020"
51
+ store : {
52
+ model: {
53
+ fields: [
54
+ // @formatter:off
55
+ {name: 'quote', type: 'String'},
56
+ {name: 'publisher', type: 'String'},
57
+ {name: 'date', type: 'String'}
58
+ // @formatter:on
59
+ ]
60
+ },
61
+ data : [{
62
+ quote : 'We love the German inspired dishes on the menu',
63
+ publisher: 'Trip Advisor',
64
+ date : 'Dezember 2020'
65
+ }, {
66
+ quote : 'Everything about this place was excellent, from start to finish',
67
+ publisher: 'Trip Advisor',
68
+ date : 'Dezember 2021'
69
+ }, {
70
+ quote : 'We had three courses and everything was great',
71
+ publisher: 'Trip Advisor',
72
+ date : 'September 2020'
73
+ }, {
74
+ quote : 'Excellent Food, Wine and Service',
75
+ publisher: 'Best Food',
76
+ date : 'August 2020'
68
77
  }]
69
78
  },
70
79
  // custom item cls
71
80
  itemCls: 'example-carousel-item',
72
81
  // each item will be created like the itemTpl structure
73
82
  itemTpl: data => [{
74
- cls: 'example-quote',
83
+ cls : 'example-quote',
75
84
  html: data.quote
76
85
  }, {
77
- cls: 'example-details',
86
+ cls : 'example-details',
78
87
  html: `${data.publisher} - ${data.date}`
79
88
  }]
80
89
  });
@@ -0,0 +1,217 @@
1
+ import ConfigurationViewport from '../../ConfigurationViewport.mjs';
2
+ import Container from '../../../src/container/Base.mjs';
3
+ import CubeLayout from '../../../src/layout/Cube.mjs';
4
+ import NumberField from '../../../src/form/field/Number.mjs';
5
+ import Radio from '../../../src/form/field/Radio.mjs';
6
+ import RangeField from '../../../src/form/field/Range.mjs';
7
+ import Toolbar from '../../../src/toolbar/Base.mjs';
8
+
9
+ /**
10
+ * @class Neo.examples.layout.cube.MainContainer
11
+ * @extends Neo.examples.ConfigurationViewport
12
+ */
13
+ class MainContainer extends ConfigurationViewport {
14
+ static config = {
15
+ className : 'Neo.examples.layout.cube.MainContainer',
16
+ cls : ['examples-layout-cube-maincontainer'],
17
+ configItemLabelWidth: 160,
18
+ configItemWidth : 280,
19
+ layout : {ntype: 'hbox', align: 'stretch'}
20
+ }
21
+
22
+ createConfigurationComponents() {
23
+ let me = this,
24
+ {layout} = me.exampleComponent.getItem('container');
25
+
26
+ return [{
27
+ module : Radio,
28
+ checked : layout.ntype === 'layout-cube',
29
+ hideValueLabel: false,
30
+ labelText : 'layout',
31
+ listeners : {change: me.onRadioLayoutChange.bind(me, 'cube')},
32
+ name : 'layout',
33
+ valueLabelText: 'Cube'
34
+ }, {
35
+ module : Radio,
36
+ checked : layout.ntype === 'layout-vbox',
37
+ hideValueLabel: false,
38
+ labelText : '',
39
+ listeners : {change: me.onRadioLayoutChange.bind(me, 'vbox')},
40
+ name : 'layout',
41
+ valueLabelText: 'VBox'
42
+ }, {
43
+ module : RangeField,
44
+ labelText: 'perspective',
45
+ listeners: {change: me.onLayoutConfigChange.bind(me, 'perspective')},
46
+ maxValue : 2000,
47
+ minValue : 400,
48
+ stepSize : 10,
49
+ style : {marginTop: '20px'},
50
+ value : layout.perspective
51
+ }, {
52
+ module : RangeField,
53
+ labelText: 'rotateX',
54
+ listeners: {change: me.onLayoutConfigChange.bind(me, 'rotateX')},
55
+ maxValue : 360,
56
+ minValue : 0,
57
+ stepSize : 1,
58
+ style : {marginTop: '20px'},
59
+ value : layout.rotateX
60
+ }, {
61
+ module : RangeField,
62
+ labelText: 'rotateY',
63
+ listeners: {change: me.onLayoutConfigChange.bind(me, 'rotateY')},
64
+ maxValue : 360,
65
+ minValue : 0,
66
+ stepSize : 1,
67
+ value : layout.rotateY
68
+ }, {
69
+ module : RangeField,
70
+ labelText: 'rotateZ',
71
+ listeners: {change: me.onLayoutConfigChange.bind(me, 'rotateZ')},
72
+ maxValue : 360,
73
+ minValue : 0,
74
+ stepSize : 1,
75
+ value : layout.rotateZ
76
+ }, {
77
+ module : RangeField,
78
+ labelText: 'sideX',
79
+ listeners: {change: me.onLayoutConfigChange.bind(me, 'sideX')},
80
+ maxValue : 400,
81
+ minValue : 100,
82
+ stepSize : 10,
83
+ style : {marginTop: '20px'},
84
+ value : layout.sideX
85
+ }, {
86
+ module : RangeField,
87
+ labelText: 'sideY',
88
+ listeners: {change: me.onLayoutConfigChange.bind(me, 'sideY')},
89
+ maxValue : 400,
90
+ minValue : 100,
91
+ stepSize : 10,
92
+ value : layout.sideY
93
+ }, {
94
+ module : RangeField,
95
+ labelText: 'sideZ',
96
+ listeners: {change: me.onLayoutConfigChange.bind(me, 'sideZ')},
97
+ maxValue : 400,
98
+ minValue : 100,
99
+ stepSize : 10,
100
+ value : layout.sideZ
101
+ }, {
102
+ module : NumberField,
103
+ clearable: true,
104
+ labelText: 'height',
105
+ listeners: {change: me.onConfigChange.bind(me, 'height')},
106
+ maxValue : 1000,
107
+ minValue : 300,
108
+ stepSize : 10,
109
+ style : {marginTop: '20px'},
110
+ value : me.exampleComponent.height
111
+ }, {
112
+ module : NumberField,
113
+ clearable: true,
114
+ labelText: 'width',
115
+ listeners: {change: me.onConfigChange.bind(me, 'width')},
116
+ maxValue : 1000,
117
+ minValue : 300,
118
+ stepSize : 10,
119
+ style : {marginTop: '10px'},
120
+ value : me.exampleComponent.width
121
+ }];
122
+ }
123
+
124
+ /**
125
+ * @returns {Neo.component.Base}
126
+ */
127
+ createExampleComponent() {
128
+ return Neo.create({
129
+ module: Container,
130
+ height: 550,
131
+ layout: {ntype: 'vbox', align: 'center', pack: 'center'},
132
+ width : 550,
133
+
134
+ items: [{
135
+ module : Container,
136
+ reference: 'container',
137
+ style : {color: 'white', fontSize: '50px', margin: '50px', textAlign: 'center'},
138
+
139
+ layout: {
140
+ ntype : 'cube',
141
+ rotateX: 194,
142
+ rotateY: 213,
143
+ rotateZ: 162
144
+ },
145
+
146
+ items: [
147
+ {style: {backgroundColor: 'rgba(255, 0, 0, 0.5)'}, html: 'Front'},
148
+ {style: {backgroundColor: 'rgba( 0, 255, 0, 0.5)'}, html: 'Back'},
149
+ {style: {backgroundColor: 'rgba( 0, 0, 255, 0.5)'}, html: 'Left'},
150
+ {style: {backgroundColor: 'rgba( 0, 255, 255, 0.5)'}, html: 'Right'},
151
+ {style: {backgroundColor: 'rgba(255, 0, 255, 0.5)'}, html: 'Top'},
152
+ {style: {backgroundColor: 'rgba(255, 255, 0, 0.5)'}, html: 'Bottom'}
153
+ ]
154
+ }, {
155
+ module: Toolbar,
156
+ flex : 'none',
157
+ style : {marginTop: '1em'},
158
+
159
+ itemDefaults: {
160
+ ntype : 'button',
161
+ handler: 'up.onFaceButtonClick',
162
+ style : {marginRight: '.3em'}
163
+ },
164
+
165
+ items: [
166
+ {text: 'Front'},
167
+ {text: 'Back'},
168
+ {text: 'Left'},
169
+ {text: 'Right'},
170
+ {text: 'Top'},
171
+ {text: 'Bottom'}
172
+ ]
173
+ }]
174
+ })
175
+ }
176
+
177
+ /**
178
+ * @param {Object} data
179
+ */
180
+ onFaceButtonClick(data) {
181
+ this.getItem('container').layout['activeFace'] = data.component.text.toLowerCase()
182
+ }
183
+
184
+
185
+ /**
186
+ * @param {String} config
187
+ * @param {Object} opts
188
+ */
189
+ onLayoutConfigChange(config, opts) {
190
+ this.getItem('container').layout[config] = opts.value
191
+ }
192
+
193
+ /**
194
+ * @param {String} name
195
+ * @param {Object} opts
196
+ */
197
+ onRadioLayoutChange(name, opts) {
198
+ if (opts.value === true) { // we only want to listen to check events, not uncheck
199
+ let layout = name;
200
+
201
+ if (name === 'cube') {
202
+ layout = {
203
+ ntype : 'cube',
204
+ rotateX: 194,
205
+ rotateY: 213,
206
+ rotateZ: 162
207
+ }
208
+ }
209
+
210
+ this.getItem('container').layout = layout;
211
+ }
212
+ }
213
+ }
214
+
215
+ Neo.setupClass(MainContainer);
216
+
217
+ export default MainContainer;
@@ -0,0 +1,6 @@
1
+ import MainContainer from './MainContainer.mjs';
2
+
3
+ export const onStart = () => Neo.app({
4
+ mainView: MainContainer,
5
+ name : 'Neo.examples.layout.cube'
6
+ });
@@ -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 Cube Layout</title>
7
+ </head>
8
+ <body>
9
+ <script src="../../../src/MicroLoader.mjs" type="module"></script>
10
+ </body>
11
+ </html>
@@ -0,0 +1,6 @@
1
+ {
2
+ "appPath" : "examples/layout/cube/app.mjs",
3
+ "basePath" : "../../../",
4
+ "environment": "development",
5
+ "mainPath" : "./Main.mjs"
6
+ }