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
@@ -1,377 +0,0 @@
|
|
1
|
-
import CountryGallery from './CountryGallery.mjs';
|
2
|
-
import Panel from '../../../src/container/Panel.mjs';
|
3
|
-
import RangeField from '../../../src/form/field/Range.mjs';
|
4
|
-
import Viewport from '../../../src/container/Viewport.mjs';
|
5
|
-
|
6
|
-
/**
|
7
|
-
* @class Neo.examples.component.coronaGallery.MainContainer
|
8
|
-
* @extends Neo.container.Viewport
|
9
|
-
*/
|
10
|
-
class MainContainer extends Viewport {
|
11
|
-
static config = {
|
12
|
-
/**
|
13
|
-
* @member {String} className='Neo.examples.component.coronaGallery.MainContainer'
|
14
|
-
* @protected
|
15
|
-
*/
|
16
|
-
className: 'Neo.examples.component.coronaGallery.MainContainer',
|
17
|
-
/**
|
18
|
-
* @member {String[]} baseCls=['neo-gallery-maincontainer','neo-viewport']
|
19
|
-
*/
|
20
|
-
baseCls: ['neo-gallery-maincontainer', 'neo-viewport'],
|
21
|
-
/**
|
22
|
-
* @member {Neo.component.Gallery|null} gallery=null
|
23
|
-
*/
|
24
|
-
gallery: null,
|
25
|
-
/**
|
26
|
-
* @member {Object|null} galleryConfig=null
|
27
|
-
*/
|
28
|
-
galleryConfig: null,
|
29
|
-
/**
|
30
|
-
* @member {Object|null} layout={ntype: 'hbox', align: 'stretch'}
|
31
|
-
*/
|
32
|
-
layout: {ntype: 'hbox', align: 'stretch'},
|
33
|
-
/**
|
34
|
-
* @member {Boolean} showGitHubStarButton=true
|
35
|
-
*/
|
36
|
-
showGitHubStarButton: true,
|
37
|
-
/**
|
38
|
-
* @member {Object[]} items
|
39
|
-
*/
|
40
|
-
items: [{
|
41
|
-
ntype : 'container',
|
42
|
-
flex : 1,
|
43
|
-
layout: 'fit',
|
44
|
-
style : {position: 'relative'},
|
45
|
-
|
46
|
-
items : [{
|
47
|
-
ntype: 'component',
|
48
|
-
html : 'DeltaUpdates / s: <span id="neo-delta-updates"></span>',
|
49
|
-
style: {
|
50
|
-
position: 'absolute',
|
51
|
-
right : '150px',
|
52
|
-
top : '25px',
|
53
|
-
width : '200px',
|
54
|
-
zIndex : 1
|
55
|
-
}
|
56
|
-
}, {
|
57
|
-
ntype: 'component',
|
58
|
-
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>',
|
59
|
-
style: {
|
60
|
-
position: 'absolute',
|
61
|
-
right : '20px',
|
62
|
-
top : '20px',
|
63
|
-
zIndex : 1
|
64
|
-
}
|
65
|
-
}]
|
66
|
-
}, {
|
67
|
-
ntype : 'panel',
|
68
|
-
cls : ['neo-controls-panel', 'neo-panel', 'neo-container'],
|
69
|
-
layout: {ntype: 'vbox', align: 'stretch'},
|
70
|
-
style : {backgroundColor: '#2b2b2b'},
|
71
|
-
width : 260,
|
72
|
-
|
73
|
-
containerConfig: {
|
74
|
-
style: {overflowY: 'scroll'}
|
75
|
-
},
|
76
|
-
|
77
|
-
headers: [{
|
78
|
-
dock: 'top',
|
79
|
-
items: [{
|
80
|
-
ntype: 'button',
|
81
|
-
text : 'X',
|
82
|
-
handler: function() {
|
83
|
-
const panel = this.up('panel'),
|
84
|
-
expand = panel.width === 40;
|
85
|
-
|
86
|
-
panel.width = expand ? 250 : 40;
|
87
|
-
this.text = expand ? 'X' : '+';
|
88
|
-
}
|
89
|
-
}, {
|
90
|
-
ntype: 'label',
|
91
|
-
text : 'Gallery Controls'
|
92
|
-
}]
|
93
|
-
}],
|
94
|
-
|
95
|
-
itemDefaults: {
|
96
|
-
ntype : 'rangefield',
|
97
|
-
flex : '0 1 auto',
|
98
|
-
labelWidth : '110px',
|
99
|
-
style : {padding: '10px'},
|
100
|
-
useInputEvent: true,
|
101
|
-
|
102
|
-
listeners: {
|
103
|
-
change: function(data) {
|
104
|
-
if (this.name === 'opacity') {
|
105
|
-
data.value /= 100;
|
106
|
-
}
|
107
|
-
Neo.get('neo-gallery-1')[this.name] = data.value;
|
108
|
-
}
|
109
|
-
}
|
110
|
-
},
|
111
|
-
|
112
|
-
items: [{
|
113
|
-
labelText: 'Translate X',
|
114
|
-
maxValue : 5000,
|
115
|
-
minValue : 0,
|
116
|
-
name : 'translateX',
|
117
|
-
value : 0,
|
118
|
-
listeners: {
|
119
|
-
change: function(data) {
|
120
|
-
Neo.get('neo-gallery-1')[this.name] = data.value;
|
121
|
-
},
|
122
|
-
mounted: function(fieldId) {
|
123
|
-
let field = Neo.get(fieldId);
|
124
|
-
|
125
|
-
Neo.get('neo-gallery-1').on('changeTranslateX', function(value) {
|
126
|
-
value = Math.min(Math.max(value, this.minValue), this.maxValue);
|
127
|
-
this.value = value;
|
128
|
-
}, field);
|
129
|
-
}
|
130
|
-
}
|
131
|
-
}, {
|
132
|
-
labelText: 'Translate Y',
|
133
|
-
maxValue : 1500,
|
134
|
-
minValue : -1500,
|
135
|
-
name : 'translateY',
|
136
|
-
value : 0
|
137
|
-
}, {
|
138
|
-
labelText: 'Translate Z',
|
139
|
-
maxValue : 550,
|
140
|
-
minValue : -4500,
|
141
|
-
name : 'translateZ',
|
142
|
-
value : 0,
|
143
|
-
listeners: {
|
144
|
-
change: function(data) {
|
145
|
-
Neo.get('neo-gallery-1')[this.name] = data.value;
|
146
|
-
},
|
147
|
-
mounted: function(fieldId) {
|
148
|
-
let field = Neo.get(fieldId);
|
149
|
-
|
150
|
-
Neo.get('neo-gallery-1').on('changeTranslateZ', function(value) {
|
151
|
-
value = Math.min(Math.max(value, this.minValue), this.maxValue);
|
152
|
-
this.value = value;
|
153
|
-
}, field);
|
154
|
-
}
|
155
|
-
}
|
156
|
-
}, {
|
157
|
-
labelText: 'Amount Rows',
|
158
|
-
maxValue : 15,
|
159
|
-
minValue : 1,
|
160
|
-
name : 'amountRows',
|
161
|
-
value : 3
|
162
|
-
}, {
|
163
|
-
ntype : 'button',
|
164
|
-
text : 'Order by Row',
|
165
|
-
listeners : {},
|
166
|
-
style : {margin: '20px'},
|
167
|
-
domListeners: {
|
168
|
-
click: function() {
|
169
|
-
const gallery = Neo.get('neo-gallery-1'),
|
170
|
-
orderByRow = !gallery.orderByRow;
|
171
|
-
|
172
|
-
this.text = orderByRow === true ? 'Order By Column' : 'Order by Row';
|
173
|
-
|
174
|
-
gallery.orderByRow = orderByRow;
|
175
|
-
}
|
176
|
-
}
|
177
|
-
}, {
|
178
|
-
ntype: 'label',
|
179
|
-
text : 'Sort By:'
|
180
|
-
}, {
|
181
|
-
ntype : 'container',
|
182
|
-
layout: {ntype: 'hbox', align: 'stretch'},
|
183
|
-
style : {minHeight: '134px', padding: '0'},
|
184
|
-
|
185
|
-
items : [{
|
186
|
-
ntype : 'container',
|
187
|
-
layout: {ntype: 'vbox', align: 'stretch'},
|
188
|
-
items : [{
|
189
|
-
ntype : 'button',
|
190
|
-
text : 'Cases',
|
191
|
-
listeners: {},
|
192
|
-
style : {margin: '10px', marginTop: '0'},
|
193
|
-
|
194
|
-
domListeners: {
|
195
|
-
click: function() {
|
196
|
-
Neo.get('neo-gallery-1').store.sorters = [{
|
197
|
-
property : 'cases',
|
198
|
-
direction: 'DESC'
|
199
|
-
}];
|
200
|
-
}
|
201
|
-
}
|
202
|
-
}, {
|
203
|
-
ntype : 'button',
|
204
|
-
text : 'Deaths',
|
205
|
-
listeners: {},
|
206
|
-
style : {margin: '10px', marginBottom: '10px', marginTop: 0},
|
207
|
-
|
208
|
-
domListeners: {
|
209
|
-
click: function() {
|
210
|
-
Neo.get('neo-gallery-1').store.sorters = [{
|
211
|
-
property : 'deaths',
|
212
|
-
direction: 'DESC'
|
213
|
-
}];
|
214
|
-
}
|
215
|
-
}
|
216
|
-
}, {
|
217
|
-
ntype : 'button',
|
218
|
-
text : 'Country',
|
219
|
-
listeners: {},
|
220
|
-
style : {margin: '10px', marginTop: 0},
|
221
|
-
|
222
|
-
domListeners: {
|
223
|
-
click: function() {
|
224
|
-
Neo.get('neo-gallery-1').store.sorters = [{
|
225
|
-
property : 'country',
|
226
|
-
direction: 'ASC'
|
227
|
-
}];
|
228
|
-
}
|
229
|
-
}
|
230
|
-
}, {
|
231
|
-
ntype : 'button',
|
232
|
-
text : 'Recovered',
|
233
|
-
listeners: {},
|
234
|
-
style : {margin: '10px', marginTop: 0},
|
235
|
-
|
236
|
-
domListeners: {
|
237
|
-
click: function() {
|
238
|
-
Neo.get('neo-gallery-1').store.sorters = [{
|
239
|
-
property : 'recovered',
|
240
|
-
direction: 'ASC'
|
241
|
-
}];
|
242
|
-
}
|
243
|
-
}
|
244
|
-
}]
|
245
|
-
}, {
|
246
|
-
ntype : 'container',
|
247
|
-
layout: {ntype: 'vbox', align: 'stretch'},
|
248
|
-
items : [{
|
249
|
-
ntype : 'button',
|
250
|
-
text : 'Cases today',
|
251
|
-
listeners: {},
|
252
|
-
style : {margin: '10px', marginTop: '0'},
|
253
|
-
|
254
|
-
domListeners: {
|
255
|
-
click: function() {
|
256
|
-
Neo.get('neo-gallery-1').store.sorters = [{
|
257
|
-
property : 'todayCases',
|
258
|
-
direction: 'DESC'
|
259
|
-
}];
|
260
|
-
}
|
261
|
-
}
|
262
|
-
}, {
|
263
|
-
ntype : 'button',
|
264
|
-
text : 'Deaths today',
|
265
|
-
listeners: {},
|
266
|
-
style : {margin: '10px', marginBottom: '10px', marginTop: 0},
|
267
|
-
|
268
|
-
domListeners: {
|
269
|
-
click: function() {
|
270
|
-
Neo.get('neo-gallery-1').store.sorters = [{
|
271
|
-
property : 'todayDeaths',
|
272
|
-
direction: 'DESC'
|
273
|
-
}];
|
274
|
-
}
|
275
|
-
}
|
276
|
-
}, {
|
277
|
-
ntype : 'button',
|
278
|
-
text : 'Critical',
|
279
|
-
listeners: {},
|
280
|
-
style: {margin: '10px', marginBottom: '43px', marginTop: 0},
|
281
|
-
|
282
|
-
domListeners: {
|
283
|
-
click: function() {
|
284
|
-
Neo.get('neo-gallery-1').store.sorters = [{
|
285
|
-
property : 'critical',
|
286
|
-
direction: 'DESC'
|
287
|
-
}];
|
288
|
-
}
|
289
|
-
}
|
290
|
-
}]
|
291
|
-
}]
|
292
|
-
}, {
|
293
|
-
ntype: 'label',
|
294
|
-
text : [
|
295
|
-
'<b>Navigation Concept</b>',
|
296
|
-
'<p>You can use the Arrow Keys to walk through the items.</p>'
|
297
|
-
].join(''),
|
298
|
-
|
299
|
-
style: {
|
300
|
-
backgroundColor: '#323232',
|
301
|
-
color : '#ddd',
|
302
|
-
fontSize : '13px',
|
303
|
-
margin : '10px',
|
304
|
-
padding : '10px',
|
305
|
-
whiteSpace : 'normal'
|
306
|
-
}
|
307
|
-
}, {
|
308
|
-
ntype: 'label',
|
309
|
-
cls : ['neo-link-color'],
|
310
|
-
text : [
|
311
|
-
'<b>Attribution</b>',
|
312
|
-
'<p>App created with <a href="https://github.com/neomjs/neo">neo.mjs</a>.</p>',
|
313
|
-
'<p>Data provided by <a href="https://github.com/disease-sh/API">disease-sh/API</a>.</p>',
|
314
|
-
'<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>'
|
315
|
-
].join(''),
|
316
|
-
|
317
|
-
style: {
|
318
|
-
backgroundColor: '#323232',
|
319
|
-
color : '#ddd',
|
320
|
-
fontSize : '13px',
|
321
|
-
margin : '10px',
|
322
|
-
padding : '10px',
|
323
|
-
whiteSpace : 'normal'
|
324
|
-
}
|
325
|
-
}]
|
326
|
-
}]
|
327
|
-
}
|
328
|
-
|
329
|
-
/**
|
330
|
-
* @param {Object} config
|
331
|
-
*/
|
332
|
-
construct(config) {
|
333
|
-
super.construct(config);
|
334
|
-
|
335
|
-
let me = this,
|
336
|
-
url = 'https://disease.sh/v3/covid-19/countries';
|
337
|
-
|
338
|
-
me.gallery = Neo.create({
|
339
|
-
module: CountryGallery,
|
340
|
-
id : 'neo-gallery-1',
|
341
|
-
...me.galleryConfig
|
342
|
-
});
|
343
|
-
|
344
|
-
me.items[0].items.unshift(me.gallery);
|
345
|
-
|
346
|
-
fetch(url)
|
347
|
-
.then(response => response.json())
|
348
|
-
.catch(err => console.log('Can’t access ' + url, err))
|
349
|
-
.then(data => me.addStoreItems(data));
|
350
|
-
|
351
|
-
if (me.showGitHubStarButton) {
|
352
|
-
me.on('mounted', () => {
|
353
|
-
Neo.main.DomAccess.addScript({
|
354
|
-
async: true,
|
355
|
-
defer: true,
|
356
|
-
src : 'https://buttons.github.io/buttons.js'
|
357
|
-
})
|
358
|
-
})
|
359
|
-
}
|
360
|
-
}
|
361
|
-
|
362
|
-
/**
|
363
|
-
* @param {Object[]} data
|
364
|
-
*/
|
365
|
-
addStoreItems(data) {
|
366
|
-
this.getStore().data = data
|
367
|
-
}
|
368
|
-
|
369
|
-
/**
|
370
|
-
* @returns {Neo.data.Store}
|
371
|
-
*/
|
372
|
-
getStore() {
|
373
|
-
return this.items[0].items[0].store
|
374
|
-
}
|
375
|
-
}
|
376
|
-
|
377
|
-
export default Neo.setupClass(MainContainer);
|