neo.mjs 8.19.1 → 8.20.1

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.
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='8.19.1'
23
+ * @member {String} version='8.20.1'
24
24
  */
25
- version: '8.19.1'
25
+ version: '8.20.1'
26
26
  }
27
27
 
28
28
  /**
@@ -107,7 +107,7 @@ class FooterContainer extends Container {
107
107
  }, {
108
108
  module: Component,
109
109
  cls : ['neo-version'],
110
- html : 'v8.19.1'
110
+ html : 'v8.20.1'
111
111
  }]
112
112
  }],
113
113
  /**
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='8.19.1'
23
+ * @member {String} version='8.20.1'
24
24
  */
25
- version: '8.19.1'
25
+ version: '8.20.1'
26
26
  }
27
27
 
28
28
  /**
@@ -22,11 +22,13 @@ class ControlsContainer extends Container {
22
22
  */
23
23
  items: [{
24
24
  ntype : 'button',
25
- cls : ['sections-container-button'],
25
+ cls : ['controls-container-button'],
26
26
  handler: 'up.onControlsToggleButtonClick',
27
27
  iconCls: 'fas fa-bars'
28
28
  }, {
29
29
  module: Container,
30
+ cls : ['neo-examples-bigdata-controls-container-content'],
31
+ layout: 'vbox',
30
32
 
31
33
  itemDefaults: {
32
34
  module : ComboBox,
@@ -87,7 +89,7 @@ class ControlsContainer extends Container {
87
89
  /**
88
90
  * @member {Object} layout={ntype:'vbox'}
89
91
  */
90
- layout: {ntype: 'vbox'},
92
+ layout: {ntype: 'fit'},
91
93
  /**
92
94
  * @member {String} tag='aside'
93
95
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "8.19.1",
3
+ "version": "8.20.1",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,38 +1,49 @@
1
1
  .neo-examples-bigdata-controls-container {
2
- border : none; // reset the default 1px
3
- bottom : .5em;
4
- box-shadow : 0 5px 10px rgba(75,75,75,.3);
5
- display : block;
6
- flex-shrink : 0;
7
- min-width : 235px;
8
- overflow : visible;
9
- padding : .5em 1em;
10
- position : absolute;
11
- right : -235px;
12
- top : .5em;
13
- transition : right 250ms ease-out;
14
- width : 235px;
15
- z-index : 100;
2
+ border : none; // reset the default 1px
3
+ bottom : .5em;
4
+ display : block;
5
+ flex-shrink: 0;
6
+ min-width : 235px;
7
+ overflow : visible;
8
+ position : absolute;
9
+ right : -235px;
10
+ top : .5em;
11
+ transition : right 250ms ease-out;
12
+ width : 235px;
13
+ z-index : 100;
14
+
15
+ .neo-examples-bigdata-controls-container-content {
16
+ box-shadow: 0 5px 10px rgba(75,75,75,.3);
17
+ opacity : 0;
18
+ padding : .5em 1em;
19
+ transition: opacity 250ms ease-out;
20
+ }
16
21
 
17
22
  &.neo-expanded {
18
23
  right: 0;
24
+
25
+ .neo-examples-bigdata-controls-container-content {
26
+ opacity: 1;
27
+ }
19
28
  }
20
29
 
21
- .sections-container-button {
22
- //background-color: #fff;
23
- border-radius : 8px;
24
- box-shadow : 0 5px 10px rgba(75,75,75,.3);
25
- display : flex;
26
- height : 35px;
27
- min-width : 35px;
28
- position : absolute;
29
- left : -53px;
30
- top : .2em;
31
- width : 35px;
30
+ .controls-container-button {
31
+ border-radius: 8px;
32
+ box-shadow : 0 5px 10px rgba(75,75,75,.3);
33
+ display : flex;
34
+ height : 35px;
35
+ min-width : 35px;
36
+ position : absolute;
37
+ left : -53px;
38
+ top : .2em;
39
+ width : 35px;
32
40
 
33
41
  .neo-button-glyph {
34
- // color : #000; // required for mobile
35
42
  font-size: 13px;
36
43
  }
44
+
45
+ .neo-button-ripple-wrapper {
46
+ border-radius: 8px;
47
+ }
37
48
  }
38
49
  }
@@ -59,12 +59,6 @@
59
59
  }
60
60
  }
61
61
 
62
- &:hover {
63
- .neo-grid-cell {
64
- background-color: var(--grid-cell-background-color-hover);
65
- }
66
- }
67
-
68
62
  // selection.RowModel
69
63
  &.neo-selected {
70
64
  .neo-grid-cell {
@@ -102,6 +96,16 @@
102
96
  }
103
97
  }
104
98
 
99
+ .neo-mouse {
100
+ .neo-grid-row {
101
+ &:hover {
102
+ .neo-grid-cell {
103
+ background-color: var(--grid-cell-background-color-hover);
104
+ }
105
+ }
106
+ }
107
+ }
108
+
105
109
  .neo-selection-cellrowmodel,
106
110
  .neo-selection-cellcolumnrowmodel{
107
111
  .neo-grid-row {
@@ -72,5 +72,10 @@
72
72
  color : var(--grid-header-button-color);
73
73
  pointer-events: none;
74
74
  text-transform: none;
75
+
76
+ @media (max-width: 600px) {
77
+ // Default Buttons use a slightly bigger font-size, which does not make sense here
78
+ font-size: var(--button-text-font-size);
79
+ }
75
80
  }
76
81
  }
@@ -262,12 +262,12 @@ const DefaultConfig = {
262
262
  useVdomWorker: true,
263
263
  /**
264
264
  * buildScripts/injectPackageVersion.mjs will update this value
265
- * @default '8.19.1'
265
+ * @default '8.20.1'
266
266
  * @memberOf! module:Neo
267
267
  * @name config.version
268
268
  * @type String
269
269
  */
270
- version: '8.19.1'
270
+ version: '8.20.1'
271
271
  };
272
272
 
273
273
  Object.assign(DefaultConfig, {
@@ -87,7 +87,7 @@ class SortZone extends BaseSortZone {
87
87
  {...config.vdom, cls: ['neo-grid-header-toolbar', 'neo-toolbar']},
88
88
  {cls: ['neo-grid-view-wrapper'], id: viewWrapperId, cn: [
89
89
  {cls: ['neo-grid-view'], cn: rows},
90
- {cls: ['neo-grid-scrollbar'], style: {height: view.vdom.cn[1].height}}
90
+ {cls: ['neo-grid-scrollbar'], style: {height: view.vdom.cn[0].height}}
91
91
  ]}
92
92
  ]}
93
93
  ]};
@@ -114,9 +114,22 @@ class GridContainer extends BaseContainer {
114
114
 
115
115
  /**
116
116
  * We do not need the first event to trigger logic, since afterSetMounted() handles this
117
- * @member {Boolean}} initialResizeEvent=true
117
+ * @member {Boolean} initialResizeEvent=true
118
+ * @protected
118
119
  */
119
120
  initialResizeEvent = true
121
+ /**
122
+ * Flag for identifying the ownership of a touchmove operation
123
+ * @member {Boolean} isTouchMoveOwner=false
124
+ * @protected
125
+ */
126
+ isTouchMoveOwner = false
127
+ /**
128
+ * Storing touchmove position for mobile envs
129
+ * @member {Number} lastTouchY=0
130
+ * @protected
131
+ */
132
+ lastTouchY = 0
120
133
 
121
134
  /**
122
135
  * Convenience method to access the Neo.grid.header.Toolbar
@@ -521,14 +534,36 @@ class GridContainer extends BaseContainer {
521
534
  * @param {Object} data
522
535
  * @param {Number} data.scrollLeft
523
536
  * @param {Object} data.target
537
+ * @param {Object} data.touches
524
538
  */
525
- onScroll({scrollLeft, target}) {
526
- let me = this;
539
+ onScroll({scrollLeft, target, touches}) {
540
+ let me = this,
541
+ deltaY, lastTouchY;
527
542
 
528
543
  // We must ignore events for grid-scrollbar
529
544
  if (target.id.includes('grid-container')) {
530
545
  me.headerToolbar.scrollLeft = scrollLeft;
531
- me.view.scrollPosition = {x: scrollLeft, y: me.view.scrollPosition.y}
546
+ me.view.scrollPosition = {x: scrollLeft, y: me.view.scrollPosition.y};
547
+
548
+ if (touches) {
549
+ if (!me.view.isTouchMoveOwner) {
550
+ me.isTouchMoveOwner = true
551
+ }
552
+
553
+ if (me.isTouchMoveOwner) {
554
+ lastTouchY = touches.lastTouch.clientY - touches.firstTouch.clientY;
555
+ deltaY = me.lastTouchY - lastTouchY;
556
+
557
+ deltaY !== 0 && Neo.main.DomAccess.scrollTo({
558
+ direction: 'top',
559
+ id : me.view.vdom.id,
560
+ value : me.view.scrollPosition.y + deltaY
561
+ })
562
+
563
+ me.lastTouchY = lastTouchY
564
+ }
565
+ }
566
+
532
567
  }
533
568
  }
534
569
 
package/src/grid/View.mjs CHANGED
@@ -129,6 +129,18 @@ class GridView extends Component {
129
129
  ]}
130
130
  }
131
131
 
132
+ /**
133
+ * Flag for identifying the ownership of a touchmove operation
134
+ * @member {Boolean} isTouchMoveOwner=false
135
+ * @protected
136
+ */
137
+ isTouchMoveOwner = false
138
+ /**
139
+ * Storing touchmove position for mobile envs
140
+ * @member {Number} lastTouchX=0
141
+ * @protected
142
+ */
143
+ lastTouchX = 0
132
144
  /**
133
145
  * @member {Number|null}} scrollTimeoutId=null
134
146
  */
@@ -156,8 +168,10 @@ class GridView extends Component {
156
168
  let me = this;
157
169
 
158
170
  me.addDomListeners([{
159
- scroll: me.onScroll,
160
- scope : me
171
+ scroll : me.onScroll,
172
+ touchcancel: me.onTouchCancel,
173
+ touchend : me.onTouchEnd,
174
+ scope : me
161
175
  }, {
162
176
  click : me.onCellClick,
163
177
  dblclick: me.onCellDoubleClick,
@@ -826,8 +840,9 @@ class GridView extends Component {
826
840
  * Only triggers for vertical scrolling
827
841
  * @param {Object} data
828
842
  */
829
- onScroll(data) {
830
- let me = this;
843
+ onScroll({scrollTop, touches}) {
844
+ let me = this,
845
+ deltaX, lastTouchX;
831
846
 
832
847
  me.scrollTimeoutId && clearTimeout(me.scrollTimeoutId);
833
848
 
@@ -837,8 +852,27 @@ class GridView extends Component {
837
852
 
838
853
  me.set({
839
854
  isScrolling : true,
840
- scrollPosition: {x: me.scrollPosition.x, y: data.scrollTop}
841
- })
855
+ scrollPosition: {x: me.scrollPosition.x, y: scrollTop}
856
+ });
857
+
858
+ if (touches) {
859
+ if (!me.parent.isTouchMoveOwner) {
860
+ me.isTouchMoveOwner = true
861
+ }
862
+
863
+ if (me.isTouchMoveOwner) {
864
+ lastTouchX = touches.lastTouch.clientX - touches.firstTouch.clientX;
865
+ deltaX = me.lastTouchX - lastTouchX;
866
+
867
+ deltaX !== 0 && Neo.main.DomAccess.scrollTo({
868
+ direction: 'left',
869
+ id : me.parent.id,
870
+ value : me.scrollPosition.x + deltaX
871
+ })
872
+
873
+ me.lastTouchX = lastTouchX
874
+ }
875
+ }
842
876
  }
843
877
 
844
878
  /**
@@ -895,6 +929,34 @@ class GridView extends Component {
895
929
  needsUpdate && me.update()
896
930
  }
897
931
 
932
+ /**
933
+ * @param {Object} data
934
+ */
935
+ onTouchCancel(data) {
936
+ let me = this,
937
+ {parent} = me;
938
+
939
+ me.isTouchMoveOwner = false;
940
+ me.lastTouchX = 0;
941
+
942
+ parent.isTouchMoveOwner = false;
943
+ parent.lastTouchY = 0
944
+ }
945
+
946
+ /**
947
+ * @param {Object} data
948
+ */
949
+ onTouchEnd(data) {
950
+ let me = this,
951
+ {parent} = me;
952
+
953
+ me.isTouchMoveOwner = false;
954
+ me.lastTouchX = 0;
955
+
956
+ parent.isTouchMoveOwner = false;
957
+ parent.lastTouchY = 0
958
+ }
959
+
898
960
  /**
899
961
  *
900
962
  */
@@ -590,17 +590,29 @@ class DomEvents extends Base {
590
590
  * @param {Event} event
591
591
  */
592
592
  onScroll(event) {
593
- let {clientHeight, clientWidth, scrollLeft, scrollTop} = event.target;
593
+ let me = this,
594
+ {firstTouch, lastTouch} = me,
595
+ {clientHeight, clientWidth, scrollLeft, scrollTop} = event.target,
596
+ data;
594
597
 
595
598
  event.preventDefault();
596
599
 
597
- this.sendMessageToApp({
598
- ...this.getEventData(event),
600
+ data = {
601
+ ...me.getEventData(event),
599
602
  clientHeight,
600
603
  clientWidth,
601
604
  scrollLeft,
602
605
  scrollTop
603
- })
606
+ };
607
+
608
+ if (firstTouch) {
609
+ data.touches = {
610
+ firstTouch: {clientX: firstTouch.clientX, clientY: firstTouch.clientY},
611
+ lastTouch : {clientX: lastTouch .clientX, clientY: lastTouch .clientY}
612
+ }
613
+ }
614
+
615
+ me.sendMessageToApp(data)
604
616
  }
605
617
 
606
618
  /**
@@ -22,7 +22,8 @@ class TouchDomEvents extends Base {
22
22
  let me = this;
23
23
 
24
24
  me.sendMessageToApp(me.getEventData(event));
25
- me.lastTouch = null
25
+ me.firstTouch = null;
26
+ me.lastTouch = null
26
27
  }
27
28
 
28
29
  /**
@@ -32,7 +33,8 @@ class TouchDomEvents extends Base {
32
33
  let me = this;
33
34
 
34
35
  me.sendMessageToApp(me.getEventData(event));
35
- me.lastTouch = null
36
+ me.firstTouch = null;
37
+ me.lastTouch = null
36
38
  }
37
39
 
38
40
  /**
@@ -80,7 +82,8 @@ class TouchDomEvents extends Base {
80
82
  onTouchStart(event) {
81
83
  let me = this;
82
84
 
83
- me.lastTouch = event.touches[0];
85
+ me.firstTouch = event.touches[0];
86
+ me.lastTouch = event.touches[0];
84
87
 
85
88
  me.sendMessageToApp(me.getEventData(event))
86
89
  }