neo.mjs 5.14.3 → 5.15.0
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/examples/ServiceWorker.mjs +2 -2
- package/examples/component/wrapper/googleMaps/MapComponent.mjs +89 -81
- package/examples/component/wrapper/googleMaps/MarkerDialog.mjs +2 -2
- package/examples/form/field/fileupload/MainContainer.mjs +45 -0
- package/examples/form/field/fileupload/app.mjs +6 -0
- package/examples/form/field/fileupload/index.html +11 -0
- package/examples/form/field/fileupload/neo-config.json +6 -0
- package/examples/form/field/select/MainContainer.mjs +1 -1
- package/package.json +1 -1
- package/resources/scss/src/form/field/FileUpload.scss +4 -0
- package/resources/scss/src/tree/List.scss +4 -0
- package/resources/scss/theme-dark/form/field/FileUpload.scss +11 -0
- package/resources/scss/theme-light/form/field/FileUpload.scss +11 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/component/Base.mjs +205 -182
- package/src/component/wrapper/GoogleMaps.mjs +10 -24
- package/src/container/Base.mjs +20 -0
- package/src/form/field/FileUpload.mjs +34 -0
- package/src/menu/List.mjs +4 -11
- package/src/selection/ListModel.mjs +7 -7
- package/src/selection/TreeModel.mjs +39 -0
- package/src/tree/List.mjs +20 -7
@@ -35,10 +35,9 @@ class GoogleMaps extends Base {
|
|
35
35
|
type: 'Object'
|
36
36
|
}, {
|
37
37
|
name: 'icon',
|
38
|
-
type: '
|
38
|
+
type: 'Object'
|
39
39
|
}, {
|
40
|
-
name: 'id'
|
41
|
-
type: 'String'
|
40
|
+
name: 'id'
|
42
41
|
}, {
|
43
42
|
name: 'label',
|
44
43
|
type: 'String'
|
@@ -70,27 +69,27 @@ class GoogleMaps extends Base {
|
|
70
69
|
* Internal flag. Gets set to true once Neo.main.addon.GoogleMaps.create() is finished.
|
71
70
|
* @member {Boolean} mapCreated=false
|
72
71
|
*/
|
73
|
-
mapCreated
|
72
|
+
mapCreated = false
|
74
73
|
/**
|
75
74
|
* Pass any options to the map instance which are not explicitly defined here
|
76
75
|
* @member {Object} mapOptions={}
|
77
76
|
*/
|
78
|
-
mapOptions
|
77
|
+
mapOptions = {}
|
79
78
|
/**
|
80
79
|
* null => the maximum zoom from the current map type is used instead
|
81
80
|
* @member {Number|null} maxZoom=null
|
82
81
|
*/
|
83
|
-
maxZoom
|
82
|
+
maxZoom = null
|
84
83
|
/**
|
85
84
|
null => the minimum zoom from the current map type is used instead
|
86
85
|
* @member {Number|null} minZoom=null
|
87
86
|
*/
|
88
|
-
minZoom
|
87
|
+
minZoom = null
|
89
88
|
/**
|
90
89
|
* false hides the default zoom control
|
91
90
|
* @member {Boolean} zoomControl=true
|
92
91
|
*/
|
93
|
-
zoomControl
|
92
|
+
zoomControl = true
|
94
93
|
|
95
94
|
/**
|
96
95
|
* @param {Object} config
|
@@ -215,10 +214,7 @@ class GoogleMaps extends Base {
|
|
215
214
|
value
|
216
215
|
});
|
217
216
|
|
218
|
-
me.fire('zoomChange', {
|
219
|
-
id: me.id,
|
220
|
-
value
|
221
|
-
})
|
217
|
+
me.fire('zoomChange', {id: me.id, value})
|
222
218
|
}
|
223
219
|
}
|
224
220
|
|
@@ -267,13 +263,6 @@ class GoogleMaps extends Base {
|
|
267
263
|
this.zoom = data.value
|
268
264
|
}
|
269
265
|
|
270
|
-
/**
|
271
|
-
* @param {Object} record
|
272
|
-
*/
|
273
|
-
onMarkerClick(record) {
|
274
|
-
console.log('onMarkerClick', record)
|
275
|
-
}
|
276
|
-
|
277
266
|
/**
|
278
267
|
*
|
279
268
|
*/
|
@@ -317,12 +306,9 @@ class GoogleMaps extends Base {
|
|
317
306
|
|
318
307
|
data.record = me.markerStore.get(data.id);
|
319
308
|
|
320
|
-
me.onMarkerClick(data);
|
309
|
+
me.onMarkerClick?.(data);
|
321
310
|
|
322
|
-
me.fire('markerClick', {
|
323
|
-
id: me.id,
|
324
|
-
data
|
325
|
-
})
|
311
|
+
me.fire('markerClick', {id: me.id, data})
|
326
312
|
}
|
327
313
|
|
328
314
|
/**
|
package/src/container/Base.mjs
CHANGED
@@ -152,6 +152,26 @@ class Base extends Component {
|
|
152
152
|
}
|
153
153
|
}
|
154
154
|
|
155
|
+
/**
|
156
|
+
* Triggered after the needsVdomUpdate config got changed
|
157
|
+
* @param {Boolean} value
|
158
|
+
* @param {Boolean} oldValue
|
159
|
+
* @protected
|
160
|
+
*/
|
161
|
+
afterSetNeedsVdomUpdate(value, oldValue) {
|
162
|
+
if (!value) {
|
163
|
+
this.items?.forEach(item => {
|
164
|
+
// check for e.g. Toolbar items like '->'
|
165
|
+
if (typeof item !== 'string') {
|
166
|
+
// we can not set the config directly => it could already be false,
|
167
|
+
// and we still want to pass it further into subtrees
|
168
|
+
item._needsVdomUpdate = false;
|
169
|
+
item.afterSetNeedsVdomUpdate?.(false, true)
|
170
|
+
}
|
171
|
+
})
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
155
175
|
/**
|
156
176
|
* Triggered after the rendering config got changed
|
157
177
|
* @param {Boolean} value
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import Base from '../../form/field/Base.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Neo.form.field.FileUpload
|
5
|
+
* @extends Neo.form.field.Base
|
6
|
+
*/
|
7
|
+
class FileUpload extends Base {
|
8
|
+
static config = {
|
9
|
+
/**
|
10
|
+
* @member {String} className='Neo.form.field.FileUpload'
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
className: 'Neo.form.field.FileUpload',
|
14
|
+
/**
|
15
|
+
* @member {String} ntype='file-upload-field'
|
16
|
+
* @protected
|
17
|
+
*/
|
18
|
+
ntype: 'file-upload-field',
|
19
|
+
/**
|
20
|
+
* @member {String[]}} baseCls=['neo-file-upload-field']
|
21
|
+
* @protected
|
22
|
+
*/
|
23
|
+
baseCls: ['neo-file-upload-field'],
|
24
|
+
/**
|
25
|
+
* @member {Object}} _vdom
|
26
|
+
*/
|
27
|
+
_vdom:
|
28
|
+
{tag: 'input', type: 'file'}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
Neo.applyClassConfig(FileUpload);
|
33
|
+
|
34
|
+
export default FileUpload;
|
package/src/menu/List.mjs
CHANGED
@@ -342,14 +342,7 @@ class List extends BaseList {
|
|
342
342
|
onItemClick(node, data) {
|
343
343
|
super.onItemClick(node, data);
|
344
344
|
|
345
|
-
|
346
|
-
record = data.record;
|
347
|
-
|
348
|
-
record.handler?.call(me, record);
|
349
|
-
|
350
|
-
if (me.hideOnLeafItemClick && !record.items) {
|
351
|
-
me.unmount()
|
352
|
-
}
|
345
|
+
this.onKeyDownEnter(node.id)
|
353
346
|
}
|
354
347
|
|
355
348
|
/**
|
@@ -369,7 +362,7 @@ class List extends BaseList {
|
|
369
362
|
}
|
370
363
|
|
371
364
|
if (record.items) {
|
372
|
-
submenu = me.subMenuMap[me.getMenuMapId(recordId)];
|
365
|
+
submenu = me.subMenuMap?.[me.getMenuMapId(recordId)];
|
373
366
|
|
374
367
|
if (submenu) {
|
375
368
|
me.toggleSubMenu(nodeId, record)
|
@@ -456,9 +449,9 @@ class List extends BaseList {
|
|
456
449
|
toggleSubMenu(nodeId, record) {
|
457
450
|
let me = this,
|
458
451
|
recordId = record[me.getKeyProperty()],
|
459
|
-
submenu = me.subMenuMap[me.getMenuMapId(recordId)];
|
452
|
+
submenu = me.subMenuMap?.[me.getMenuMapId(recordId)];
|
460
453
|
|
461
|
-
if (!submenu
|
454
|
+
if (!submenu || !submenu.mounted) {
|
462
455
|
me.showSubMenu(nodeId, record)
|
463
456
|
} else {
|
464
457
|
me.hideSubMenu()
|
@@ -102,7 +102,7 @@ class ListModel extends Model {
|
|
102
102
|
} else {
|
103
103
|
preventSelection = true;
|
104
104
|
me.deselectAll();
|
105
|
-
view.fire('selectPreFirstItem')
|
105
|
+
view.fire('selectPreFirstItem')
|
106
106
|
}
|
107
107
|
} else if (index >= maxItems) {
|
108
108
|
if (me.stayInList) {
|
@@ -114,11 +114,11 @@ class ListModel extends Model {
|
|
114
114
|
} else {
|
115
115
|
preventSelection = true;
|
116
116
|
me.deselectAll();
|
117
|
-
view.fire('selectPostLastItem')
|
117
|
+
view.fire('selectPostLastItem')
|
118
118
|
}
|
119
119
|
}
|
120
120
|
} else {
|
121
|
-
index = 0
|
121
|
+
index = 0
|
122
122
|
}
|
123
123
|
|
124
124
|
if (!preventSelection) {
|
@@ -127,7 +127,7 @@ class ListModel extends Model {
|
|
127
127
|
|
128
128
|
me.select(itemId);
|
129
129
|
view.focus(itemId);
|
130
|
-
view.fire('itemNavigate', record)
|
130
|
+
view.fire('itemNavigate', record)
|
131
131
|
}
|
132
132
|
}
|
133
133
|
|
@@ -148,7 +148,7 @@ class ListModel extends Model {
|
|
148
148
|
{fn: 'onKeyDownLeft' ,key: 'Left' ,scope: id},
|
149
149
|
{fn: 'onKeyDownRight' ,key: 'Right' ,scope: id},
|
150
150
|
{fn: 'onKeyDownUp' ,key: 'Up' ,scope: id}
|
151
|
-
)
|
151
|
+
)
|
152
152
|
}
|
153
153
|
|
154
154
|
/**
|
@@ -161,7 +161,7 @@ class ListModel extends Model {
|
|
161
161
|
|
162
162
|
if (itemId) {
|
163
163
|
this.select(itemId);
|
164
|
-
view.focus(itemId)
|
164
|
+
view.focus(itemId)
|
165
165
|
}
|
166
166
|
}
|
167
167
|
|
@@ -182,7 +182,7 @@ class ListModel extends Model {
|
|
182
182
|
{fn: 'onKeyDownUp' ,key: 'Up' ,scope: id}
|
183
183
|
]);
|
184
184
|
|
185
|
-
super.unregister()
|
185
|
+
super.unregister()
|
186
186
|
}
|
187
187
|
}
|
188
188
|
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import ListModel from './ListModel.mjs';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @class Neo.selection.TreeModel
|
5
|
+
* @extends Neo.selection.ListModel
|
6
|
+
*/
|
7
|
+
class TreeModel extends ListModel {
|
8
|
+
static config = {
|
9
|
+
/**
|
10
|
+
* @member {String} className='Neo.selection.TreeModel'
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
className: 'Neo.selection.TreeModel',
|
14
|
+
/**
|
15
|
+
* @member {String} ntype='selection-treemodel'
|
16
|
+
* @protected
|
17
|
+
*/
|
18
|
+
ntype: 'selection-treemodel'
|
19
|
+
}
|
20
|
+
|
21
|
+
/**
|
22
|
+
* @param {Object} data
|
23
|
+
*/
|
24
|
+
onKeyDownEnter(data) {
|
25
|
+
console.log('onKeyDownEnter', data)
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
* @param {Object} data
|
30
|
+
* @param {Number} step
|
31
|
+
*/
|
32
|
+
onNavKey(data, step) {
|
33
|
+
console.log('onNavKey', data, step)
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
Neo.applyClassConfig(TreeModel);
|
38
|
+
|
39
|
+
export default TreeModel;
|
package/src/tree/List.mjs
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
import Base
|
2
|
-
import
|
3
|
-
import
|
1
|
+
import Base from '../list/Base.mjs';
|
2
|
+
import ClassSystemUtil from '../util/ClassSystem.mjs';
|
3
|
+
import Collection from '../collection/Base.mjs';
|
4
|
+
import NeoArray from '../util/Array.mjs';
|
5
|
+
import TreeModel from '../selection/TreeModel.mjs';
|
4
6
|
|
5
7
|
/**
|
6
8
|
* @class Neo.tree.List
|
@@ -23,10 +25,9 @@ class Tree extends Base {
|
|
23
25
|
*/
|
24
26
|
baseCls: ['neo-tree-list'],
|
25
27
|
/**
|
26
|
-
*
|
27
|
-
* @member {Boolean} disableSelection=true
|
28
|
+
* @member {Boolean} disableSelection=false
|
28
29
|
*/
|
29
|
-
disableSelection:
|
30
|
+
disableSelection: false,
|
30
31
|
/**
|
31
32
|
* @member {Neo.draggable.tree.DragZone|null} dragZone=null
|
32
33
|
*/
|
@@ -56,7 +57,7 @@ class Tree extends Base {
|
|
56
57
|
*/
|
57
58
|
_vdom:
|
58
59
|
{cn: [
|
59
|
-
{tag: 'ul', cls: ['neo-list-container', 'neo-list'], cn: []}
|
60
|
+
{tag: 'ul', cls: ['neo-list-container', 'neo-list'], tabIndex: -1, cn: []}
|
60
61
|
]}
|
61
62
|
}
|
62
63
|
|
@@ -111,6 +112,18 @@ class Tree extends Base {
|
|
111
112
|
}
|
112
113
|
}
|
113
114
|
|
115
|
+
/**
|
116
|
+
* Triggered before the selectionModel config gets changed.
|
117
|
+
* @param {Neo.selection.Model} value
|
118
|
+
* @param {Neo.selection.Model} oldValue
|
119
|
+
* @returns {Neo.selection.Model}
|
120
|
+
* @protected
|
121
|
+
*/
|
122
|
+
beforeSetSelectionModel(value, oldValue) {
|
123
|
+
oldValue?.destroy();
|
124
|
+
return ClassSystemUtil.beforeSetInstance(value, TreeModel);
|
125
|
+
}
|
126
|
+
|
114
127
|
/**
|
115
128
|
* Triggered before the store config gets changed.
|
116
129
|
* @param {Object|Neo.data.Store} value
|