neo.mjs 8.20.0 → 8.20.2

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.20.0'
23
+ * @member {String} version='8.20.2'
24
24
  */
25
- version: '8.20.0'
25
+ version: '8.20.2'
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.20.0'
110
+ html : 'v8.20.2'
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.20.0'
23
+ * @member {String} version='8.20.2'
24
24
  */
25
- version: '8.20.0'
25
+ version: '8.20.2'
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
  */
@@ -47,7 +47,7 @@ class GridContainer extends BaseGridContainer {
47
47
  afterSetAmountColumns(value, oldValue) {
48
48
  let i = 4,
49
49
  columns = [
50
- {dataField: 'id', text: '#', width: 60},
50
+ {dataField: 'id', text: '#', width: 60, renderer({record, store}) {return store.indexOf(record) + 1}},
51
51
  {cellAlign: 'left', dataField: 'firstname', defaultSortDirection: 'ASC', text: 'Firstname', width: 150},
52
52
  {cellAlign: 'left', dataField: 'lastname', defaultSortDirection: 'ASC', text: 'Lastname', width: 150}
53
53
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "8.20.0",
3
+ "version": "8.20.2",
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
  }
@@ -18,6 +18,15 @@ const DefaultConfig = {
18
18
  * @type Boolean
19
19
  */
20
20
  applyBodyCls: true,
21
+ /**
22
+ * true will apply 'position: fixed' to the html tag itself
23
+ * See: https://github.com/neomjs/neo/issues/6429
24
+ * @default true
25
+ * @memberOf! module:Neo
26
+ * @name config.applyFixedPositionToHtmlTag
27
+ * @type Boolean
28
+ */
29
+ applyFixedPositionToHtmlTag: true,
21
30
  /**
22
31
  * Path to your app.mjs file. You can create multiple apps there if needed.
23
32
  * @default null
@@ -262,12 +271,12 @@ const DefaultConfig = {
262
271
  useVdomWorker: true,
263
272
  /**
264
273
  * buildScripts/injectPackageVersion.mjs will update this value
265
- * @default '8.20.0'
274
+ * @default '8.20.2'
266
275
  * @memberOf! module:Neo
267
276
  * @name config.version
268
277
  * @type String
269
278
  */
270
- version: '8.20.0'
279
+ version: '8.20.2'
271
280
  };
272
281
 
273
282
  Object.assign(DefaultConfig, {
package/src/grid/View.mjs CHANGED
@@ -372,18 +372,19 @@ class GridView extends Component {
372
372
  * @param {String} [data.cellId]
373
373
  * @param {Object} data.column
374
374
  * @param {Number} data.columnIndex
375
- * @param {Neo.grid.Container} data.gridContainer
376
375
  * @param {Object} data.record
377
376
  * @param {Number} data.rowIndex
378
377
  * @returns {Object}
379
378
  */
380
379
  applyRendererOutput(data) {
381
- let {cellId, column, columnIndex, gridContainer, record, rowIndex} = data,
382
- me = this,
383
- cellCls = ['neo-grid-cell'],
384
- colspan = record[me.colspanField],
385
- {dataField} = column,
386
- fieldValue = record[dataField],
380
+ let {cellId, column, columnIndex, record, rowIndex} = data,
381
+ me = this,
382
+ gridContainer = me.parent,
383
+ {store} = me,
384
+ cellCls = ['neo-grid-cell'],
385
+ colspan = record[me.colspanField],
386
+ {dataField} = column,
387
+ fieldValue = record[dataField],
387
388
  cellConfig, rendererOutput;
388
389
 
389
390
  if (fieldValue === null || fieldValue === undefined) {
@@ -397,6 +398,7 @@ class GridView extends Component {
397
398
  gridContainer,
398
399
  record,
399
400
  rowIndex,
401
+ store,
400
402
  value: fieldValue
401
403
  });
402
404
 
@@ -541,7 +543,7 @@ class GridView extends Component {
541
543
 
542
544
  for (i=startIndex; i <= endIndex; i++) {
543
545
  column = columns[i];
544
- config = me.applyRendererOutput({column, columnIndex: i, gridContainer, record, rowIndex});
546
+ config = me.applyRendererOutput({column, columnIndex: i, record, rowIndex});
545
547
 
546
548
  if (column.dock) {
547
549
  config.cls = ['neo-locked', ...config.cls || []]
@@ -910,7 +912,7 @@ class GridView extends Component {
910
912
  cellStyle = cellNode.vdom.style;
911
913
  column = me.getColumn(field.name);
912
914
  columnIndex = cellNode.index;
913
- cellVdom = me.applyRendererOutput({cellId, column, columnIndex, gridContainer, record, rowIndex});
915
+ cellVdom = me.applyRendererOutput({cellId, column, columnIndex, record, rowIndex});
914
916
  needsUpdate = true;
915
917
 
916
918
  // The cell-positioning logic happens outside applyRendererOutput()
@@ -235,6 +235,7 @@ class Button extends BaseButton {
235
235
  * @param {Neo.grid.Container} data.gridContainer
236
236
  * @param {Object} data.record
237
237
  * @param {Number} data.rowIndex
238
+ * @param {Neo.data.Store} data.store
238
239
  * @param {Number|String} data.value
239
240
  * @returns {*}
240
241
  */
@@ -165,47 +165,6 @@ class DomAccess extends Base {
165
165
  me.syncAligns = me.syncAligns.bind(me)
166
166
  }
167
167
 
168
- /**
169
- *
170
- */
171
- initGlobalListeners() {
172
- let me = this;
173
-
174
- document.addEventListener('blur', me.onDocumentBlur .bind(me), capturePassive);
175
- document.addEventListener('keydown', me.onDocumentKeyDown .bind(me), capturePassive);
176
- document.addEventListener('keyup', me.onDocumentKeyUp .bind(me), capturePassive);
177
- document.addEventListener('mousedown', me.onDocumentMouseDown.bind(me), {capture : true})
178
- }
179
-
180
- onDocumentMouseDown(e) {
181
- let focusController = e.target?.closest('[data-focus]');
182
-
183
- // data-focus on an element means reject mousedown gestures, and move focus
184
- // to the referenced element.
185
- if (focusController) {
186
- e.preventDefault();
187
- document.getElementById(focusController.dataset.focus)?.focus()
188
- }
189
- }
190
-
191
- onDocumentKeyDown(keyEvent) {
192
- if (modifierKeys[keyEvent.key]) {
193
- // e.g. Neo.isShiftKeyDown = true or Neo.isControlKeyDown = true.
194
- // Selection can consult this value
195
- Neo[`${StringUtil.uncapitalize(keyEvent.key)}KeyDown`] = true;
196
- }
197
- }
198
-
199
- onDocumentKeyUp(keyEvent) {
200
- if (modifierKeys[keyEvent.key]) {
201
- Neo[`${StringUtil.uncapitalize(keyEvent.key)}KeyDown`] = false;
202
- }
203
- }
204
-
205
- onDocumentBlur() {
206
- Neo.altKeyDown = Neo.controlKeyDown = Neo.metaKeyDown = Neo.shiftKeyDown = false;
207
- }
208
-
209
168
  /**
210
169
  * @param {Object} alignSpec
211
170
  */
@@ -564,6 +523,18 @@ class DomAccess extends Base {
564
523
  }
565
524
  }
566
525
 
526
+ /**
527
+ *
528
+ */
529
+ initGlobalListeners() {
530
+ let me = this;
531
+
532
+ document.addEventListener('blur', me.onDocumentBlur .bind(me), capturePassive);
533
+ document.addEventListener('keydown', me.onDocumentKeyDown .bind(me), capturePassive);
534
+ document.addEventListener('keyup', me.onDocumentKeyUp .bind(me), capturePassive);
535
+ document.addEventListener('mousedown', me.onDocumentMouseDown.bind(me), {capture : true})
536
+ }
537
+
567
538
  /**
568
539
  * @param {HTMLElement} el
569
540
  * @returns {Boolean}
@@ -715,6 +686,33 @@ class DomAccess extends Base {
715
686
  }
716
687
  }
717
688
 
689
+ /**
690
+ *
691
+ */
692
+ onDocumentBlur() {
693
+ Neo.altKeyDown = Neo.controlKeyDown = Neo.metaKeyDown = Neo.shiftKeyDown = false
694
+ }
695
+
696
+ /**
697
+ * @param {KeyboardEvent} keyEvent
698
+ */
699
+ onDocumentKeyDown(keyEvent) {
700
+ if (modifierKeys[keyEvent.key]) {
701
+ // e.g. Neo.isShiftKeyDown = true or Neo.isControlKeyDown = true.
702
+ // Selection can consult this value
703
+ Neo[`${StringUtil.uncapitalize(keyEvent.key)}KeyDown`] = true
704
+ }
705
+ }
706
+
707
+ /**
708
+ * @param {KeyboardEvent} keyEvent
709
+ */
710
+ onDocumentKeyUp(keyEvent) {
711
+ if (modifierKeys[keyEvent.key]) {
712
+ Neo[`${StringUtil.uncapitalize(keyEvent.key)}KeyDown`] = false
713
+ }
714
+ }
715
+
718
716
  /**
719
717
  * @param {Array} mutations
720
718
  */
@@ -733,11 +731,26 @@ class DomAccess extends Base {
733
731
  }
734
732
  }
735
733
 
734
+ /**
735
+ * @param {MouseEvent} e
736
+ */
737
+ onDocumentMouseDown(e) {
738
+ let focusController = e.target?.closest('[data-focus]');
739
+
740
+ // data-focus on an element means reject mousedown gestures, and move focus
741
+ // to the referenced element.
742
+ if (focusController) {
743
+ e.preventDefault();
744
+ document.getElementById(focusController.dataset.focus)?.focus()
745
+ }
746
+ }
747
+
736
748
  /**
737
749
  *
738
750
  */
739
751
  onDomContentLoaded() {
740
- Neo.config.applyBodyCls && this.applyBodyCls({cls: ['neo-body']})
752
+ Neo.config.applyBodyCls && this.applyBodyCls({cls: ['neo-body']});
753
+ Neo.config.applyFixedPositionToHtmlTag && document.documentElement.style.setProperty('position', 'fixed')
741
754
  }
742
755
 
743
756
  /**