neo.mjs 8.42.0 → 8.43.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/ServiceWorker.mjs +2 -2
- package/apps/colors/view/BarChartComponent.mjs +1 -1
- package/apps/colors/view/{TableContainer.mjs → GridContainer.mjs} +21 -22
- package/apps/colors/view/HeaderToolbar.mjs +3 -3
- package/apps/colors/view/Viewport.mjs +5 -3
- package/apps/colors/view/ViewportController.mjs +10 -10
- package/apps/covid/neo-config.json +2 -1
- package/apps/covid/view/MainContainerController.mjs +47 -39
- package/apps/covid/view/TableContainerController.mjs +20 -4
- package/apps/covid/view/country/Table.mjs +3 -3
- package/apps/portal/index.html +1 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/apps/sharedcovid/neo-config.json +1 -0
- package/apps/sharedcovid/view/MainContainerController.mjs +58 -50
- package/apps/sharedcovid/view/TableContainerController.mjs +20 -3
- package/apps/sharedcovid/view/country/Table.mjs +3 -2
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/component/coronaGallery/Viewport.mjs +4 -2
- package/examples/component/coronaGallery/neo-config.json +2 -1
- package/examples/component/coronaHelix/MainContainer.mjs +4 -2
- package/examples/component/coronaHelix/neo-config.json +2 -1
- package/examples/component/multiWindowCoronaGallery/neo-config.json +1 -0
- package/examples/component/toast/MainContainer.mjs +1 -0
- package/examples/component/toast/MainContainerController.mjs +3 -1
- package/examples/grid/animatedRowSorting/Viewport.mjs +4 -3
- package/examples/grid/cellEditing/MainContainer.mjs +6 -5
- package/examples/grid/nestedRecordFields/Viewport.mjs +1 -14
- package/examples/grid/nestedRecordFields/ViewportController.mjs +23 -0
- package/package.json +1 -1
- package/resources/scss/src/apps/colors/GridContainer.scss +68 -0
- package/resources/scss/src/grid/header/Toolbar.scss +2 -1
- package/src/DefaultConfig.mjs +2 -2
- package/src/component/Toast.mjs +5 -4
- package/src/component/wrapper/AmChart.mjs +1 -1
- package/src/controller/Component.mjs +12 -4
- package/src/draggable/toolbar/SortZone.mjs +12 -9
- package/src/grid/Container.mjs +4 -2
- package/src/grid/VerticalScrollbar.mjs +3 -2
- package/src/grid/column/Base.mjs +2 -1
- package/src/grid/column/Component.mjs +5 -3
- package/src/selection/Model.mjs +4 -0
- package/src/table/Container.mjs +1 -2
- package/resources/scss/src/apps/colors/TableContainer.scss +0 -66
@@ -0,0 +1,68 @@
|
|
1
|
+
@use "sass:color";
|
2
|
+
|
3
|
+
$base-color: #1c60a0;
|
4
|
+
|
5
|
+
.colors-grid-container.neo-grid-container {
|
6
|
+
width: 100%;
|
7
|
+
|
8
|
+
.neo-grid-header-toolbar {
|
9
|
+
.neo-grid-header-button {
|
10
|
+
&:not(:first-child) {
|
11
|
+
width: 10%;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
.neo-grid-row .neo-grid-cell {
|
17
|
+
&.color-1 {
|
18
|
+
background-color: $base-color;
|
19
|
+
}
|
20
|
+
|
21
|
+
&.color-2 {
|
22
|
+
background-color: color.adjust($base-color, $lightness: 5%);
|
23
|
+
}
|
24
|
+
|
25
|
+
&.color-3 {
|
26
|
+
background-color: color.adjust($base-color, $lightness: 10%);
|
27
|
+
}
|
28
|
+
|
29
|
+
&.color-4 {
|
30
|
+
background-color: color.adjust($base-color, $lightness: 15%);
|
31
|
+
}
|
32
|
+
|
33
|
+
&.color-5 {
|
34
|
+
background-color: color.adjust($base-color, $lightness: 20%);
|
35
|
+
}
|
36
|
+
|
37
|
+
&.color-6 {
|
38
|
+
background-color: color.adjust($base-color, $lightness: 25%);
|
39
|
+
}
|
40
|
+
|
41
|
+
&.color-7 {
|
42
|
+
background-color: color.adjust($base-color, $lightness: 30%);
|
43
|
+
}
|
44
|
+
|
45
|
+
&.color-8 {
|
46
|
+
background-color: color.adjust($base-color, $lightness: 35%);
|
47
|
+
}
|
48
|
+
|
49
|
+
&.color-9 {
|
50
|
+
background-color: color.adjust($base-color, $lightness: 40%);
|
51
|
+
}
|
52
|
+
|
53
|
+
&.color-10 {
|
54
|
+
background-color: color.adjust($base-color, $lightness: 45%);
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
.neo-grid-view {
|
59
|
+
.neo-grid-row {
|
60
|
+
&:hover {
|
61
|
+
.neo-grid-cell {
|
62
|
+
background-color: #d0aa72;
|
63
|
+
color : #2b2b2b;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
package/src/DefaultConfig.mjs
CHANGED
@@ -263,12 +263,12 @@ const DefaultConfig = {
|
|
263
263
|
useVdomWorker: true,
|
264
264
|
/**
|
265
265
|
* buildScripts/injectPackageVersion.mjs will update this value
|
266
|
-
* @default '8.
|
266
|
+
* @default '8.43.1'
|
267
267
|
* @memberOf! module:Neo
|
268
268
|
* @name config.version
|
269
269
|
* @type String
|
270
270
|
*/
|
271
|
-
version: '8.
|
271
|
+
version: '8.43.1'
|
272
272
|
};
|
273
273
|
|
274
274
|
Object.assign(DefaultConfig, {
|
package/src/component/Toast.mjs
CHANGED
@@ -11,6 +11,7 @@ import ToastManager from '../manager/Toast.mjs';
|
|
11
11
|
// mandatory
|
12
12
|
appName : this.component.appName,
|
13
13
|
msg : 'Alarm was set to 11:30 for journey into Neo development',
|
14
|
+
windowId : this.component.windowId
|
14
15
|
// optional defaults
|
15
16
|
closable : true, // false
|
16
17
|
iconCls : 'fa fa-bell', // null
|
@@ -102,16 +103,16 @@ class Toast extends Component {
|
|
102
103
|
* @member {String|null} title=null
|
103
104
|
*/
|
104
105
|
vdom:
|
105
|
-
{cn: [
|
106
|
-
cls: 'neo-toast-inner', cn: [
|
106
|
+
{cn: [
|
107
|
+
{cls: 'neo-toast-inner', cn: [
|
107
108
|
{cls: ['neo-toast-icon'], removeDom: true},
|
108
109
|
{cls: 'neo-toast-text', cn: [
|
109
110
|
{cls: ['neo-toast-title'], removeDom: true},
|
110
111
|
{cls: 'neo-toast-msg'}
|
111
112
|
]},
|
112
113
|
{cls: ['neo-toast-close', 'fa', 'fa-close'], removeDom: true}
|
113
|
-
]
|
114
|
-
|
114
|
+
]}
|
115
|
+
]}
|
115
116
|
}
|
116
117
|
|
117
118
|
/**
|
@@ -54,7 +54,7 @@ class AmChart extends Component {
|
|
54
54
|
* @member {Object} _vdom
|
55
55
|
*/
|
56
56
|
_vdom:
|
57
|
-
{style: {position: 'relative'
|
57
|
+
{style: {position: 'relative'}, cn: [
|
58
58
|
{style: {position: 'absolute', height: '100%', width: '100%'}, cn: [
|
59
59
|
{style: {color:'red',height: '100%'}}
|
60
60
|
]}
|
@@ -167,10 +167,10 @@ class Component extends Base {
|
|
167
167
|
*/
|
168
168
|
parseConfig(component=this.component) {
|
169
169
|
let me = this,
|
170
|
-
{handler, listeners, reference, validator} = component,
|
170
|
+
{handler, listeners, reference, renderer, validator} = component,
|
171
171
|
eventHandler, handlerScope;
|
172
172
|
|
173
|
-
if (handler &&
|
173
|
+
if (handler && Neo.isString(handler)) {
|
174
174
|
handlerScope = me.getHandlerScope(handler, component);
|
175
175
|
|
176
176
|
// If the handler name was not resolved in the Component itself, bind it
|
@@ -192,7 +192,7 @@ class Component extends Base {
|
|
192
192
|
listeners[key].fn = handlerScope[eventHandler].bind(handlerScope)
|
193
193
|
}
|
194
194
|
} else {
|
195
|
-
value
|
195
|
+
value?.forEach?.(listener => {
|
196
196
|
if (Neo.isObject(listener) && listener.hasOwnProperty('fn') && Neo.isString(listener.fn)) {
|
197
197
|
eventHandler = listener.fn;
|
198
198
|
handlerScope = me.getHandlerScope(eventHandler, component);
|
@@ -208,7 +208,15 @@ class Component extends Base {
|
|
208
208
|
}
|
209
209
|
});
|
210
210
|
|
211
|
-
if (Neo.isString(
|
211
|
+
if (renderer && Neo.isString(renderer)) {
|
212
|
+
handlerScope = me.getHandlerScope(renderer);
|
213
|
+
|
214
|
+
if (handlerScope) {
|
215
|
+
component.renderer = handlerScope[renderer].bind(handlerScope)
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
if (validator && Neo.isString(validator)) {
|
212
220
|
handlerScope = me.getHandlerScope(validator);
|
213
221
|
|
214
222
|
if (!handlerScope) {
|
@@ -115,8 +115,9 @@ class SortZone extends DragZone {
|
|
115
115
|
await me.timeout(10);
|
116
116
|
|
117
117
|
if (owner.sortable) {
|
118
|
-
ownerStyle.height
|
119
|
-
ownerStyle.
|
118
|
+
ownerStyle.height = me.ownerStyle.height || null;
|
119
|
+
ownerStyle.minWidth = me.ownerStyle.minWidth || null;
|
120
|
+
ownerStyle.width = me.ownerStyle.width || null;
|
120
121
|
|
121
122
|
owner.style = ownerStyle;
|
122
123
|
|
@@ -254,7 +255,7 @@ class SortZone extends DragZone {
|
|
254
255
|
dragElement : VDomUtil.find(owner.vdom, button.id).vdom,
|
255
256
|
dragProxyConfig : {...me.dragProxyConfig, cls: [...owner.cls]},
|
256
257
|
indexMap : indexMap,
|
257
|
-
ownerStyle : {height: ownerStyle.height, width: ownerStyle.width},
|
258
|
+
ownerStyle : {height: ownerStyle.height, minWidth: ownerStyle.minWidth, width: ownerStyle.width},
|
258
259
|
reversedLayoutDirection: layout.direction === 'column-reverse' || layout.direction === 'row-reverse',
|
259
260
|
sortDirection : layout.direction?.includes('column') ? 'vertical' : 'horizontal',
|
260
261
|
startIndex : index
|
@@ -274,12 +275,14 @@ class SortZone extends DragZone {
|
|
274
275
|
owner.getDomRect([owner.id].concat(owner.items.map(e => e.id))).then(itemRects => {
|
275
276
|
me.ownerRect = itemRects[0];
|
276
277
|
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
278
|
+
// The only reason we are adjusting the toolbar style is that there might be no min-height or min-width present.
|
279
|
+
// => Removing items from the layout could trigger a change in size otherwise
|
280
|
+
owner.style = {
|
281
|
+
...ownerStyle,
|
282
|
+
height : `${itemRects[0].height}px`,
|
283
|
+
minWidth: `${itemRects[0].width}px`,
|
284
|
+
width : `${itemRects[0].width}px`
|
285
|
+
};
|
283
286
|
|
284
287
|
itemRects.shift();
|
285
288
|
|
package/src/grid/Container.mjs
CHANGED
@@ -459,7 +459,9 @@ class GridContainer extends BaseContainer {
|
|
459
459
|
parent : me,
|
460
460
|
windowId: me.windowId,
|
461
461
|
...column
|
462
|
-
})
|
462
|
+
});
|
463
|
+
|
464
|
+
me.getController()?.parseConfig(columns[index])
|
463
465
|
});
|
464
466
|
|
465
467
|
me.items[0].items = headerButtons;
|
@@ -610,7 +612,7 @@ class GridContainer extends BaseContainer {
|
|
610
612
|
* @protected
|
611
613
|
*/
|
612
614
|
removeSortingCss(dataField) {
|
613
|
-
this.headerToolbar
|
615
|
+
this.headerToolbar?.items.forEach(column => {
|
614
616
|
if (column.dataField !== dataField) {
|
615
617
|
column.removeSortingCss()
|
616
618
|
}
|
@@ -95,8 +95,9 @@ class VerticalScrollbar extends Component {
|
|
95
95
|
let me = this;
|
96
96
|
|
97
97
|
value.on({
|
98
|
-
|
99
|
-
|
98
|
+
filter: me.updateScrollHeight,
|
99
|
+
load : me.updateScrollHeight,
|
100
|
+
scope : me
|
100
101
|
});
|
101
102
|
|
102
103
|
value.getCount() > 0 && me.updateScrollHeight()
|
package/src/grid/column/Base.mjs
CHANGED
@@ -59,7 +59,8 @@ class Column extends Base {
|
|
59
59
|
* @protected
|
60
60
|
*/
|
61
61
|
beforeSetRenderer(value, oldValue) {
|
62
|
-
return
|
62
|
+
// If no fn is found inside the parent tree, return the plain value for view controllers to match
|
63
|
+
return resolveCallback(value, this).fn || value
|
63
64
|
}
|
64
65
|
|
65
66
|
/**
|
@@ -104,12 +104,14 @@ class Component extends Column {
|
|
104
104
|
windowId
|
105
105
|
});
|
106
106
|
|
107
|
-
view.getController() ?.parseConfig(component);
|
108
|
-
view.getStateProvider()?.parseConfig(component);
|
109
|
-
|
110
107
|
me.map.set(id, component)
|
111
108
|
}
|
112
109
|
|
110
|
+
// The componentConfig can contain bindings into a view controller, e.g. a button handler = 'editButtonHandler'
|
111
|
+
// componentConfig.set(component) can revert these, so we need a parseConfig() for each change.
|
112
|
+
view.getController() ?.parseConfig(component);
|
113
|
+
view.getStateProvider()?.parseConfig(component);
|
114
|
+
|
113
115
|
view.updateDepth = -1;
|
114
116
|
|
115
117
|
return component.createVdomReference()
|
package/src/selection/Model.mjs
CHANGED
@@ -112,6 +112,9 @@ class Model extends Base {
|
|
112
112
|
if (!silent) {
|
113
113
|
view.update();
|
114
114
|
|
115
|
+
view.parent?.onDeselect?.(); // grid.Container & table.Container
|
116
|
+
view.onDeselect?.();
|
117
|
+
|
115
118
|
me.fire('selectionChange', {
|
116
119
|
selection: itemCollection
|
117
120
|
})
|
@@ -249,6 +252,7 @@ class Model extends Base {
|
|
249
252
|
view.update()
|
250
253
|
}
|
251
254
|
|
255
|
+
view.parent?.onSelect?.(items); // grid.Container & table.Container
|
252
256
|
view.onSelect?.(items);
|
253
257
|
|
254
258
|
me.fire('selectionChange', {
|
package/src/table/Container.mjs
CHANGED
@@ -311,8 +311,7 @@ class Container extends BaseContainer {
|
|
311
311
|
};
|
312
312
|
|
313
313
|
if (value instanceof Store) {
|
314
|
-
value.on(listeners)
|
315
|
-
value.getCount() > 0 && me.onStoreLoad(value.items)
|
314
|
+
value.on(listeners)
|
316
315
|
} else {
|
317
316
|
value = ClassSystemUtil.beforeSetInstance(value, Store, {
|
318
317
|
listeners
|
@@ -1,66 +0,0 @@
|
|
1
|
-
@use "sass:color";
|
2
|
-
|
3
|
-
$base-color: #1c60a0;
|
4
|
-
|
5
|
-
.colors-table-container.neo-table-container {
|
6
|
-
width: 100%;
|
7
|
-
|
8
|
-
.color-1 {
|
9
|
-
background-color: $base-color;
|
10
|
-
}
|
11
|
-
|
12
|
-
.color-2 {
|
13
|
-
background-color: color.adjust($base-color, $lightness: 5%);
|
14
|
-
}
|
15
|
-
|
16
|
-
.color-3 {
|
17
|
-
background-color: color.adjust($base-color, $lightness: 10%);
|
18
|
-
}
|
19
|
-
|
20
|
-
.color-4 {
|
21
|
-
background-color: color.adjust($base-color, $lightness: 15%);
|
22
|
-
}
|
23
|
-
|
24
|
-
.color-5 {
|
25
|
-
background-color: color.adjust($base-color, $lightness: 20%);
|
26
|
-
}
|
27
|
-
|
28
|
-
.color-6 {
|
29
|
-
background-color: color.adjust($base-color, $lightness: 25%);
|
30
|
-
}
|
31
|
-
|
32
|
-
.color-7 {
|
33
|
-
background-color: color.adjust($base-color, $lightness: 30%);
|
34
|
-
}
|
35
|
-
|
36
|
-
.color-8 {
|
37
|
-
background-color: color.adjust($base-color, $lightness: 35%);
|
38
|
-
}
|
39
|
-
|
40
|
-
.color-9 {
|
41
|
-
background-color: color.adjust($base-color, $lightness: 40%);
|
42
|
-
}
|
43
|
-
|
44
|
-
.color-10 {
|
45
|
-
background-color: color.adjust($base-color, $lightness: 45%);
|
46
|
-
}
|
47
|
-
|
48
|
-
.neo-index-column {
|
49
|
-
max-width: 40px;
|
50
|
-
min-width: 40px;
|
51
|
-
width : 40px;
|
52
|
-
}
|
53
|
-
|
54
|
-
.neo-table-view {
|
55
|
-
.neo-table-row {
|
56
|
-
&:hover .neo-table-cell {
|
57
|
-
background-color: #d0aa72;
|
58
|
-
color : #2b2b2b;
|
59
|
-
}
|
60
|
-
}
|
61
|
-
}
|
62
|
-
|
63
|
-
td, th {
|
64
|
-
min-width: 10%;
|
65
|
-
}
|
66
|
-
}
|