neo.mjs 3.2.2 → 3.2.5
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/apps/covid/view/country/Gallery.mjs +11 -11
- package/apps/realworld2/view/article/Gallery.mjs +8 -8
- package/apps/sharedcovid/view/country/Gallery.mjs +11 -11
- package/buildScripts/webpack/development/webpack.config.appworker.mjs +4 -4
- package/buildScripts/webpack/development/webpack.config.myapps.mjs +4 -4
- package/buildScripts/webpack/production/webpack.config.appworker.mjs +3 -3
- package/buildScripts/webpack/production/webpack.config.myapps.mjs +3 -3
- package/examples/ConfigurationViewport.mjs +1 -1
- package/examples/component/coronaGallery/CountryGallery.mjs +12 -12
- package/examples/component/coronaGallery/CountryModel.mjs +8 -2
- package/examples/component/coronaGallery/CountryStore.mjs +12 -2
- package/examples/component/coronaGallery/MainContainer.mjs +3 -6
- package/examples/component/gallery/ImageModel.mjs +38 -0
- package/examples/component/gallery/ImageStore.mjs +32 -0
- package/examples/component/gallery/MainContainer.mjs +2 -0
- package/examples/component/helix/ImageModel.mjs +38 -0
- package/examples/component/helix/ImageStore.mjs +32 -0
- package/examples/component/helix/MainContainer.mjs +2 -0
- package/examples/list/animate/List.mjs +11 -1
- package/examples/list/animate/MainStore.mjs +4 -5
- package/examples/list/circle/MainContainer.mjs +142 -0
- package/examples/list/circle/MainModel.mjs +33 -0
- package/examples/list/circle/MainStore.mjs +42 -0
- package/examples/list/circle/app.mjs +7 -0
- package/examples/list/circle/index.html +11 -0
- package/examples/list/circle/neo-config.json +7 -0
- package/package.json +3 -3
- package/resources/examples/data/{circleContacts.json → circles/group1.json} +0 -0
- package/resources/examples/data/circles/group2.json +18 -0
- package/resources/examples/data/circles/group3.json +20 -0
- package/resources/examples/data/circles/group4.json +28 -0
- package/resources/scss/src/apps/covid/country/Gallery.scss +2 -1
- package/resources/scss/src/component/Gallery.scss +2 -1
- package/resources/scss/src/component/Helix.scss +7 -1
- package/resources/scss/src/examples/component/coronaGallery/CountryGallery.scss +2 -1
- package/resources/scss/src/list/Circle.scss +25 -0
- package/src/calendar/view/MainContainer.mjs +1 -1
- package/src/calendar/view/calendars/List.mjs +2 -2
- package/src/calendar/view/month/Component.mjs +8 -21
- package/src/component/Circle.mjs +51 -30
- package/src/component/Gallery.mjs +86 -115
- package/src/component/Helix.mjs +26 -40
- package/src/core/Base.mjs +1 -1
- package/src/data/Store.mjs +2 -2
- package/src/list/Base.mjs +51 -14
- package/src/list/Chip.mjs +2 -3
- package/src/list/Circle.mjs +87 -0
- package/src/list/Component.mjs +37 -6
- package/src/list/plugin/Animate.mjs +79 -37
- package/src/selection/CircleModel.mjs +3 -3
- package/src/selection/ListModel.mjs +2 -2
- package/src/worker/App.mjs +14 -18
|
@@ -28,15 +28,10 @@ class CountryGallery extends Gallery {
|
|
|
28
28
|
*/
|
|
29
29
|
country_: null,
|
|
30
30
|
/**
|
|
31
|
-
* The
|
|
32
|
-
* @member {Number}
|
|
31
|
+
* The item height of the gallery
|
|
32
|
+
* @member {Number} itemHeight=240
|
|
33
33
|
*/
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The image width of the gallery
|
|
37
|
-
* @member {Number} imageWidth=320
|
|
38
|
-
*/
|
|
39
|
-
imageWidth: 340,
|
|
34
|
+
itemHeight: 280,
|
|
40
35
|
/**
|
|
41
36
|
* @member {Object} itemTpl_
|
|
42
37
|
*/
|
|
@@ -74,6 +69,11 @@ class CountryGallery extends Gallery {
|
|
|
74
69
|
]}
|
|
75
70
|
]}
|
|
76
71
|
]},
|
|
72
|
+
/**
|
|
73
|
+
* The item width of the gallery
|
|
74
|
+
* @member {Number} itemWidth=320
|
|
75
|
+
*/
|
|
76
|
+
itemWidth: 340,
|
|
77
77
|
/**
|
|
78
78
|
* The unique record field containing the id.
|
|
79
79
|
* @member {String} keyProperty='id'
|
|
@@ -121,10 +121,10 @@ class CountryGallery extends Gallery {
|
|
|
121
121
|
|
|
122
122
|
vdomItem.id = me.getItemVnodeId(record[me.keyProperty]);
|
|
123
123
|
|
|
124
|
-
vdomItem.cn[0].style.height = me.
|
|
124
|
+
vdomItem.cn[0].style.height = me.itemHeight + 'px';
|
|
125
125
|
|
|
126
|
-
firstChild.style.height = (me.
|
|
127
|
-
firstChild.style.width = me.
|
|
126
|
+
firstChild.style.height = (me.itemHeight - 70) + 'px';
|
|
127
|
+
firstChild.style.width = me.itemWidth + 'px';
|
|
128
128
|
|
|
129
129
|
firstChild.cn[0].cn[0].src = Util.getCountryFlagUrl(record.country);
|
|
130
130
|
firstChild.cn[0].cn[1].html = record.country;
|
|
@@ -17,15 +17,15 @@ class Gallery extends BaseGallery {
|
|
|
17
17
|
*/
|
|
18
18
|
cls: ['rw2-article-gallery', 'neo-gallery', 'page', 'view'],
|
|
19
19
|
/**
|
|
20
|
-
* The
|
|
21
|
-
* @member {Number}
|
|
20
|
+
* The item height of the gallery
|
|
21
|
+
* @member {Number} itemHeight=240
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
itemHeight: 240,
|
|
24
24
|
/**
|
|
25
|
-
* The
|
|
26
|
-
* @member {Number}
|
|
25
|
+
* The item width of the gallery
|
|
26
|
+
* @member {Number} itemWidth=320
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
itemWidth: 320,
|
|
29
29
|
/**
|
|
30
30
|
* Array containing the PreviewComponent references
|
|
31
31
|
* @member {Array} items=[]
|
|
@@ -69,8 +69,8 @@ class Gallery extends BaseGallery {
|
|
|
69
69
|
id : me.getItemVnodeId(record[me.keyProperty]),
|
|
70
70
|
tabIndex: '-1',
|
|
71
71
|
style: {
|
|
72
|
-
height: me.
|
|
73
|
-
width : me.
|
|
72
|
+
height: me.itemHeight + 'px',
|
|
73
|
+
width : me.itemWidth + 'px'
|
|
74
74
|
},
|
|
75
75
|
cn: [{
|
|
76
76
|
cls: ['item-wrapper'],
|
|
@@ -28,15 +28,10 @@ class CountryGallery extends Gallery {
|
|
|
28
28
|
*/
|
|
29
29
|
country_: null,
|
|
30
30
|
/**
|
|
31
|
-
* The
|
|
32
|
-
* @member {Number}
|
|
31
|
+
* The item height of the gallery
|
|
32
|
+
* @member {Number} itemHeight=240
|
|
33
33
|
*/
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The image width of the gallery
|
|
37
|
-
* @member {Number} imageWidth=320
|
|
38
|
-
*/
|
|
39
|
-
imageWidth: 340,
|
|
34
|
+
itemHeight: 280,
|
|
40
35
|
/**
|
|
41
36
|
* @member {Object} itemTpl_
|
|
42
37
|
*/
|
|
@@ -94,6 +89,11 @@ class CountryGallery extends Gallery {
|
|
|
94
89
|
}]
|
|
95
90
|
}]
|
|
96
91
|
},
|
|
92
|
+
/**
|
|
93
|
+
* The item width of the gallery
|
|
94
|
+
* @member {Number} itemWidth=320
|
|
95
|
+
*/
|
|
96
|
+
itemWidth: 340,
|
|
97
97
|
/**
|
|
98
98
|
* The unique record field containing the id.
|
|
99
99
|
* @member {String} keyProperty='id'
|
|
@@ -141,10 +141,10 @@ class CountryGallery extends Gallery {
|
|
|
141
141
|
|
|
142
142
|
vdomItem.id = me.getItemVnodeId(record[me.keyProperty]);
|
|
143
143
|
|
|
144
|
-
vdomItem.cn[0].style.height = me.
|
|
144
|
+
vdomItem.cn[0].style.height = me.itemHeight + 'px';
|
|
145
145
|
|
|
146
|
-
firstChild.style.height = (me.
|
|
147
|
-
firstChild.style.width = me.
|
|
146
|
+
firstChild.style.height = (me.itemHeight - 70) + 'px';
|
|
147
|
+
firstChild.style.width = me.itemWidth + 'px';
|
|
148
148
|
|
|
149
149
|
firstChild.cn[0].cn[0].src = Util.getCountryFlagUrl(record.country);
|
|
150
150
|
firstChild.cn[0].cn[1].html = record.country;
|
|
@@ -70,10 +70,10 @@ export default env => {
|
|
|
70
70
|
content.appPath = content.appPath.replace(regexTopLevel, '');
|
|
71
71
|
|
|
72
72
|
Object.assign(content, {
|
|
73
|
-
basePath
|
|
74
|
-
environment
|
|
75
|
-
mainPath
|
|
76
|
-
workerBasePath
|
|
73
|
+
basePath,
|
|
74
|
+
environment: 'dist/development',
|
|
75
|
+
mainPath : '../main.js',
|
|
76
|
+
workerBasePath
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
fs.writeFileSync(outputPath, JSON.stringify(content, null, 4));
|
|
@@ -80,10 +80,10 @@ export default env => {
|
|
|
80
80
|
content.appPath = content.appPath.replace(regexTopLevel, '');
|
|
81
81
|
|
|
82
82
|
Object.assign(content, {
|
|
83
|
-
basePath
|
|
84
|
-
environment
|
|
85
|
-
mainPath
|
|
86
|
-
workerBasePath
|
|
83
|
+
basePath,
|
|
84
|
+
environment: 'dist/development',
|
|
85
|
+
mainPath : '../main.js',
|
|
86
|
+
workerBasePath
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
fs.writeFileSync(outputPath, JSON.stringify(content, null, 4));
|
|
@@ -75,9 +75,9 @@ export default env => {
|
|
|
75
75
|
content.appPath = content.appPath.replace(regexTopLevel, '');
|
|
76
76
|
|
|
77
77
|
Object.assign(content, {
|
|
78
|
-
basePath
|
|
79
|
-
mainPath
|
|
80
|
-
workerBasePath
|
|
78
|
+
basePath,
|
|
79
|
+
mainPath: '../main.js',
|
|
80
|
+
workerBasePath
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
fs.writeFileSync(outputPath, JSON.stringify(content));
|
|
@@ -86,9 +86,9 @@ export default env => {
|
|
|
86
86
|
content.appPath = content.appPath.replace(regexTopLevel, '');
|
|
87
87
|
|
|
88
88
|
Object.assign(content, {
|
|
89
|
-
basePath
|
|
90
|
-
mainPath
|
|
91
|
-
workerBasePath
|
|
89
|
+
basePath,
|
|
90
|
+
mainPath: '../main.js',
|
|
91
|
+
workerBasePath
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
fs.writeFileSync(outputPath, JSON.stringify(content));
|
|
@@ -129,7 +129,7 @@ class ConfigurationViewport extends Viewport {
|
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* Override this method to create the components to show inside the configuration container
|
|
132
|
-
* @returns {
|
|
132
|
+
* @returns {Object[]|null}
|
|
133
133
|
*/
|
|
134
134
|
createConfigurationComponents() {
|
|
135
135
|
return null;
|
|
@@ -27,15 +27,10 @@ class CountryGallery extends Gallery {
|
|
|
27
27
|
*/
|
|
28
28
|
cls: ['neo-country-gallery', 'neo-gallery', 'page', 'view'],
|
|
29
29
|
/**
|
|
30
|
-
* The
|
|
31
|
-
* @member {Number}
|
|
30
|
+
* The item height of the gallery
|
|
31
|
+
* @member {Number} itemHeight=240
|
|
32
32
|
*/
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* The image width of the gallery
|
|
36
|
-
* @member {Number} imageWidth=320
|
|
37
|
-
*/
|
|
38
|
-
imageWidth: 340,
|
|
33
|
+
itemHeight: 280,
|
|
39
34
|
/**
|
|
40
35
|
* @member {Object} itemTpl_
|
|
41
36
|
*/
|
|
@@ -73,6 +68,11 @@ class CountryGallery extends Gallery {
|
|
|
73
68
|
]}
|
|
74
69
|
]}
|
|
75
70
|
]},
|
|
71
|
+
/**
|
|
72
|
+
* The item width of the gallery
|
|
73
|
+
* @member {Number} itemWidth=320
|
|
74
|
+
*/
|
|
75
|
+
itemWidth: 340,
|
|
76
76
|
/**
|
|
77
77
|
* The unique record field containing the id.
|
|
78
78
|
* @member {String} keyProperty='id'
|
|
@@ -103,10 +103,10 @@ class CountryGallery extends Gallery {
|
|
|
103
103
|
|
|
104
104
|
vdomItem.id = me.getItemVnodeId(record[me.keyProperty]);
|
|
105
105
|
|
|
106
|
-
vdomItem.cn[0].style.height = me.
|
|
106
|
+
vdomItem.cn[0].style.height = me.itemHeight + 'px';
|
|
107
107
|
|
|
108
|
-
firstChild.style.height = (me.
|
|
109
|
-
firstChild.style.width = me.
|
|
108
|
+
firstChild.style.height = (me.itemHeight - 70) + 'px';
|
|
109
|
+
firstChild.style.width = me.itemWidth + 'px';
|
|
110
110
|
|
|
111
111
|
firstChild.cn[0].cn[0].src = me.getCountryFlagUrl(record.country);
|
|
112
112
|
firstChild.cn[0].cn[1].html = record.country;
|
|
@@ -184,7 +184,7 @@ class CountryGallery extends Gallery {
|
|
|
184
184
|
|
|
185
185
|
imageName = map[imageName] || imageName;
|
|
186
186
|
|
|
187
|
-
return
|
|
187
|
+
return `https://raw.githubusercontent.com/neomjs/pages/master/resources/images/flaticon/country_flags/png/${imageName}.png`;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Model
|
|
1
|
+
import Model from '../../../src/data/Model.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @class Neo.examples.component.coronaGallery.CountryModel
|
|
@@ -6,8 +6,14 @@ import Model from '../../../src/data/Model.mjs';
|
|
|
6
6
|
*/
|
|
7
7
|
class CountryModel extends Model {
|
|
8
8
|
static getConfig() {return {
|
|
9
|
+
/**
|
|
10
|
+
* @member {String} className='Neo.examples.component.coronaGallery.CountryModel'
|
|
11
|
+
* @protected
|
|
12
|
+
*/
|
|
9
13
|
className: 'Neo.examples.component.coronaGallery.CountryModel',
|
|
10
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @member {Object[]} fields
|
|
16
|
+
*/
|
|
11
17
|
fields: [{
|
|
12
18
|
name: 'cases',
|
|
13
19
|
type: 'int'
|
|
@@ -7,9 +7,19 @@ import Store from '../../../src/data/Store.mjs';
|
|
|
7
7
|
*/
|
|
8
8
|
class CountryStore extends Store {
|
|
9
9
|
static getConfig() {return {
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @member {String} className='Neo.examples.component.coronaGallery.CountryStore'
|
|
12
|
+
* @protected
|
|
13
|
+
*/
|
|
14
|
+
className: 'Neo.examples.component.coronaGallery.CountryStore',
|
|
15
|
+
/**
|
|
16
|
+
* @member {String} keyProperty='country'
|
|
17
|
+
*/
|
|
11
18
|
keyProperty: 'country',
|
|
12
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @member {Neo.data.Model} model=CountryModel
|
|
21
|
+
*/
|
|
22
|
+
model: CountryModel
|
|
13
23
|
}}
|
|
14
24
|
}
|
|
15
25
|
|
|
@@ -363,14 +363,11 @@ class MainContainer extends Viewport {
|
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
+
/**
|
|
367
|
+
* @param {Object[]} data
|
|
368
|
+
*/
|
|
366
369
|
addStoreItems(data) {
|
|
367
370
|
this.getStore().data = data;
|
|
368
|
-
|
|
369
|
-
setTimeout(() => {
|
|
370
|
-
Neo.main.DomAccess.focus({
|
|
371
|
-
id: this.gallery.id
|
|
372
|
-
});
|
|
373
|
-
}, 200);
|
|
374
371
|
}
|
|
375
372
|
|
|
376
373
|
/**
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Model from '../../../src/data/Model.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @class Neo.examples.component.gallery.ImageModel
|
|
5
|
+
* @extends Neo.data.Model
|
|
6
|
+
*/
|
|
7
|
+
class ImageModel extends Model {
|
|
8
|
+
static getConfig() {return {
|
|
9
|
+
/**
|
|
10
|
+
* @member {String} className='Neo.examples.component.gallery.ImageModel'
|
|
11
|
+
* @protected
|
|
12
|
+
*/
|
|
13
|
+
className: 'Neo.examples.component.gallery.ImageModel',
|
|
14
|
+
/**
|
|
15
|
+
* @member {Object[]} fields
|
|
16
|
+
*/
|
|
17
|
+
fields: [{
|
|
18
|
+
name: 'firstname',
|
|
19
|
+
type: 'String'
|
|
20
|
+
}, {
|
|
21
|
+
name: 'id',
|
|
22
|
+
type: 'Integer'
|
|
23
|
+
}, {
|
|
24
|
+
name: 'image',
|
|
25
|
+
type: 'String'
|
|
26
|
+
}, {
|
|
27
|
+
name: 'isOnline',
|
|
28
|
+
type: 'Boolean'
|
|
29
|
+
}, {
|
|
30
|
+
name: 'lastname',
|
|
31
|
+
type: 'String'
|
|
32
|
+
}]
|
|
33
|
+
}}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Neo.applyClassConfig(ImageModel);
|
|
37
|
+
|
|
38
|
+
export default ImageModel;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import ImageModel from './ImageModel.mjs';
|
|
2
|
+
import Store from '../../../src/data/Store.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @class Neo.examples.component.gallery.ImageStore
|
|
6
|
+
* @extends Neo.data.Store
|
|
7
|
+
*/
|
|
8
|
+
class ImageStore extends Store {
|
|
9
|
+
static getConfig() {return {
|
|
10
|
+
/**
|
|
11
|
+
* @member {String} className='Neo.examples.component.gallery.ImageModel'
|
|
12
|
+
* @protected
|
|
13
|
+
*/
|
|
14
|
+
className: 'Neo.examples.component.gallery.ImageStore',
|
|
15
|
+
/**
|
|
16
|
+
* @member {Boolean} autoLoad=true
|
|
17
|
+
*/
|
|
18
|
+
autoLoad: true,
|
|
19
|
+
/**
|
|
20
|
+
* @member {Neo.data.Model} model=ImageModel
|
|
21
|
+
*/
|
|
22
|
+
model: ImageModel,
|
|
23
|
+
/**
|
|
24
|
+
* @member {String} url='../../resources/examples/data/ai_contacts.json'
|
|
25
|
+
*/
|
|
26
|
+
url: '../../resources/examples/data/ai_contacts.json'
|
|
27
|
+
}}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Neo.applyClassConfig(ImageStore);
|
|
31
|
+
|
|
32
|
+
export default ImageStore;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Gallery from '../../../src/component/Gallery.mjs';
|
|
2
|
+
import ImageStore from './ImageStore.mjs';
|
|
2
3
|
import NumberField from '../../../src/form/field/Number.mjs';
|
|
3
4
|
import Panel from '../../../src/container/Panel.mjs';
|
|
4
5
|
import RangeField from '../../../src/form/field/Range.mjs';
|
|
@@ -228,6 +229,7 @@ class MainContainer extends Viewport {
|
|
|
228
229
|
me.gallery = Neo.create({
|
|
229
230
|
module: Gallery,
|
|
230
231
|
id : 'neo-gallery-1',
|
|
232
|
+
store : ImageStore,
|
|
231
233
|
...me.galleryConfig
|
|
232
234
|
});
|
|
233
235
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Model from '../../../src/data/Model.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @class Neo.examples.component.helix.ImageModel
|
|
5
|
+
* @extends Neo.data.Model
|
|
6
|
+
*/
|
|
7
|
+
class ImageModel extends Model {
|
|
8
|
+
static getConfig() {return {
|
|
9
|
+
/**
|
|
10
|
+
* @member {String} className='Neo.examples.component.helix.ImageModel'
|
|
11
|
+
* @protected
|
|
12
|
+
*/
|
|
13
|
+
className: 'Neo.examples.component.helix.ImageModel',
|
|
14
|
+
/**
|
|
15
|
+
* @member {Object[]} fields
|
|
16
|
+
*/
|
|
17
|
+
fields: [{
|
|
18
|
+
name: 'firstname',
|
|
19
|
+
type: 'String'
|
|
20
|
+
}, {
|
|
21
|
+
name: 'id',
|
|
22
|
+
type: 'Integer'
|
|
23
|
+
}, {
|
|
24
|
+
name: 'image',
|
|
25
|
+
type: 'String'
|
|
26
|
+
}, {
|
|
27
|
+
name: 'isOnline',
|
|
28
|
+
type: 'Boolean'
|
|
29
|
+
}, {
|
|
30
|
+
name: 'lastname',
|
|
31
|
+
type: 'String'
|
|
32
|
+
}]
|
|
33
|
+
}}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Neo.applyClassConfig(ImageModel);
|
|
37
|
+
|
|
38
|
+
export default ImageModel;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import ImageModel from './ImageModel.mjs';
|
|
2
|
+
import Store from '../../../src/data/Store.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @class Neo.examples.component.helix.ImageStore
|
|
6
|
+
* @extends Neo.data.Store
|
|
7
|
+
*/
|
|
8
|
+
class ImageStore extends Store {
|
|
9
|
+
static getConfig() {return {
|
|
10
|
+
/**
|
|
11
|
+
* @member {String} className='Neo.examples.component.helix.ImageModel'
|
|
12
|
+
* @protected
|
|
13
|
+
*/
|
|
14
|
+
className: 'Neo.examples.component.helix.ImageStore',
|
|
15
|
+
/**
|
|
16
|
+
* @member {Boolean} autoLoad=true
|
|
17
|
+
*/
|
|
18
|
+
autoLoad: true,
|
|
19
|
+
/**
|
|
20
|
+
* @member {Neo.data.Model} model=ImageModel
|
|
21
|
+
*/
|
|
22
|
+
model: ImageModel,
|
|
23
|
+
/**
|
|
24
|
+
* @member {String} url='../../resources/examples/data/ai_contacts.json'
|
|
25
|
+
*/
|
|
26
|
+
url: '../../resources/examples/data/ai_contacts.json'
|
|
27
|
+
}}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
Neo.applyClassConfig(ImageStore);
|
|
31
|
+
|
|
32
|
+
export default ImageStore;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import CheckBox from '../../../src/form/field/CheckBox.mjs';
|
|
2
2
|
import Helix from '../../../src/component/Helix.mjs';
|
|
3
|
+
import ImageStore from './ImageStore.mjs';
|
|
3
4
|
import NumberField from '../../../src/form/field/Number.mjs';
|
|
4
5
|
import Panel from '../../../src/container/Panel.mjs';
|
|
5
6
|
import RangeField from '../../../src/form/field/Range.mjs';
|
|
@@ -312,6 +313,7 @@ class MainContainer extends Viewport {
|
|
|
312
313
|
me.helix = Neo.create({
|
|
313
314
|
module: Helix,
|
|
314
315
|
id : 'neo-helix-1',
|
|
316
|
+
store : ImageStore,
|
|
315
317
|
...me.helixConfig
|
|
316
318
|
});
|
|
317
319
|
|
|
@@ -19,10 +19,20 @@ class List extends BaseList {
|
|
|
19
19
|
* @member {String[]} cls=['neo-examples-list-animate','neo-list-container','neo-list']
|
|
20
20
|
*/
|
|
21
21
|
cls: ['neo-examples-list-animate', 'neo-list-container', 'neo-list'],
|
|
22
|
+
/**
|
|
23
|
+
* Value in px
|
|
24
|
+
* @member {Number} itemHeight=200
|
|
25
|
+
*/
|
|
26
|
+
itemHeight: 200,
|
|
22
27
|
/**
|
|
23
28
|
* @member {String} itemTagName='div'
|
|
24
29
|
*/
|
|
25
|
-
itemTagName: 'div'
|
|
30
|
+
itemTagName: 'div',
|
|
31
|
+
/**
|
|
32
|
+
* Value in px
|
|
33
|
+
* @member {Number} itemWidth=300
|
|
34
|
+
*/
|
|
35
|
+
itemWidth: 300
|
|
26
36
|
}}
|
|
27
37
|
|
|
28
38
|
/**
|
|
@@ -7,11 +7,10 @@ import Store from '../../../src/data/Store.mjs';
|
|
|
7
7
|
*/
|
|
8
8
|
class MainStore extends Store {
|
|
9
9
|
static getConfig() {return {
|
|
10
|
-
className
|
|
11
|
-
autoLoad
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
url : '../../resources/examples/data/circleContacts.json',
|
|
10
|
+
className: 'Neo.examples.list.animate.MainStore',
|
|
11
|
+
autoLoad : true,
|
|
12
|
+
model : MainModel,
|
|
13
|
+
url : '../../resources/examples/data/circles/group1.json',
|
|
15
14
|
|
|
16
15
|
filters: [{
|
|
17
16
|
disabled : true,
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import CheckBox from '../../../src/form/field/CheckBox.mjs';
|
|
2
|
+
import CircleList from '../../../src/list/Circle.mjs';
|
|
3
|
+
import ConfigurationViewport from '../../ConfigurationViewport.mjs';
|
|
4
|
+
import MainStore from './MainStore.mjs';
|
|
5
|
+
import NumberField from '../../../src/form/field/Number.mjs';
|
|
6
|
+
import Radio from '../../../src/form/field/Radio.mjs';
|
|
7
|
+
import TextField from '../../../src/form/field/Text.mjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @class Neo.examples.list.circle.MainContainer
|
|
11
|
+
* @extends Neo.examples.ConfigurationViewport
|
|
12
|
+
*/
|
|
13
|
+
class MainContainer extends ConfigurationViewport {
|
|
14
|
+
static getConfig() {return {
|
|
15
|
+
className : 'Neo.examples.list.circle.MainContainer',
|
|
16
|
+
autoMount : true,
|
|
17
|
+
configItemLabelWidth: 130,
|
|
18
|
+
configItemWidth : 230,
|
|
19
|
+
layout : {ntype: 'hbox', align: 'stretch'}
|
|
20
|
+
}}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @returns {Object[]}
|
|
24
|
+
*/
|
|
25
|
+
createConfigurationComponents() {
|
|
26
|
+
let me = this,
|
|
27
|
+
sorter = me.exampleComponent.store.sorters[0];
|
|
28
|
+
|
|
29
|
+
return [{
|
|
30
|
+
module : CheckBox,
|
|
31
|
+
checked : me.exampleComponent.disableSelection,
|
|
32
|
+
labelText: 'disableSelection',
|
|
33
|
+
listeners: {change: me.onConfigChange.bind(me, 'disableSelection')}
|
|
34
|
+
}, {
|
|
35
|
+
module : NumberField,
|
|
36
|
+
clearable: true,
|
|
37
|
+
labelText: 'height',
|
|
38
|
+
listeners: {change: me.onConfigChange.bind(me, 'height')},
|
|
39
|
+
maxValue : 1000,
|
|
40
|
+
minValue : 300,
|
|
41
|
+
stepSize : 5,
|
|
42
|
+
value : me.exampleComponent.height,
|
|
43
|
+
style : {marginTop: '10px'}
|
|
44
|
+
}, {
|
|
45
|
+
module : Radio,
|
|
46
|
+
checked : sorter.direction === 'ASC',
|
|
47
|
+
hideValueLabel: false,
|
|
48
|
+
labelText : 'Sort',
|
|
49
|
+
listeners : {change: me.changeSorting.bind(me, 'ASC')},
|
|
50
|
+
name : 'sort',
|
|
51
|
+
style : {marginTop: '10px'},
|
|
52
|
+
valueLabelText: 'ASC'
|
|
53
|
+
}, {
|
|
54
|
+
module : Radio,
|
|
55
|
+
checked : sorter.direction === 'DESC',
|
|
56
|
+
hideValueLabel: false,
|
|
57
|
+
labelText : '',
|
|
58
|
+
listeners : {change: me.changeSorting.bind(me, 'DESC')},
|
|
59
|
+
name : 'sort',
|
|
60
|
+
style : {marginTop: '5px'},
|
|
61
|
+
valueLabelText: 'DESC'
|
|
62
|
+
}, {
|
|
63
|
+
module : NumberField,
|
|
64
|
+
clearable: true,
|
|
65
|
+
labelText: 'width',
|
|
66
|
+
listeners: {change: me.onConfigChange.bind(me, 'width')},
|
|
67
|
+
maxValue : 1000,
|
|
68
|
+
minValue : 300,
|
|
69
|
+
stepSize : 5,
|
|
70
|
+
style : {marginTop: '10px'},
|
|
71
|
+
value : me.exampleComponent.width
|
|
72
|
+
}, {
|
|
73
|
+
module : TextField,
|
|
74
|
+
flex : 'none',
|
|
75
|
+
labelText: 'Group1 Name',
|
|
76
|
+
listeners: {change: me.onGroupNameChange.bind(me, 0)},
|
|
77
|
+
name : 'group1',
|
|
78
|
+
style : {marginTop: '10px'},
|
|
79
|
+
value : me.exampleComponent.store.getAt(0).name
|
|
80
|
+
}, {
|
|
81
|
+
module : TextField,
|
|
82
|
+
flex : 'none',
|
|
83
|
+
labelText: 'Group2 Name',
|
|
84
|
+
listeners: {change: me.onGroupNameChange.bind(me, 1)},
|
|
85
|
+
name : 'group2',
|
|
86
|
+
style : {marginTop: '10px'},
|
|
87
|
+
value : me.exampleComponent.store.getAt(1).name
|
|
88
|
+
}];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @param {String} direction
|
|
93
|
+
* @param {Object} data
|
|
94
|
+
*/
|
|
95
|
+
changeSorting(direction, data) {
|
|
96
|
+
if (data.value) {
|
|
97
|
+
this.exampleComponent.store.sorters[0].direction = direction;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @returns {Neo.component.Base}
|
|
103
|
+
*/
|
|
104
|
+
createExampleComponent() {
|
|
105
|
+
let list = Neo.create({
|
|
106
|
+
module : CircleList,
|
|
107
|
+
animate: true,
|
|
108
|
+
height : 1000,
|
|
109
|
+
store : MainStore,
|
|
110
|
+
width : 1000
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
list.store.on('sort', this.onStoreSort, this);
|
|
114
|
+
|
|
115
|
+
return list;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @param {Number} index
|
|
120
|
+
* @param {Object} data
|
|
121
|
+
*/
|
|
122
|
+
onGroupNameChange(index, data) {
|
|
123
|
+
this.exampleComponent.items[index].title = data.value;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @param {Object} data
|
|
128
|
+
*/
|
|
129
|
+
onStoreSort(data) {
|
|
130
|
+
setTimeout(() => {
|
|
131
|
+
let me = this,
|
|
132
|
+
items = me.exampleComponent.items;
|
|
133
|
+
|
|
134
|
+
me.down({name: 'group1'}).value = items[0].title;
|
|
135
|
+
me.down({name: 'group2'}).value = items[1].title;
|
|
136
|
+
}, 10);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
Neo.applyClassConfig(MainContainer);
|
|
141
|
+
|
|
142
|
+
export default MainContainer;
|