neo.mjs 7.0.1 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -6
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/portal/Overwrites.mjs +0 -10
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/home/FeatureSection.mjs +3 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/apps/portal/view/home/parts/Colors.mjs +2 -2
- package/buildScripts/README.md +25 -81
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/component/coronaGallery/CountryGallery.mjs +15 -6
- package/examples/component/coronaGallery/Viewport.mjs +317 -0
- package/examples/component/coronaGallery/ViewportController.mjs +88 -0
- package/examples/component/coronaGallery/app.mjs +2 -2
- package/examples/component/multiWindowCoronaGallery/Viewport.mjs +47 -0
- package/examples/component/multiWindowCoronaGallery/ViewportController.mjs +128 -0
- package/examples/component/multiWindowCoronaGallery/app.mjs +6 -0
- package/examples/component/multiWindowCoronaGallery/childapp/Viewport.mjs +21 -0
- package/examples/component/multiWindowCoronaGallery/childapp/app.mjs +6 -0
- package/examples/component/multiWindowCoronaGallery/childapp/index.html +11 -0
- package/examples/component/multiWindowCoronaGallery/childapp/neo-config.json +9 -0
- package/examples/component/multiWindowCoronaGallery/index.html +11 -0
- package/examples/component/multiWindowCoronaGallery/neo-config.json +8 -0
- package/examples/table/container/MainContainer.mjs +1 -0
- package/examples/table/container/MainStore.mjs +2 -1
- package/package.json +4 -4
- package/resources/scss/src/apps/portal/home/parts/Helix.scss +4 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/Neo.mjs +0 -7
- package/src/button/Base.mjs +20 -2
- package/src/button/Split.mjs +16 -0
- package/src/collection/Base.mjs +2 -2
- package/src/component/Base.mjs +10 -5
- package/src/component/Video.mjs +8 -29
- package/src/container/Base.mjs +4 -3
- package/src/dialog/Base.mjs +34 -8
- package/src/draggable/DragZone.mjs +10 -8
- package/src/form/field/Text.mjs +2 -0
- package/src/form/field/trigger/Time.mjs +14 -0
- package/src/layout/Base.mjs +8 -8
- package/src/list/Component.mjs +14 -0
- package/src/plugin/PrefixField.mjs +1 -1
- package/src/plugin/Resizable.mjs +19 -5
- package/src/table/header/Button.mjs +2 -0
- package/src/toolbar/Base.mjs +15 -0
- package/src/worker/App.mjs +3 -5
- package/examples/component/coronaGallery/MainContainer.mjs +0 -377
@@ -0,0 +1,317 @@
|
|
1
|
+
import BaseViewport from '../../../src/container/Viewport.mjs';
|
2
|
+
import CountryGallery from './CountryGallery.mjs';
|
3
|
+
import Panel from '../../../src/container/Panel.mjs';
|
4
|
+
import RangeField from '../../../src/form/field/Range.mjs';
|
5
|
+
import ViewportController from './ViewportController.mjs';
|
6
|
+
|
7
|
+
/**
|
8
|
+
* @class Neo.examples.component.coronaGallery.Viewport
|
9
|
+
* @extends Neo.container.Viewport
|
10
|
+
*/
|
11
|
+
class Viewport extends BaseViewport {
|
12
|
+
static config = {
|
13
|
+
/**
|
14
|
+
* @member {String} className='Neo.examples.component.coronaGallery.Viewport'
|
15
|
+
* @protected
|
16
|
+
*/
|
17
|
+
className: 'Neo.examples.component.coronaGallery.Viewport',
|
18
|
+
/**
|
19
|
+
* @member {String[]} baseCls=['neo-gallery-viewport','neo-viewport']
|
20
|
+
*/
|
21
|
+
baseCls: ['neo-gallery-viewport', 'neo-viewport'],
|
22
|
+
/**
|
23
|
+
* @member {Neo.controller.Component} controller=ViewportController
|
24
|
+
*/
|
25
|
+
controller: ViewportController,
|
26
|
+
/**
|
27
|
+
* @member {Neo.component.Gallery|null} gallery=null
|
28
|
+
*/
|
29
|
+
gallery: null,
|
30
|
+
/**
|
31
|
+
* @member {Object|null} galleryConfig=null
|
32
|
+
*/
|
33
|
+
galleryConfig: null,
|
34
|
+
/**
|
35
|
+
* @member {Object|null} layout={ntype: 'hbox', align: 'stretch'}
|
36
|
+
*/
|
37
|
+
layout: {ntype: 'hbox', align: 'stretch'},
|
38
|
+
/**
|
39
|
+
* @member {Boolean} showGitHubStarButton_=true
|
40
|
+
*/
|
41
|
+
showGitHubStarButton_: true,
|
42
|
+
/**
|
43
|
+
* @member {Object[]} items
|
44
|
+
*/
|
45
|
+
items: [{
|
46
|
+
ntype : 'container',
|
47
|
+
flex : 1,
|
48
|
+
layout: 'fit',
|
49
|
+
style : {position: 'relative'},
|
50
|
+
|
51
|
+
items : [{
|
52
|
+
ntype: 'component',
|
53
|
+
html : 'DeltaUpdates / s: <span id="neo-delta-updates"></span>',
|
54
|
+
style: {
|
55
|
+
position: 'absolute',
|
56
|
+
right : '150px',
|
57
|
+
top : '25px',
|
58
|
+
width : '200px',
|
59
|
+
zIndex : 1
|
60
|
+
}
|
61
|
+
}, {
|
62
|
+
ntype : 'component',
|
63
|
+
html : '<a class="github-button" href="https://github.com/neomjs/neo" data-size="large" data-show-count="true" aria-label="Star neomjs/neo on GitHub">Star</a>',
|
64
|
+
reference: 'github-button',
|
65
|
+
|
66
|
+
style: {
|
67
|
+
position: 'absolute',
|
68
|
+
right : '20px',
|
69
|
+
top : '20px',
|
70
|
+
zIndex : 1
|
71
|
+
}
|
72
|
+
}]
|
73
|
+
}, {
|
74
|
+
ntype : 'panel',
|
75
|
+
cls : ['neo-controls-panel', 'neo-panel', 'neo-container'],
|
76
|
+
layout : {ntype: 'vbox', align: 'stretch'},
|
77
|
+
reference: 'controls-panel',
|
78
|
+
style : {backgroundColor: '#2b2b2b'},
|
79
|
+
width : 260,
|
80
|
+
|
81
|
+
containerConfig: {
|
82
|
+
style: {overflowY: 'scroll'}
|
83
|
+
},
|
84
|
+
|
85
|
+
headers: [{
|
86
|
+
dock: 'top',
|
87
|
+
items: [{
|
88
|
+
ntype: 'button',
|
89
|
+
text : 'X',
|
90
|
+
handler: function() {
|
91
|
+
const panel = this.up('panel'),
|
92
|
+
expand = panel.width === 40;
|
93
|
+
|
94
|
+
panel.width = expand ? 250 : 40;
|
95
|
+
this.text = expand ? 'X' : '+';
|
96
|
+
}
|
97
|
+
}, {
|
98
|
+
ntype: 'label',
|
99
|
+
text : 'Gallery Controls'
|
100
|
+
}]
|
101
|
+
}],
|
102
|
+
|
103
|
+
itemDefaults: {
|
104
|
+
flex : '0 1 auto',
|
105
|
+
labelWidth : '110px',
|
106
|
+
style : {padding: '10px'},
|
107
|
+
useInputEvent: true
|
108
|
+
},
|
109
|
+
|
110
|
+
items: [{
|
111
|
+
module : RangeField,
|
112
|
+
labelText: 'Translate X',
|
113
|
+
maxValue : 5000,
|
114
|
+
minValue : 0,
|
115
|
+
name : 'translateX',
|
116
|
+
value : 0,
|
117
|
+
listeners: {
|
118
|
+
change : 'onRangefieldChange',
|
119
|
+
mounted: 'onRangefieldMounted'
|
120
|
+
}
|
121
|
+
}, {
|
122
|
+
module : RangeField,
|
123
|
+
labelText: 'Translate Y',
|
124
|
+
maxValue : 1500,
|
125
|
+
minValue : -1500,
|
126
|
+
name : 'translateY',
|
127
|
+
value : 0,
|
128
|
+
listeners: {
|
129
|
+
change: 'onRangefieldChange'
|
130
|
+
}
|
131
|
+
}, {
|
132
|
+
module : RangeField,
|
133
|
+
labelText: 'Translate Z',
|
134
|
+
maxValue : 550,
|
135
|
+
minValue : -4500,
|
136
|
+
name : 'translateZ',
|
137
|
+
value : 0,
|
138
|
+
listeners: {
|
139
|
+
change : 'onRangefieldChange',
|
140
|
+
mounted: 'onRangefieldMounted'
|
141
|
+
}
|
142
|
+
}, {
|
143
|
+
module : RangeField,
|
144
|
+
labelText: 'Amount Rows',
|
145
|
+
maxValue : 15,
|
146
|
+
minValue : 1,
|
147
|
+
name : 'amountRows',
|
148
|
+
value : 3,
|
149
|
+
listeners: {
|
150
|
+
change: 'onRangefieldChange'
|
151
|
+
}
|
152
|
+
}, {
|
153
|
+
ntype : 'button',
|
154
|
+
handler: 'onOrderButtonClick',
|
155
|
+
text : 'Order by Row',
|
156
|
+
style : {margin: '20px'}
|
157
|
+
}, {
|
158
|
+
ntype: 'label',
|
159
|
+
text : 'Sort By:'
|
160
|
+
}, {
|
161
|
+
ntype : 'container',
|
162
|
+
layout: {ntype: 'hbox', align: 'stretch'},
|
163
|
+
style : {minHeight: '134px', padding: '0'},
|
164
|
+
|
165
|
+
items : [{
|
166
|
+
ntype : 'container',
|
167
|
+
layout: {ntype: 'vbox', align: 'stretch'},
|
168
|
+
|
169
|
+
itemDefaults: {
|
170
|
+
ntype : 'button',
|
171
|
+
handler: 'onSortButtonClick'
|
172
|
+
},
|
173
|
+
|
174
|
+
items: [{
|
175
|
+
field: 'cases',
|
176
|
+
text : 'Cases',
|
177
|
+
style: {margin: '10px', marginTop: '0'}
|
178
|
+
}, {
|
179
|
+
field: 'deaths',
|
180
|
+
text : 'Deaths',
|
181
|
+
style: {margin: '10px', marginBottom: '10px', marginTop: 0}
|
182
|
+
}, {
|
183
|
+
field: 'country',
|
184
|
+
text : 'Country',
|
185
|
+
style: {margin: '10px', marginTop: 0}
|
186
|
+
}, {
|
187
|
+
field: 'recovered',
|
188
|
+
text : 'Recovered',
|
189
|
+
style: {margin: '10px', marginTop: 0}
|
190
|
+
}]
|
191
|
+
}, {
|
192
|
+
ntype : 'container',
|
193
|
+
layout: {ntype: 'vbox', align: 'stretch'},
|
194
|
+
|
195
|
+
itemDefaults: {
|
196
|
+
ntype : 'button',
|
197
|
+
handler: 'onSortButtonClick'
|
198
|
+
},
|
199
|
+
|
200
|
+
items: [{
|
201
|
+
field: 'todayCases',
|
202
|
+
text : 'Cases today',
|
203
|
+
style: {margin: '10px', marginTop: '0'}
|
204
|
+
}, {
|
205
|
+
field: 'todayDeaths',
|
206
|
+
text : 'Deaths today',
|
207
|
+
style: {margin: '10px', marginBottom: '10px', marginTop: 0}
|
208
|
+
}, {
|
209
|
+
field: 'critical',
|
210
|
+
text : 'Critical',
|
211
|
+
style: {margin: '10px', marginBottom: '43px', marginTop: 0}
|
212
|
+
}]
|
213
|
+
}]
|
214
|
+
}, {
|
215
|
+
ntype: 'label',
|
216
|
+
text : [
|
217
|
+
'<b>Navigation Concept</b>',
|
218
|
+
'<p>You can use the Arrow Keys to walk through the items.</p>'
|
219
|
+
].join(''),
|
220
|
+
|
221
|
+
style: {
|
222
|
+
backgroundColor: '#323232',
|
223
|
+
color : '#ddd',
|
224
|
+
fontSize : '13px',
|
225
|
+
margin : '10px',
|
226
|
+
padding : '10px',
|
227
|
+
whiteSpace : 'normal'
|
228
|
+
}
|
229
|
+
}, {
|
230
|
+
ntype: 'label',
|
231
|
+
cls : ['neo-link-color'],
|
232
|
+
text : [
|
233
|
+
'<b>Attribution</b>',
|
234
|
+
'<p>App created with <a href="https://github.com/neomjs/neo">neo.mjs</a>.</p>',
|
235
|
+
'<p>Data provided by <a href="https://github.com/disease-sh/API">disease-sh/API</a>.</p>',
|
236
|
+
'<p>Country Flag Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com</a>.</p>'
|
237
|
+
].join(''),
|
238
|
+
|
239
|
+
style: {
|
240
|
+
backgroundColor: '#323232',
|
241
|
+
color : '#ddd',
|
242
|
+
fontSize : '13px',
|
243
|
+
margin : '10px',
|
244
|
+
padding : '10px',
|
245
|
+
whiteSpace : 'normal'
|
246
|
+
}
|
247
|
+
}]
|
248
|
+
}]
|
249
|
+
}
|
250
|
+
|
251
|
+
/**
|
252
|
+
* @param {Object} config
|
253
|
+
*/
|
254
|
+
construct(config) {
|
255
|
+
super.construct(config);
|
256
|
+
|
257
|
+
let me = this,
|
258
|
+
url = 'https://disease.sh/v3/covid-19/countries';
|
259
|
+
|
260
|
+
me.gallery = Neo.create({
|
261
|
+
module : CountryGallery,
|
262
|
+
appName : me.appName,
|
263
|
+
parentId : me.id,
|
264
|
+
reference: 'gallery',
|
265
|
+
...me.galleryConfig
|
266
|
+
});
|
267
|
+
|
268
|
+
me.items[0].items.unshift(me.gallery);
|
269
|
+
|
270
|
+
fetch(url)
|
271
|
+
.then(response => response.json())
|
272
|
+
.catch(err => console.log('Can’t access ' + url, err))
|
273
|
+
.then(data => me.addStoreItems(data));
|
274
|
+
|
275
|
+
Neo.Main.setNeoConfig({
|
276
|
+
key : 'renderCountDeltas',
|
277
|
+
value : true,
|
278
|
+
windowId: me.windowId
|
279
|
+
});
|
280
|
+
|
281
|
+
if (me.showGitHubStarButton) {
|
282
|
+
me.on('mounted', () => {
|
283
|
+
Neo.main.DomAccess.addScript({
|
284
|
+
async: true,
|
285
|
+
defer: true,
|
286
|
+
src : 'https://buttons.github.io/buttons.js'
|
287
|
+
})
|
288
|
+
})
|
289
|
+
}
|
290
|
+
}
|
291
|
+
|
292
|
+
/**
|
293
|
+
* @param {Object[]} data
|
294
|
+
*/
|
295
|
+
addStoreItems(data) {
|
296
|
+
this.getStore().data = data
|
297
|
+
}
|
298
|
+
|
299
|
+
/**
|
300
|
+
* @returns {Neo.data.Store}
|
301
|
+
*/
|
302
|
+
getStore() {
|
303
|
+
return this.items[0].items[0].store
|
304
|
+
}
|
305
|
+
|
306
|
+
/**
|
307
|
+
* Triggered after the showGitHubStarButton config got changed
|
308
|
+
* @param {Boolean} value
|
309
|
+
* @param {Boolean} oldValue
|
310
|
+
* @protected
|
311
|
+
*/
|
312
|
+
afterSetShowGitHubStarButton(value, oldValue) {
|
313
|
+
this.getItem('github-button').hidden = !value
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
export default Neo.setupClass(Viewport);
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import Controller from '../../../src/controller/Component.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Neo.examples.component.coronaGallery.ViewportController
|
5
|
+
* @extends Neo.controller.Component
|
6
|
+
*/
|
7
|
+
class ViewportController extends Controller {
|
8
|
+
static config = {
|
9
|
+
/**
|
10
|
+
* @member {String} className='Neo.examples.component.coronaGallery.ViewportController'
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
className: 'Neo.examples.component.coronaGallery.ViewportController',
|
14
|
+
/**
|
15
|
+
* @member {Neo.component.Gallery|null} gallery_=null
|
16
|
+
* @protected
|
17
|
+
*/
|
18
|
+
gallery_: null
|
19
|
+
}
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Triggered when accessing the gallery config
|
23
|
+
* @param {Neo.component.Gallery|null} value
|
24
|
+
* @protected
|
25
|
+
*/
|
26
|
+
beforeGetGallery(value) {
|
27
|
+
if (!value) {
|
28
|
+
this._gallery = value = this.getReference('gallery');
|
29
|
+
}
|
30
|
+
|
31
|
+
return value;
|
32
|
+
}
|
33
|
+
|
34
|
+
/**
|
35
|
+
* {Object} data
|
36
|
+
*/
|
37
|
+
onCollapseButtonClick(data) {
|
38
|
+
const panel = this.getReference('controls-panel'),
|
39
|
+
expand = panel.width === 40;
|
40
|
+
|
41
|
+
panel.width = expand ? 250 : 40;
|
42
|
+
|
43
|
+
data.component.text = expand ? 'X' : '+';
|
44
|
+
}
|
45
|
+
|
46
|
+
/**
|
47
|
+
* @param {Object} data
|
48
|
+
*/
|
49
|
+
onOrderButtonClick(data) {
|
50
|
+
const gallery = this.gallery,
|
51
|
+
orderByRow = !gallery.orderByRow;
|
52
|
+
|
53
|
+
data.component.text = orderByRow === true ? 'Order By Column' : 'Order by Row';
|
54
|
+
|
55
|
+
gallery.orderByRow = orderByRow;
|
56
|
+
}
|
57
|
+
|
58
|
+
/**
|
59
|
+
* @param {Object} data
|
60
|
+
*/
|
61
|
+
onRangefieldChange(data) {
|
62
|
+
this.gallery[data.component.name] = data.value
|
63
|
+
}
|
64
|
+
|
65
|
+
/**
|
66
|
+
* @param {String} id
|
67
|
+
*/
|
68
|
+
onRangefieldMounted(id) {
|
69
|
+
const field = Neo.getComponent(id);
|
70
|
+
|
71
|
+
this.gallery.on('change' + Neo.capitalize(field.name), function(value) {
|
72
|
+
value = Math.min(Math.max(value, field.minValue), field.maxValue);
|
73
|
+
field.value = value
|
74
|
+
})
|
75
|
+
}
|
76
|
+
|
77
|
+
/**
|
78
|
+
* @param {Object} data
|
79
|
+
*/
|
80
|
+
onSortButtonClick(data) {
|
81
|
+
this.gallery.store.sorters = [{
|
82
|
+
property : data.component.field,
|
83
|
+
direction: 'DESC'
|
84
|
+
}]
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
export default Neo.setupClass(ViewportController);
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import BaseViewport from '../coronaGallery/Viewport.mjs';
|
2
|
+
import ViewportController from './ViewportController.mjs';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @class Neo.examples.component.multiWindowCoronaGallery.Viewport
|
6
|
+
* @extends Neo.examples.component.coronaGallery.Viewport
|
7
|
+
*/
|
8
|
+
class Viewport extends BaseViewport {
|
9
|
+
static config = {
|
10
|
+
/**
|
11
|
+
* @member {String} className='Neo.examples.component.multiWindowCoronaGallery.Viewport'
|
12
|
+
* @protected
|
13
|
+
*/
|
14
|
+
className: 'Neo.examples.component.multiWindowCoronaGallery.Viewport',
|
15
|
+
/**
|
16
|
+
* @member {String[]} cls=['multi-window-helix-viewport']
|
17
|
+
*/
|
18
|
+
cls: ['multi-window-helix-viewport'],
|
19
|
+
/**
|
20
|
+
* @member {Neo.controller.Component} controller=ViewportController
|
21
|
+
*/
|
22
|
+
controller: ViewportController
|
23
|
+
}
|
24
|
+
|
25
|
+
/**
|
26
|
+
* @param {Object} config
|
27
|
+
*/
|
28
|
+
construct(config) {
|
29
|
+
super.construct(config);
|
30
|
+
|
31
|
+
this.getItem('controls-panel').headers = [{
|
32
|
+
dock : 'top',
|
33
|
+
reference: 'header-toolbar',
|
34
|
+
|
35
|
+
items: [{
|
36
|
+
ntype: 'label',
|
37
|
+
cls : ['neo-panel-header-text', 'neo-label'],
|
38
|
+
text : 'Gallery Controls'
|
39
|
+
}, '->', {
|
40
|
+
handler: 'onMaximiseButtonClick',
|
41
|
+
iconCls: 'far fa-window-maximize'
|
42
|
+
}]
|
43
|
+
}]
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
export default Neo.setupClass(Viewport);
|
@@ -0,0 +1,128 @@
|
|
1
|
+
import Controller from '../coronaGallery/ViewportController.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Neo.examples.component.multiWindowCoronaGallery.ViewportController
|
5
|
+
* @extends Neo.examples.component.coronaGallery.ViewportController
|
6
|
+
*/
|
7
|
+
class ViewportController extends Controller {
|
8
|
+
static config = {
|
9
|
+
/**
|
10
|
+
* @member {String} className='Neo.examples.component.multiWindowCoronaGallery.ViewportController'
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
className: 'Neo.examples.component.multiWindowCoronaGallery.ViewportController'
|
14
|
+
}
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @member {String[]} connectedApps=[]
|
18
|
+
*/
|
19
|
+
connectedApps = []
|
20
|
+
|
21
|
+
/**
|
22
|
+
*
|
23
|
+
*/
|
24
|
+
async createPopupWindow() {
|
25
|
+
let me = this,
|
26
|
+
{windowId} = me,
|
27
|
+
{config, windowConfigs} = Neo,
|
28
|
+
{environment} = config,
|
29
|
+
firstWindowId = parseInt(Object.keys(windowConfigs)[0]),
|
30
|
+
{basePath} = windowConfigs[firstWindowId],
|
31
|
+
widget = me.getReference('controls-panel'),
|
32
|
+
winData = await Neo.Main.getWindowData({windowId}),
|
33
|
+
rect = await me.component.getDomRect(widget.id),
|
34
|
+
{height, left, top, width} = rect;
|
35
|
+
|
36
|
+
if (environment !== 'development') {
|
37
|
+
basePath = `${basePath + environment}/`
|
38
|
+
}
|
39
|
+
|
40
|
+
height -= 62; // popup header in Chrome
|
41
|
+
left += (width + winData.screenLeft);
|
42
|
+
top += (winData.outerHeight - winData.innerHeight + winData.screenTop);
|
43
|
+
|
44
|
+
/*
|
45
|
+
* For this demo, the url './childapp/' would be sufficient.
|
46
|
+
* However, we also want to open it from within apps/portal.
|
47
|
+
*
|
48
|
+
* We match the basePath to the firstWindowId,
|
49
|
+
* assuming the first connected window is the (main) one which we want to be in charge.
|
50
|
+
*/
|
51
|
+
await Neo.Main.windowOpen({
|
52
|
+
url : basePath + 'examples/component/multiWindowCoronaGallery/childapp/',
|
53
|
+
windowFeatures: `height=${height},left=${left},top=${top},width=${width}`,
|
54
|
+
windowId : firstWindowId,
|
55
|
+
windowName : 'GalleryControls'
|
56
|
+
})
|
57
|
+
}
|
58
|
+
|
59
|
+
/**
|
60
|
+
* @param {Object} data
|
61
|
+
* @param {String} data.appName
|
62
|
+
* @param {Number} data.windowId
|
63
|
+
*/
|
64
|
+
async onAppConnect(data) {
|
65
|
+
let me = this,
|
66
|
+
{appName} = data;
|
67
|
+
|
68
|
+
if (appName === 'GalleryControls') {
|
69
|
+
let controlsPanel = me.getReference('controls-panel'),
|
70
|
+
{mainView} = Neo.apps[appName];
|
71
|
+
|
72
|
+
me.connectedApps.push(appName);
|
73
|
+
|
74
|
+
controlsPanel.parent.remove(controlsPanel, false);
|
75
|
+
|
76
|
+
this.getReference('header-toolbar').hidden = true;
|
77
|
+
|
78
|
+
mainView.add(controlsPanel)
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
/**
|
83
|
+
* @param {Object} data
|
84
|
+
* @param {String} data.appName
|
85
|
+
* @param {Number} data.windowId
|
86
|
+
*/
|
87
|
+
async onAppDisconnect(data) {
|
88
|
+
let me = this,
|
89
|
+
{appName, windowId} = data;
|
90
|
+
|
91
|
+
if (appName === 'GalleryControls') {
|
92
|
+
let controlsPanel = me.getReference('controls-panel');
|
93
|
+
|
94
|
+
controlsPanel.parent.remove(controlsPanel, false);
|
95
|
+
|
96
|
+
me.getReference('header-toolbar').hidden = false;
|
97
|
+
|
98
|
+
me.component.add(controlsPanel)
|
99
|
+
}
|
100
|
+
// Close popup windows when closing or reloading the main window
|
101
|
+
else if (appName === 'Neo.examples.component.multiWindowCoronaGallery') {console.log('close', me.connectedApps);
|
102
|
+
Neo.Main.windowClose({names: me.connectedApps, windowId})
|
103
|
+
}
|
104
|
+
}
|
105
|
+
/**
|
106
|
+
*
|
107
|
+
*/
|
108
|
+
onConstructed() {
|
109
|
+
super.onConstructed();
|
110
|
+
|
111
|
+
let me = this;
|
112
|
+
|
113
|
+
Neo.currentWorker.on({
|
114
|
+
connect : me.onAppConnect,
|
115
|
+
disconnect: me.onAppDisconnect,
|
116
|
+
scope : me
|
117
|
+
})
|
118
|
+
}
|
119
|
+
|
120
|
+
/**
|
121
|
+
* @param {Object} data
|
122
|
+
*/
|
123
|
+
async onMaximiseButtonClick(data) {
|
124
|
+
await this.createPopupWindow()
|
125
|
+
}
|
126
|
+
}
|
127
|
+
|
128
|
+
export default Neo.setupClass(ViewportController);
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import BaseViewport from '../../../../src/container/Viewport.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Neo.examples.component.multiWindowCoronaGallery.childapp.Viewport
|
5
|
+
* @extends Neo.container.Viewport
|
6
|
+
*/
|
7
|
+
class Viewport extends BaseViewport {
|
8
|
+
static config = {
|
9
|
+
/**
|
10
|
+
* @member {String} className='Neo.examples.component.multiWindowCoronaGallery.childapp.Viewport'
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
className: 'Neo.examples.component.multiWindowCoronaGallery.childapp.Viewport',
|
14
|
+
/**
|
15
|
+
* @member {Object} layout={ntype:'fit'}
|
16
|
+
*/
|
17
|
+
layout: {ntype: 'fit'}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
export default Neo.setupClass(Viewport);
|
@@ -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>Gallery Controls</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<script src="../../../../src/MicroLoader.mjs" type="module"></script>
|
10
|
+
</body>
|
11
|
+
</html>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
{
|
2
|
+
"appPath" : "examples/component/multiWindowCoronaGallery/childapp/app.mjs",
|
3
|
+
"basePath" : "../../../../",
|
4
|
+
"environment" : "development",
|
5
|
+
"mainPath" : "./Main.mjs",
|
6
|
+
"mainThreadAddons": ["Stylesheet"],
|
7
|
+
"themes" : ["neo-theme-dark"],
|
8
|
+
"useSharedWorkers": true
|
9
|
+
}
|
@@ -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 Multi-Window Corona Gallery</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<script src="../../../src/MicroLoader.mjs" type="module"></script>
|
10
|
+
</body>
|
11
|
+
</html>
|