neo.mjs 3.2.4 → 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/examples/component/helix/ImageModel.mjs +38 -0
- package/examples/component/helix/ImageStore.mjs +32 -0
- package/examples/component/helix/MainContainer.mjs +2 -0
- package/package.json +1 -1
- package/resources/scss/src/component/Helix.scss +7 -1
- package/src/calendar/view/MainContainer.mjs +1 -1
- package/src/calendar/view/month/Component.mjs +8 -21
- package/src/component/Gallery.mjs +3 -7
- package/src/component/Helix.mjs +26 -40
- package/src/worker/App.mjs +14 -18
|
@@ -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
|
|
package/package.json
CHANGED
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
outline: 0;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
&.neo-follow-selection {
|
|
20
|
+
.neo-helix-item {
|
|
21
|
+
transition: all 0.1s linear;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
&.neo-transition-100 {
|
|
20
26
|
.neo-helix-item {
|
|
21
27
|
transition: all 0.1s ease-in-out !important;
|
|
@@ -87,4 +93,4 @@
|
|
|
87
93
|
right : 0;
|
|
88
94
|
text-shadow : 0 0 10px #61DFE5;
|
|
89
95
|
}
|
|
90
|
-
}
|
|
96
|
+
}
|
|
@@ -500,7 +500,7 @@ class MainContainer extends Container {
|
|
|
500
500
|
return import('./SettingsContainer.mjs').then(module => {
|
|
501
501
|
me.items[1].add({
|
|
502
502
|
module : module.default,
|
|
503
|
-
collapsed
|
|
503
|
+
collapsed,
|
|
504
504
|
removeInactiveCards: me.removeInactiveCards,
|
|
505
505
|
style : {marginRight: !collapsed ? '0' : `-${me.settingsContainerWidth}px`},
|
|
506
506
|
width : me.settingsContainerWidth,
|
|
@@ -554,10 +554,7 @@ class Component extends BaseComponent {
|
|
|
554
554
|
date.setDate(date.getDate() + 1);
|
|
555
555
|
}
|
|
556
556
|
|
|
557
|
-
return {
|
|
558
|
-
header: header,
|
|
559
|
-
row : row
|
|
560
|
-
}
|
|
557
|
+
return {header, row}
|
|
561
558
|
}
|
|
562
559
|
|
|
563
560
|
/**
|
|
@@ -626,16 +623,12 @@ class Component extends BaseComponent {
|
|
|
626
623
|
let oldPath = data.oldPath,
|
|
627
624
|
path = data.path;
|
|
628
625
|
|
|
629
|
-
if (oldPath) {
|
|
630
|
-
|
|
631
|
-
Neo.applyDeltas(this.appName, {id: oldPath[0].id, cls: {remove: ['neo-focus']}});
|
|
632
|
-
}
|
|
626
|
+
if (oldPath?.[0]?.cls.includes('neo-event')) {
|
|
627
|
+
Neo.applyDeltas(this.appName, {id: oldPath[0].id, cls: {remove: ['neo-focus']}});
|
|
633
628
|
}
|
|
634
629
|
|
|
635
|
-
if (path) {
|
|
636
|
-
|
|
637
|
-
Neo.applyDeltas(this.appName, {id: path[0].id, cls: {add: ['neo-focus']}});
|
|
638
|
-
}
|
|
630
|
+
if (path?.[0]?.cls.includes('neo-event')) {
|
|
631
|
+
Neo.applyDeltas(this.appName, {id: path[0].id, cls: {add: ['neo-focus']}});
|
|
639
632
|
}
|
|
640
633
|
}
|
|
641
634
|
|
|
@@ -668,9 +661,7 @@ class Component extends BaseComponent {
|
|
|
668
661
|
|
|
669
662
|
week = me.createWeek(DateUtil.clone(date));
|
|
670
663
|
|
|
671
|
-
|
|
672
|
-
container.cn.push(week.header);
|
|
673
|
-
}
|
|
664
|
+
week.header && container.cn.push(week.header);
|
|
674
665
|
|
|
675
666
|
container.cn.push(week.row);
|
|
676
667
|
}
|
|
@@ -702,9 +693,7 @@ class Component extends BaseComponent {
|
|
|
702
693
|
|
|
703
694
|
container.cn.unshift(week.row);
|
|
704
695
|
|
|
705
|
-
|
|
706
|
-
container.cn.unshift(week.header);
|
|
707
|
-
}
|
|
696
|
+
week.header && container.cn.unshift(week.header);
|
|
708
697
|
}
|
|
709
698
|
|
|
710
699
|
me.promiseVdomUpdate(me.vdom).then(() => {
|
|
@@ -723,9 +712,7 @@ class Component extends BaseComponent {
|
|
|
723
712
|
me.vdom = vdom;
|
|
724
713
|
}
|
|
725
714
|
|
|
726
|
-
|
|
727
|
-
clearTimeout(me.scrollTaskId);
|
|
728
|
-
}
|
|
715
|
+
me.scrollTaskId && clearTimeout(me.scrollTaskId);
|
|
729
716
|
|
|
730
717
|
me.scrollTaskId = setTimeout(me.onWheelEnd.bind(me), 300);
|
|
731
718
|
}
|
|
@@ -576,15 +576,11 @@ class Gallery extends Component {
|
|
|
576
576
|
* @param {Object} data
|
|
577
577
|
*/
|
|
578
578
|
onMouseWheel(data) {
|
|
579
|
-
let me
|
|
580
|
-
deltaX = data.deltaX,
|
|
581
|
-
deltaY = data.deltaY,
|
|
582
|
-
translateX = me.translateX,
|
|
583
|
-
translateZ = me.translateZ;
|
|
579
|
+
let me = this;
|
|
584
580
|
|
|
585
581
|
if (me.mouseWheelEnabled) {
|
|
586
|
-
me._translateX = translateX - (deltaX * me.mouseWheelDeltaX); // silent update
|
|
587
|
-
me._translateZ = translateZ + (deltaY * me.mouseWheelDeltaY); // silent update
|
|
582
|
+
me._translateX = me.translateX - (me.deltaX * me.mouseWheelDeltaX); // silent update
|
|
583
|
+
me._translateZ = me.translateZ + (me.deltaY * me.mouseWheelDeltaY); // silent update
|
|
588
584
|
|
|
589
585
|
me.moveOrigin();
|
|
590
586
|
|
package/src/component/Helix.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ClassSystemUtil from '../util/ClassSystem.mjs';
|
|
2
|
-
import Collection from '../collection/Base.mjs'
|
|
3
2
|
import Component from './Base.mjs';
|
|
4
3
|
import HelixModel from '../selection/HelixModel.mjs';
|
|
5
4
|
import Matrix from '../util/Matrix.mjs';
|
|
@@ -272,6 +271,19 @@ class Helix extends Component {
|
|
|
272
271
|
me.domListeners = domListeners;
|
|
273
272
|
}
|
|
274
273
|
|
|
274
|
+
/**
|
|
275
|
+
* Triggered after the followSelection config got changed
|
|
276
|
+
* @param {Boolean} value
|
|
277
|
+
* @param {Boolean} oldValue
|
|
278
|
+
* @protected
|
|
279
|
+
*/
|
|
280
|
+
afterSetFollowSelection(value, oldValue) {
|
|
281
|
+
let cls = this.cls;
|
|
282
|
+
|
|
283
|
+
NeoArray[value ? 'add' : 'remove'](cls, 'neo-follow-selection');
|
|
284
|
+
this.cls = cls;
|
|
285
|
+
}
|
|
286
|
+
|
|
275
287
|
/**
|
|
276
288
|
* Triggered after the flipped config got changed
|
|
277
289
|
* @param {Boolean} value
|
|
@@ -436,20 +448,9 @@ class Helix extends Component {
|
|
|
436
448
|
|
|
437
449
|
oldValue?.destroy();
|
|
438
450
|
|
|
439
|
-
|
|
440
|
-
if (value) {
|
|
441
|
-
return ClassSystemUtil.beforeSetInstance(value, Store, {
|
|
442
|
-
listeners : {
|
|
443
|
-
load : me.onStoreLoad,
|
|
444
|
-
sort : me.onSort,
|
|
445
|
-
scope: me
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
return Neo.create(Collection, {
|
|
451
|
-
keyProperty: 'id',
|
|
451
|
+
return ClassSystemUtil.beforeSetInstance(value, Store, {
|
|
452
452
|
listeners : {
|
|
453
|
+
load : me.onStoreLoad,
|
|
453
454
|
sort : me.onSort,
|
|
454
455
|
scope: me
|
|
455
456
|
}
|
|
@@ -746,11 +747,8 @@ class Helix extends Component {
|
|
|
746
747
|
Neo.currentWorker.promiseMessage('main', {
|
|
747
748
|
action : 'readDom',
|
|
748
749
|
appName : me.appName,
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
'offsetHeight',
|
|
752
|
-
'offsetWidth'
|
|
753
|
-
]
|
|
750
|
+
attributes: ['offsetHeight', 'offsetWidth'],
|
|
751
|
+
vnodeId : me.id
|
|
754
752
|
}).then(data => {
|
|
755
753
|
me.offsetHeight = data.attributes.offsetHeight;
|
|
756
754
|
me.offsetWidth = data.attributes.offsetWidth;
|
|
@@ -795,15 +793,7 @@ class Helix extends Component {
|
|
|
795
793
|
*/
|
|
796
794
|
onConstructed() {
|
|
797
795
|
super.onConstructed();
|
|
798
|
-
|
|
799
|
-
let me = this;
|
|
800
|
-
|
|
801
|
-
me.selectionModel?.register(me);
|
|
802
|
-
|
|
803
|
-
// load data for the example collection
|
|
804
|
-
if (!(me.store instanceof Store)) {
|
|
805
|
-
me.loadData();
|
|
806
|
-
}
|
|
796
|
+
this.selectionModel?.register(this);
|
|
807
797
|
}
|
|
808
798
|
|
|
809
799
|
/**
|
|
@@ -825,15 +815,11 @@ class Helix extends Component {
|
|
|
825
815
|
* @param {Object} data
|
|
826
816
|
*/
|
|
827
817
|
onMouseWheel(data) {
|
|
828
|
-
let me
|
|
829
|
-
deltaX = data.deltaX,
|
|
830
|
-
deltaY = data.deltaY,
|
|
831
|
-
rotationAngle = me.rotationAngle,
|
|
832
|
-
translateZ = me.translateZ;
|
|
818
|
+
let me = this;
|
|
833
819
|
|
|
834
820
|
if (me.mouseWheelEnabled && me[lockWheel]) {
|
|
835
|
-
me._rotationAngle = rotationAngle + (deltaX * me.mouseWheelDeltaX); // silent update
|
|
836
|
-
me._translateZ = translateZ + (deltaY * me.mouseWheelDeltaY); // silent update
|
|
821
|
+
me._rotationAngle = me.rotationAngle + (data.deltaX * me.mouseWheelDeltaX); // silent update
|
|
822
|
+
me._translateZ = me.translateZ + (data.deltaY * me.mouseWheelDeltaY); // silent update
|
|
837
823
|
|
|
838
824
|
me.refresh();
|
|
839
825
|
|
|
@@ -849,7 +835,7 @@ class Helix extends Component {
|
|
|
849
835
|
onSelectionChange(value, oldValue) {
|
|
850
836
|
let me = this;
|
|
851
837
|
|
|
852
|
-
if (me.followSelection && value
|
|
838
|
+
if (me.followSelection && value?.[0]) {
|
|
853
839
|
me.applyItemTransitions(me.moveToSelectedItem, 100, value[0]);
|
|
854
840
|
}
|
|
855
841
|
}
|
|
@@ -860,7 +846,7 @@ class Helix extends Component {
|
|
|
860
846
|
onSort() {
|
|
861
847
|
let me = this;
|
|
862
848
|
|
|
863
|
-
if (me[itemsMounted] === true) {
|
|
849
|
+
if (me[itemsMounted] === true) {
|
|
864
850
|
me.applyItemTransitions(me.sortItems, 1000);
|
|
865
851
|
}
|
|
866
852
|
}
|
|
@@ -915,9 +901,9 @@ class Helix extends Component {
|
|
|
915
901
|
s = Math.sin(angle * Math.PI / 180);
|
|
916
902
|
c = Math.cos(angle * Math.PI / 180);
|
|
917
903
|
|
|
918
|
-
x = -300 + radius * s
|
|
919
|
-
y = -400 + angle
|
|
920
|
-
z = 99800 + radius * c
|
|
904
|
+
x = -300 + radius * s + translateX;
|
|
905
|
+
y = -400 + angle * deltaY + translateY;
|
|
906
|
+
z = 99800 + radius * c + translateZ;
|
|
921
907
|
|
|
922
908
|
matrix.items = [
|
|
923
909
|
[c, 0, -s, 0],
|
package/src/worker/App.mjs
CHANGED
|
@@ -146,21 +146,19 @@ class App extends Base {
|
|
|
146
146
|
|
|
147
147
|
themeFolders = Neo.ns(mapClassName || className, false, cssMap.fileInfo);
|
|
148
148
|
|
|
149
|
-
if (themeFolders) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
});
|
|
163
|
-
}
|
|
149
|
+
if (themeFolders && !Neo.ns(`${lAppName}.${className}`, false, cssMap)) {
|
|
150
|
+
classPath = className.split('.');
|
|
151
|
+
fileName = classPath.pop();
|
|
152
|
+
classPath = classPath.join('.');
|
|
153
|
+
ns = Neo.ns(`${lAppName}.${classPath}`, true, cssMap);
|
|
154
|
+
|
|
155
|
+
ns[fileName] = true;
|
|
156
|
+
|
|
157
|
+
Neo.main.addon.Stylesheet.addThemeFiles({
|
|
158
|
+
appName,
|
|
159
|
+
className: mapClassName || className,
|
|
160
|
+
folders : themeFolders
|
|
161
|
+
});
|
|
164
162
|
}
|
|
165
163
|
}
|
|
166
164
|
}
|
|
@@ -236,9 +234,7 @@ class App extends Base {
|
|
|
236
234
|
.then(response => response.json())
|
|
237
235
|
.then(data => {this.createThemeMap(data)});
|
|
238
236
|
|
|
239
|
-
|
|
240
|
-
import('../vdom/Helper.mjs');
|
|
241
|
-
}
|
|
237
|
+
!config.useVdomWorker && import('../vdom/Helper.mjs');
|
|
242
238
|
}
|
|
243
239
|
|
|
244
240
|
/**
|