neo.mjs 4.1.1 → 4.2.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.
- package/apps/realworld/view/FooterComponent.mjs +5 -5
- package/apps/realworld/view/HeaderComponent.mjs +30 -30
- package/apps/realworld/view/HomeComponent.mjs +4 -4
- package/apps/realworld/view/MainContainerController.mjs +4 -4
- package/apps/realworld/view/article/Component.mjs +2 -2
- package/apps/realworld/view/article/PreviewComponent.mjs +1 -1
- package/apps/realworld/view/article/TagListComponent.mjs +2 -2
- package/apps/realworld2/view/MainContainer.mjs +1 -1
- package/apps/realworld2/view/MainContainerController.mjs +2 -2
- package/buildScripts/addConfig.mjs +400 -0
- package/buildScripts/createApp.mjs +3 -3
- package/buildScripts/createClass.mjs +15 -7
- package/examples/grid/container/MainContainer.mjs +102 -0
- package/examples/grid/container/MainModel.mjs +29 -0
- package/examples/grid/container/MainStore.mjs +55 -0
- package/examples/grid/container/app.mjs +6 -0
- package/examples/grid/container/index.html +11 -0
- package/examples/grid/container/neo-config.json +7 -0
- package/examples/table/container/MainModel.mjs +4 -4
- package/package.json +4 -3
- package/resources/scss/src/grid/Container.scss +6 -5
- package/resources/scss/src/grid/header/Button.scss +6 -0
- package/resources/scss/src/grid/header/Toolbar.scss +2 -0
- package/src/data/connection/WebSocket.mjs +1 -0
- package/src/grid/View.mjs +2 -2
- package/src/grid/header/Button.mjs +25 -0
- package/src/selection/grid/CellColumnModel.mjs +7 -7
- package/src/selection/grid/CellColumnRowModel.mjs +5 -5
- package/src/selection/grid/CellModel.mjs +17 -23
- package/src/selection/grid/ColumnModel.mjs +30 -34
@@ -114,6 +114,7 @@ if (programOpts.info) {
|
|
114
114
|
choices: [
|
115
115
|
'component.Base',
|
116
116
|
'container.Base',
|
117
|
+
'container.Viewport',
|
117
118
|
'controller.Component',
|
118
119
|
'core.Base',
|
119
120
|
'data.Model',
|
@@ -576,15 +577,22 @@ if (programOpts.info) {
|
|
576
577
|
" */",
|
577
578
|
`class ${file} extends ${baseFileName} {`,
|
578
579
|
" static getConfig() {return {",
|
579
|
-
"
|
580
|
+
" /**",
|
580
581
|
` * @member {String} className='${className}'`,
|
581
582
|
" * @protected",
|
582
583
|
" */",
|
583
584
|
` className: '${className}'`
|
584
585
|
);
|
585
586
|
|
587
|
+
baseClass === 'container.Viewport' && addComma(classContent).push(
|
588
|
+
" /**",
|
589
|
+
" * @member {Boolean} autoMount=true",
|
590
|
+
" */",
|
591
|
+
" autoMount: true"
|
592
|
+
);
|
593
|
+
|
586
594
|
baseClass === 'table.Container' && addComma(classContent).push(
|
587
|
-
"
|
595
|
+
" /**",
|
588
596
|
" * @member {Object[]} columns",
|
589
597
|
" */",
|
590
598
|
" columns: [{",
|
@@ -597,7 +605,7 @@ if (programOpts.info) {
|
|
597
605
|
);
|
598
606
|
|
599
607
|
baseClass === 'data.Model' && addComma(classContent).push(
|
600
|
-
"
|
608
|
+
" /**",
|
601
609
|
" * @member {Object[]} fields",
|
602
610
|
" */",
|
603
611
|
" fields: [{",
|
@@ -607,14 +615,14 @@ if (programOpts.info) {
|
|
607
615
|
);
|
608
616
|
|
609
617
|
baseClass === 'container.Base' && addComma(classContent).push(
|
610
|
-
"
|
618
|
+
" /**",
|
611
619
|
" * @member {Object[]} items",
|
612
620
|
" */",
|
613
621
|
" items: []"
|
614
622
|
);
|
615
623
|
|
616
624
|
baseClass === 'tab.Container' && addComma(classContent).push(
|
617
|
-
"
|
625
|
+
" /**",
|
618
626
|
" * @member {Object[]} items",
|
619
627
|
" */",
|
620
628
|
" items: [{",
|
@@ -635,7 +643,7 @@ if (programOpts.info) {
|
|
635
643
|
);
|
636
644
|
|
637
645
|
isSingleton && addComma(classContent).push(
|
638
|
-
"
|
646
|
+
" /**",
|
639
647
|
" * @member {Boolean} singleton=true",
|
640
648
|
" * @protected",
|
641
649
|
" */",
|
@@ -643,7 +651,7 @@ if (programOpts.info) {
|
|
643
651
|
);
|
644
652
|
|
645
653
|
baseClass === 'component.Base' && addComma(classContent).push(
|
646
|
-
"
|
654
|
+
" /**",
|
647
655
|
" * @member {Object} _vdom",
|
648
656
|
" */",
|
649
657
|
" _vdom:",
|
@@ -0,0 +1,102 @@
|
|
1
|
+
import CellColumnModel from '../../../src/selection/grid/CellColumnModel.mjs';
|
2
|
+
import CellColumnRowModel from '../../../src/selection/grid/CellColumnRowModel.mjs';
|
3
|
+
import CellModel from '../../../src/selection/grid/CellModel.mjs';
|
4
|
+
import CellRowModel from '../../../src/selection/grid/CellRowModel.mjs';
|
5
|
+
import ConfigurationViewport from '../../ConfigurationViewport.mjs';
|
6
|
+
import ColumnModel from '../../../src/selection/grid/ColumnModel.mjs';
|
7
|
+
import GridContainer from '../../../src/grid/Container.mjs';
|
8
|
+
import MainStore from './MainStore.mjs';
|
9
|
+
import NumberField from '../../../src/form/field/Number.mjs';
|
10
|
+
import Radio from '../../../src/form/field/Radio.mjs';
|
11
|
+
import RowModel from '../../../src/selection/grid/RowModel.mjs';
|
12
|
+
|
13
|
+
/**
|
14
|
+
* @class Neo.examples.grid.container.MainContainer
|
15
|
+
* @extends Neo.examples.ConfigurationViewport
|
16
|
+
*/
|
17
|
+
class MainContainer extends ConfigurationViewport {
|
18
|
+
static getConfig() {return {
|
19
|
+
className : 'Neo.examples.grid.container.MainContainer',
|
20
|
+
autoMount : true,
|
21
|
+
configItemLabelWidth: 130,
|
22
|
+
configPanelFlex : 1.5,
|
23
|
+
exampleComponentFlex: 3,
|
24
|
+
layout : {ntype: 'hbox', align: 'stretch'}
|
25
|
+
}}
|
26
|
+
|
27
|
+
createConfigurationComponents() {
|
28
|
+
let me = this;
|
29
|
+
|
30
|
+
const selectionModelRadioDefaults = {
|
31
|
+
module : Radio,
|
32
|
+
hideValueLabel: false,
|
33
|
+
labelText : '',
|
34
|
+
name : 'selectionModel',
|
35
|
+
width : 350
|
36
|
+
};
|
37
|
+
|
38
|
+
return [{
|
39
|
+
module : NumberField,
|
40
|
+
labelText: 'height',
|
41
|
+
listeners: {change: me.onConfigChange.bind(me, 'height')},
|
42
|
+
maxValue : 800,
|
43
|
+
minValue : 225,
|
44
|
+
stepSize : 5,
|
45
|
+
value : me.exampleComponent.height
|
46
|
+
}, {
|
47
|
+
...selectionModelRadioDefaults,
|
48
|
+
checked : me.exampleComponent.selectionModel.ntype === 'selection-grid-cellmodel',
|
49
|
+
labelText : 'selectionModel',
|
50
|
+
listeners : {change: me.onRadioChange.bind(me, 'selectionModel', CellModel)},
|
51
|
+
style : {marginTop: '10px'},
|
52
|
+
valueLabelText: 'Cell'
|
53
|
+
}, {
|
54
|
+
...selectionModelRadioDefaults,
|
55
|
+
checked : me.exampleComponent.selectionModel.ntype === 'selection-grid-columnmodel',
|
56
|
+
listeners : {change: me.onRadioChange.bind(me, 'selectionModel', ColumnModel)},
|
57
|
+
valueLabelText: 'Column'
|
58
|
+
}, {
|
59
|
+
...selectionModelRadioDefaults,
|
60
|
+
checked : me.exampleComponent.selectionModel.ntype === 'selection-grid-rowmodel',
|
61
|
+
listeners : {change: me.onRadioChange.bind(me, 'selectionModel', RowModel)},
|
62
|
+
valueLabelText: 'Row'
|
63
|
+
}, {
|
64
|
+
...selectionModelRadioDefaults,
|
65
|
+
checked : me.exampleComponent.selectionModel.ntype === 'selection-grid-cellcolumnmodel',
|
66
|
+
listeners : {change: me.onRadioChange.bind(me, 'selectionModel', CellColumnModel)},
|
67
|
+
valueLabelText: 'Cell & Column'
|
68
|
+
}, {
|
69
|
+
...selectionModelRadioDefaults,
|
70
|
+
checked : me.exampleComponent.selectionModel.ntype === 'selection-grid-cellrowmodel',
|
71
|
+
listeners : {change: me.onRadioChange.bind(me, 'selectionModel', CellRowModel)},
|
72
|
+
valueLabelText: 'Cell & Row'
|
73
|
+
}, {
|
74
|
+
...selectionModelRadioDefaults,
|
75
|
+
checked : me.exampleComponent.selectionModel.ntype === 'selection-grid-cellcolumnrowmodel',
|
76
|
+
listeners : {change: me.onRadioChange.bind(me, 'selectionModel', CellColumnRowModel)},
|
77
|
+
valueLabelText: 'Cell & Column & Row'
|
78
|
+
}];
|
79
|
+
}
|
80
|
+
|
81
|
+
createExampleComponent() {
|
82
|
+
return Neo.create(GridContainer, {
|
83
|
+
selectionModel: CellModel,
|
84
|
+
store : MainStore,
|
85
|
+
|
86
|
+
columnDefaults: {
|
87
|
+
width: 200
|
88
|
+
},
|
89
|
+
|
90
|
+
columns: [
|
91
|
+
{field: 'firstname', text: 'Firstname'},
|
92
|
+
{field: 'lastname', text: 'Lastname'},
|
93
|
+
{field: 'githubId', text: 'Github Id'},
|
94
|
+
{field: 'country', text: 'Country'}
|
95
|
+
]
|
96
|
+
});
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
Neo.applyClassConfig(MainContainer);
|
101
|
+
|
102
|
+
export default MainContainer;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import Model from '../../../src/data/Model.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Neo.examples.grid.container.MainModel
|
5
|
+
* @extends Neo.data.Model
|
6
|
+
*/
|
7
|
+
class MainModel extends Model {
|
8
|
+
static getConfig() {return {
|
9
|
+
className: 'Neo.examples.grid.container.MainModel',
|
10
|
+
|
11
|
+
fields: [{
|
12
|
+
name: 'country',
|
13
|
+
type: 'String'
|
14
|
+
}, {
|
15
|
+
name: 'firstname',
|
16
|
+
type: 'String'
|
17
|
+
}, {
|
18
|
+
name: 'githubId',
|
19
|
+
type: 'String'
|
20
|
+
}, {
|
21
|
+
name: 'lastname',
|
22
|
+
type: 'String'
|
23
|
+
}]
|
24
|
+
}}
|
25
|
+
}
|
26
|
+
|
27
|
+
Neo.applyClassConfig(MainModel);
|
28
|
+
|
29
|
+
export default MainModel;
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import Store from '../../../src/data/Store.mjs';
|
2
|
+
import Model from './MainModel.mjs';
|
3
|
+
|
4
|
+
/**
|
5
|
+
* @class Neo.examples.grid.container.MainStore
|
6
|
+
* @extends Neo.data.Store
|
7
|
+
*/
|
8
|
+
class MainStore extends Store {
|
9
|
+
static getConfig() {return {
|
10
|
+
className : 'Neo.examples.grid.container.MainStore',
|
11
|
+
keyProperty: 'githubId',
|
12
|
+
model : Model,
|
13
|
+
|
14
|
+
data: [{
|
15
|
+
country : 'Germany',
|
16
|
+
firstname: 'Tobias',
|
17
|
+
githubId : 'tobiu',
|
18
|
+
lastname : 'Uhlig'
|
19
|
+
},
|
20
|
+
{
|
21
|
+
country : 'USA',
|
22
|
+
firstname: 'Rich',
|
23
|
+
githubId : 'rwaters',
|
24
|
+
lastname : 'Waters'
|
25
|
+
},
|
26
|
+
{
|
27
|
+
country : 'Germany',
|
28
|
+
firstname: 'Nils',
|
29
|
+
githubId : 'mrsunshine',
|
30
|
+
lastname : 'Dehl'
|
31
|
+
},
|
32
|
+
{
|
33
|
+
country : 'USA',
|
34
|
+
firstname: 'Gerard',
|
35
|
+
githubId : 'camtnbikerrwc',
|
36
|
+
lastname : 'Horan'
|
37
|
+
},
|
38
|
+
{
|
39
|
+
country : 'Slovakia',
|
40
|
+
firstname: 'Jozef',
|
41
|
+
githubId : 'jsakalos',
|
42
|
+
lastname : 'Sakalos'
|
43
|
+
},
|
44
|
+
{
|
45
|
+
country : 'Germany',
|
46
|
+
firstname: 'Bastian',
|
47
|
+
githubId : 'bhaustein',
|
48
|
+
lastname : 'Haustein'
|
49
|
+
}]
|
50
|
+
}}
|
51
|
+
}
|
52
|
+
|
53
|
+
Neo.applyClassConfig(MainStore);
|
54
|
+
|
55
|
+
export default MainStore;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<!DOCTYPE HTML>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
<title>Neo GridContainer</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<script src="../../../src/MicroLoader.mjs" type="module"></script>
|
10
|
+
</body>
|
11
|
+
</html>
|
@@ -10,16 +10,16 @@ class MainModel extends Model {
|
|
10
10
|
|
11
11
|
fields: [{
|
12
12
|
name: 'country',
|
13
|
-
type: '
|
13
|
+
type: 'String'
|
14
14
|
}, {
|
15
15
|
name: 'firstname',
|
16
|
-
type: '
|
16
|
+
type: 'String'
|
17
17
|
}, {
|
18
18
|
name: 'githubId',
|
19
|
-
type: '
|
19
|
+
type: 'String'
|
20
20
|
}, {
|
21
21
|
name: 'lastname',
|
22
|
-
type: '
|
22
|
+
type: 'String'
|
23
23
|
}]
|
24
24
|
}}
|
25
25
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "neo.mjs",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.2.1",
|
4
4
|
"description": "The webworkers driven UI framework",
|
5
5
|
"type": "module",
|
6
6
|
"repository": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"neo-cc": "./buildScripts/createClass.mjs"
|
12
12
|
},
|
13
13
|
"scripts": {
|
14
|
+
"add-config": "node ./buildScripts/addConfig.mjs",
|
14
15
|
"build-all": "node ./buildScripts/buildAll.mjs -f -n",
|
15
16
|
"build-all-questions": "node ./buildScripts/buildAll.mjs -f",
|
16
17
|
"build-my-apps": "node ./buildScripts/webpack/buildMyApps.mjs -f",
|
@@ -50,11 +51,11 @@
|
|
50
51
|
"envinfo": "^7.8.1",
|
51
52
|
"fs-extra": "^10.1.0",
|
52
53
|
"highlightjs-line-numbers.js": "^2.8.0",
|
53
|
-
"inquirer": "^9.1.
|
54
|
+
"inquirer": "^9.1.1",
|
54
55
|
"neo-jsdoc": "^1.0.1",
|
55
56
|
"neo-jsdoc-x": "^1.0.4",
|
56
57
|
"postcss": "^8.4.16",
|
57
|
-
"sass": "^1.54.
|
58
|
+
"sass": "^1.54.8",
|
58
59
|
"webpack": "^5.74.0",
|
59
60
|
"webpack-cli": "^4.10.0",
|
60
61
|
"webpack-dev-server": "4.10.1",
|
@@ -1,11 +1,12 @@
|
|
1
1
|
.neo-grid-container {
|
2
2
|
border : 1px solid v(grid-container-border-color);
|
3
3
|
border-spacing: 0;
|
4
|
+
color : v(grid-container-color);
|
4
5
|
font-size : 13px;
|
5
6
|
font-weight : 400;
|
6
7
|
height : 100%;
|
7
8
|
line-height : 19px;
|
8
|
-
overflow :
|
9
|
+
overflow : auto;
|
9
10
|
|
10
11
|
.neo-grid-row {
|
11
12
|
display : flex;
|
@@ -32,7 +33,7 @@
|
|
32
33
|
|
33
34
|
.neo-grid-row:nth-child(even) {
|
34
35
|
.neo-grid-cell {
|
35
|
-
background-color:
|
36
|
+
background-color: v(grid-container-cell-background-color-even);
|
36
37
|
}
|
37
38
|
}
|
38
39
|
|
@@ -56,8 +57,8 @@
|
|
56
57
|
}
|
57
58
|
|
58
59
|
.neo-grid-cell, .neo-grid-header-cell {
|
59
|
-
border-bottom: 1px solid
|
60
|
-
border-right : 1px solid
|
60
|
+
border-bottom: 1px solid v(grid-container-border-color);
|
61
|
+
border-right : 1px solid v(grid-container-border-color);
|
61
62
|
height : inherit;
|
62
63
|
min-width : 300px;
|
63
64
|
|
@@ -73,7 +74,7 @@
|
|
73
74
|
|
74
75
|
.neo-grid-cell {
|
75
76
|
align-items : center;
|
76
|
-
background-color:
|
77
|
+
background-color: v(grid-container-cell-background-color);
|
77
78
|
display : flex;
|
78
79
|
height : 32px !important;
|
79
80
|
max-height : 32px !important;
|
@@ -20,6 +20,12 @@
|
|
20
20
|
border-right: 1px solid v(grid-container-border-color);
|
21
21
|
}
|
22
22
|
|
23
|
+
&.neo-locked { // todo: for testing, will get removed once the header toolbar is outside of the scroll region
|
24
|
+
position: sticky;
|
25
|
+
top : 0;
|
26
|
+
z-index : 5001;
|
27
|
+
}
|
28
|
+
|
23
29
|
&.neo-drag-over {
|
24
30
|
background-image: linear-gradient(green, darkgreen);;
|
25
31
|
}
|
package/src/grid/View.mjs
CHANGED
@@ -41,7 +41,7 @@ class View extends Component {
|
|
41
41
|
|
42
42
|
// console.log('createViewData', me.id, inputData);
|
43
43
|
|
44
|
-
if (container.selectionModel?.ntype === 'selection-
|
44
|
+
if (container.selectionModel?.ntype === 'selection-grid-rowmodel') {
|
45
45
|
selectedRows = container.selectionModel.items || [];
|
46
46
|
}
|
47
47
|
|
@@ -120,7 +120,7 @@ class View extends Component {
|
|
120
120
|
|
121
121
|
if (column.dock === 'left') {
|
122
122
|
config.style.left = dockLeftMargin + 'px';
|
123
|
-
dockLeftMargin +=
|
123
|
+
dockLeftMargin += column.width;
|
124
124
|
}
|
125
125
|
}
|
126
126
|
|
@@ -16,6 +16,16 @@ class Button extends BaseButton {
|
|
16
16
|
*/
|
17
17
|
field = null
|
18
18
|
|
19
|
+
static getStaticConfig() {return {
|
20
|
+
/**
|
21
|
+
* Valid values for align
|
22
|
+
* @member {String[]} alignValues: ['left', 'center', 'right']
|
23
|
+
* @protected
|
24
|
+
* @static
|
25
|
+
*/
|
26
|
+
alignValues: ['left', 'center', 'right']
|
27
|
+
}}
|
28
|
+
|
19
29
|
static getConfig() {return {
|
20
30
|
/**
|
21
31
|
* @member {String} className='Neo.grid.header.Button'
|
@@ -27,6 +37,11 @@ class Button extends BaseButton {
|
|
27
37
|
* @protected
|
28
38
|
*/
|
29
39
|
ntype: 'grid-header-button',
|
40
|
+
/**
|
41
|
+
* Alignment of the matching table cells. Valid values are left, center, right
|
42
|
+
* @member {String} align_='left'
|
43
|
+
*/
|
44
|
+
align_: 'left',
|
30
45
|
/**
|
31
46
|
* @member {String[]} cls=['neo-grid-header-button']
|
32
47
|
*/
|
@@ -98,6 +113,16 @@ class Button extends BaseButton {
|
|
98
113
|
});
|
99
114
|
}
|
100
115
|
|
116
|
+
/**
|
117
|
+
* Triggered before the align config gets changed
|
118
|
+
* @param {String} value
|
119
|
+
* @param {String} oldValue
|
120
|
+
* @protected
|
121
|
+
*/
|
122
|
+
beforeSetAlign(value, oldValue) {
|
123
|
+
return this.beforeSetEnumValue(value, oldValue, 'align', 'alignValues');
|
124
|
+
}
|
125
|
+
|
101
126
|
/**
|
102
127
|
* @protected
|
103
128
|
*/
|
@@ -66,13 +66,13 @@ class CellColumnModel extends CellModel {
|
|
66
66
|
* @param {Object} data
|
67
67
|
*/
|
68
68
|
onCellClick(data) {
|
69
|
-
let me
|
70
|
-
id
|
69
|
+
let me = this,
|
70
|
+
id = ColumnModel.getCellId(data.path),
|
71
71
|
columnNodeIds, index, tbodyNode;
|
72
72
|
|
73
73
|
if (id) {
|
74
74
|
index = ColumnModel.getColumnIndex(id, me.view.items[0].items);
|
75
|
-
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {
|
75
|
+
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {cls: 'neo-grid-view'}).vdom;
|
76
76
|
columnNodeIds = VDomUtil.getColumnNodesIds(tbodyNode, index);
|
77
77
|
|
78
78
|
me.deselectAllCells(true);
|
@@ -91,15 +91,15 @@ class CellColumnModel extends CellModel {
|
|
91
91
|
idArray = ColumnModel.getCellId(data.path).split('__'),
|
92
92
|
currentColumn = idArray[2],
|
93
93
|
view = me.view,
|
94
|
-
|
95
|
-
newIndex = (
|
94
|
+
fields = view.columns.map(c => c.field),
|
95
|
+
newIndex = (fields.indexOf(currentColumn) + step) % fields.length,
|
96
96
|
columnNodeIds, tbodyNode;
|
97
97
|
|
98
98
|
while (newIndex < 0) {
|
99
|
-
newIndex +=
|
99
|
+
newIndex += fields.length;
|
100
100
|
}
|
101
101
|
|
102
|
-
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {
|
102
|
+
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {cls: 'neo-grid-view'}).vdom;
|
103
103
|
columnNodeIds = VDomUtil.getColumnNodesIds(tbodyNode, newIndex);
|
104
104
|
|
105
105
|
me.deselectAllCells(true);
|
@@ -72,7 +72,7 @@ class CellColumnRowModel extends CellRowModel {
|
|
72
72
|
|
73
73
|
if (id) {
|
74
74
|
index = ColumnModel.getColumnIndex(id, me.view.items[0].items);
|
75
|
-
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {
|
75
|
+
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {cls: 'neo-grid-view'}).vdom;
|
76
76
|
columnNodeIds = VDomUtil.getColumnNodesIds(tbodyNode, index);
|
77
77
|
|
78
78
|
me.deselectAllCells(true);
|
@@ -91,15 +91,15 @@ class CellColumnRowModel extends CellRowModel {
|
|
91
91
|
idArray = ColumnModel.getCellId(data.path).split('__'),
|
92
92
|
currentColumn = idArray[2],
|
93
93
|
view = me.view,
|
94
|
-
|
95
|
-
newIndex = (
|
94
|
+
fields = view.columns.map(c => c.field),
|
95
|
+
newIndex = (fields.indexOf(currentColumn) + step) % fields.length,
|
96
96
|
columnNodeIds, tbodyNode;
|
97
97
|
|
98
98
|
while (newIndex < 0) {
|
99
|
-
newIndex +=
|
99
|
+
newIndex += fields.length;
|
100
100
|
}
|
101
101
|
|
102
|
-
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {
|
102
|
+
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {cls: 'neo-grid-view'}).vdom;
|
103
103
|
columnNodeIds = VDomUtil.getColumnNodesIds(tbodyNode, newIndex);
|
104
104
|
|
105
105
|
me.deselectAllCells(true);
|
@@ -45,21 +45,19 @@ class CellModel extends Model {
|
|
45
45
|
*/
|
46
46
|
onCellClick(data) {
|
47
47
|
let me = this,
|
48
|
-
id = null,
|
49
48
|
path = data.path,
|
50
49
|
i = 0,
|
51
|
-
len = path.length
|
50
|
+
len = path.length,
|
51
|
+
id;
|
52
52
|
|
53
53
|
for (; i < len; i++) {
|
54
|
-
if (path[i].
|
54
|
+
if (path[i].cls.includes('neo-grid-cell')) {
|
55
55
|
id = path[i].id;
|
56
56
|
break;
|
57
57
|
}
|
58
58
|
}
|
59
59
|
|
60
|
-
|
61
|
-
me.toggleSelection(id);
|
62
|
-
}
|
60
|
+
id && me.toggleSelection(id);
|
63
61
|
}
|
64
62
|
|
65
63
|
/**
|
@@ -99,7 +97,7 @@ class CellModel extends Model {
|
|
99
97
|
view = me.view,
|
100
98
|
idArray = data.path[0].id.split('__'),
|
101
99
|
currentColumn = idArray[2],
|
102
|
-
dataFields = view.columns.map(c => c.
|
100
|
+
dataFields = view.columns.map(c => c.field),
|
103
101
|
newIndex = (dataFields.indexOf(currentColumn) + step) % dataFields.length,
|
104
102
|
id;
|
105
103
|
|
@@ -148,14 +146,12 @@ class CellModel extends Model {
|
|
148
146
|
id = me.id,
|
149
147
|
view = me.view;
|
150
148
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
);
|
158
|
-
}
|
149
|
+
view.keys?._keys.push(
|
150
|
+
{fn: 'onKeyDownDown' ,key: 'Down' ,scope: id},
|
151
|
+
{fn: 'onKeyDownLeft' ,key: 'Left' ,scope: id},
|
152
|
+
{fn: 'onKeyDownRight' ,key: 'Right' ,scope: id},
|
153
|
+
{fn: 'onKeyDownUp' ,key: 'Up' ,scope: id}
|
154
|
+
);
|
159
155
|
}
|
160
156
|
|
161
157
|
/**
|
@@ -166,14 +162,12 @@ class CellModel extends Model {
|
|
166
162
|
id = me.id,
|
167
163
|
view = me.view;
|
168
164
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
]);
|
176
|
-
}
|
165
|
+
view.keys?.removeKeys([
|
166
|
+
{fn: 'onKeyDownDown' ,key: 'Down' ,scope: id},
|
167
|
+
{fn: 'onKeyDownLeft' ,key: 'Left' ,scope: id},
|
168
|
+
{fn: 'onKeyDownRight' ,key: 'Right' ,scope: id},
|
169
|
+
{fn: 'onKeyDownUp' ,key: 'Up' ,scope: id}
|
170
|
+
]);
|
177
171
|
|
178
172
|
super.unregister();
|
179
173
|
}
|