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.
- package/apps/ServiceWorker.mjs +2 -2
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/grid/bigData/ControlsContainer.mjs +4 -2
- package/examples/grid/bigData/GridContainer.mjs +1 -1
- package/package.json +1 -1
- package/resources/scss/src/examples/grid/bigData/ControlsContainer.scss +37 -26
- package/src/DefaultConfig.mjs +11 -2
- package/src/grid/View.mjs +11 -9
- package/src/grid/header/Button.mjs +1 -0
- package/src/main/DomAccess.mjs +55 -42
package/apps/ServiceWorker.mjs
CHANGED
@@ -22,11 +22,13 @@ class ControlsContainer extends Container {
|
|
22
22
|
*/
|
23
23
|
items: [{
|
24
24
|
ntype : 'button',
|
25
|
-
cls : ['
|
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: '
|
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,38 +1,49 @@
|
|
1
1
|
.neo-examples-bigdata-controls-container {
|
2
|
-
border
|
3
|
-
bottom
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
.
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
}
|
package/src/DefaultConfig.mjs
CHANGED
@@ -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.
|
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.
|
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,
|
382
|
-
me
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
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,
|
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,
|
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
|
*/
|
package/src/main/DomAccess.mjs
CHANGED
@@ -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
|
/**
|