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
@@ -51,7 +51,7 @@ class ColumnModel extends Model {
|
|
51
51
|
len = eventPath.length;
|
52
52
|
|
53
53
|
for (; i < len; i++) {
|
54
|
-
if (eventPath[i].
|
54
|
+
if (eventPath[i].cls.includes('neo-grid-cell')) {
|
55
55
|
id = eventPath[i].id;
|
56
56
|
break;
|
57
57
|
}
|
@@ -61,15 +61,15 @@ class ColumnModel extends Model {
|
|
61
61
|
}
|
62
62
|
|
63
63
|
/**
|
64
|
-
* todo: move to
|
64
|
+
* todo: move to grid.Container or view
|
65
65
|
* @param {String} cellId
|
66
|
-
* @param {
|
66
|
+
* @param {Object[]} columns
|
67
67
|
* @returns {Number} index
|
68
68
|
*/
|
69
69
|
static getColumnIndex(cellId, columns) {
|
70
70
|
let idArray = cellId.split('__'),
|
71
71
|
currentColumn = idArray[2],
|
72
|
-
dataFields = columns.map(c => c.
|
72
|
+
dataFields = columns.map(c => c.field);
|
73
73
|
|
74
74
|
return dataFields.indexOf(currentColumn);
|
75
75
|
}
|
@@ -78,13 +78,13 @@ class ColumnModel extends Model {
|
|
78
78
|
* @param {Object} data
|
79
79
|
*/
|
80
80
|
onCellClick(data) {
|
81
|
-
let me
|
82
|
-
id
|
81
|
+
let me = this,
|
82
|
+
id = ColumnModel.getCellId(data.path),
|
83
83
|
columnNodeIds, index, tbodyNode;
|
84
84
|
|
85
85
|
if (id) {
|
86
86
|
index = ColumnModel.getColumnIndex(id, me.view.items[0].items);
|
87
|
-
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {
|
87
|
+
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {cls: 'neo-grid-view'}).vdom;
|
88
88
|
columnNodeIds = VDomUtil.getColumnNodesIds(tbodyNode, index);
|
89
89
|
|
90
90
|
me.select(columnNodeIds);
|
@@ -114,18 +114,18 @@ class ColumnModel extends Model {
|
|
114
114
|
idArray = ColumnModel.getCellId(data.path).split('__'),
|
115
115
|
currentColumn = idArray[2],
|
116
116
|
view = me.view,
|
117
|
-
|
118
|
-
newIndex = (
|
117
|
+
fields = view.columns.map(c => c.field),
|
118
|
+
newIndex = (fields.indexOf(currentColumn) + step) % fields.length,
|
119
119
|
columnNodeIds, id, tbodyNode;
|
120
120
|
|
121
121
|
while (newIndex < 0) {
|
122
|
-
newIndex +=
|
122
|
+
newIndex += fields.length;
|
123
123
|
}
|
124
124
|
|
125
|
-
idArray[2] =
|
125
|
+
idArray[2] = fields[newIndex];
|
126
126
|
id = idArray.join('__');
|
127
127
|
|
128
|
-
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {
|
128
|
+
tbodyNode = VDomUtil.findVdomChild(me.view.vdom, {cls: 'neo-grid-view'}).vdom;
|
129
129
|
columnNodeIds = VDomUtil.getColumnNodesIds(tbodyNode, newIndex);
|
130
130
|
|
131
131
|
me.select(columnNodeIds);
|
@@ -142,17 +142,15 @@ class ColumnModel extends Model {
|
|
142
142
|
id = me.id,
|
143
143
|
view = me.view;
|
144
144
|
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
});
|
155
|
-
}
|
145
|
+
view.keys?._keys.push({
|
146
|
+
fn : 'onKeyDownLeft',
|
147
|
+
key : 'Left',
|
148
|
+
scope: id
|
149
|
+
}, {
|
150
|
+
fn : 'onKeyDownRight',
|
151
|
+
key : 'Right',
|
152
|
+
scope: id
|
153
|
+
});
|
156
154
|
}
|
157
155
|
|
158
156
|
|
@@ -164,17 +162,15 @@ class ColumnModel extends Model {
|
|
164
162
|
id = me.id,
|
165
163
|
view = me.view;
|
166
164
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
}]);
|
177
|
-
}
|
165
|
+
view.keys?.removeKeys([{
|
166
|
+
fn : 'onKeyDownLeft',
|
167
|
+
key : 'Left',
|
168
|
+
scope: id
|
169
|
+
}, {
|
170
|
+
fn : 'onKeyDownRight',
|
171
|
+
key : 'Right',
|
172
|
+
scope: id
|
173
|
+
}]);
|
178
174
|
|
179
175
|
super.unregister();
|
180
176
|
}
|