neo.mjs 8.17.1 → 8.18.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/portal/index.html +1 -1
- package/apps/portal/view/home/FooterContainer.mjs +1 -1
- package/examples/ServiceWorker.mjs +2 -2
- package/examples/grid/bigData/MainContainer.mjs +2 -0
- package/package.json +1 -1
- package/resources/scss/src/button/Base.scss +7 -0
- package/resources/scss/src/component/Base.scss +19 -22
- package/resources/scss/src/grid/Container.scss +20 -0
- package/src/DefaultConfig.mjs +2 -2
- package/src/component/Base.mjs +4 -4
- package/src/form/field/ComboBox.mjs +15 -17
- package/src/grid/View.mjs +14 -12
package/apps/ServiceWorker.mjs
CHANGED
package/apps/portal/index.html
CHANGED
@@ -89,6 +89,7 @@ class MainContainer extends Viewport {
|
|
89
89
|
*/
|
90
90
|
onAmountColumnsChange(data) {
|
91
91
|
if (data.oldValue) {
|
92
|
+
this.grid.isLoading = 'Is Loading';
|
92
93
|
this.grid.amountColumns = parseInt(data.value.id)
|
93
94
|
}
|
94
95
|
}
|
@@ -98,6 +99,7 @@ class MainContainer extends Viewport {
|
|
98
99
|
*/
|
99
100
|
onAmountRowsChange(data) {
|
100
101
|
if (data.oldValue) {
|
102
|
+
this.grid.isLoading = 'Is Loading';
|
101
103
|
this.grid.store.amountRows = parseInt(data.value.id)
|
102
104
|
}
|
103
105
|
}
|
package/package.json
CHANGED
@@ -161,6 +161,13 @@
|
|
161
161
|
}
|
162
162
|
}
|
163
163
|
|
164
|
+
&.neo-masked {
|
165
|
+
font-family: inherit;
|
166
|
+
font-size : inherit;
|
167
|
+
font-weight: var(--button-text-font-weight);
|
168
|
+
color : var(--button-text-color);
|
169
|
+
}
|
170
|
+
|
164
171
|
&.neo-button-ghost {
|
165
172
|
background-color: var(--button-ghost-background-color);
|
166
173
|
background-image: var(--button-ghost-background-image);
|
@@ -29,36 +29,33 @@
|
|
29
29
|
}
|
30
30
|
|
31
31
|
.neo-masked {
|
32
|
-
|
33
|
-
font-size : inherit;
|
34
|
-
font-weight : var(--button-text-font-weight);
|
35
|
-
position : relative;
|
36
|
-
color : var(--button-text-color);
|
32
|
+
position: relative;
|
37
33
|
|
38
34
|
.neo-load-mask {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
35
|
+
align-content : center;
|
36
|
+
background-color: inherit;
|
37
|
+
border-radius : inherit;
|
38
|
+
display : grid;
|
39
|
+
inset : 0;
|
40
|
+
justify-content : center;
|
41
|
+
overflow : clip;
|
42
|
+
position : absolute;
|
43
|
+
z-index : 4;
|
48
44
|
|
49
45
|
.neo-load-mask-body {
|
50
|
-
align-items
|
51
|
-
display
|
52
|
-
flex-flow
|
53
|
-
gap
|
46
|
+
align-items: center;
|
47
|
+
display : flex;
|
48
|
+
flex-flow : row nowrap;
|
49
|
+
gap : 0.7em;
|
50
|
+
|
51
|
+
.fa-spinner {
|
52
|
+
height: 1em;
|
53
|
+
width : 1em;
|
54
|
+
}
|
54
55
|
|
55
56
|
.neo-loading-message {
|
56
57
|
color: inherit;
|
57
58
|
}
|
58
|
-
.fa-spinner {
|
59
|
-
width : 1em;
|
60
|
-
height : 1em;
|
61
|
-
}
|
62
59
|
}
|
63
60
|
}
|
64
61
|
}
|
@@ -5,6 +5,26 @@
|
|
5
5
|
overscroll-behavior: none;
|
6
6
|
position : relative;
|
7
7
|
|
8
|
+
&.neo-masked {
|
9
|
+
.neo-grid-container {
|
10
|
+
opacity: .3;
|
11
|
+
}
|
12
|
+
|
13
|
+
.neo-load-mask {
|
14
|
+
.neo-load-mask-body {
|
15
|
+
.fa-spinner {
|
16
|
+
height : 3em;
|
17
|
+
font-size : 3em;
|
18
|
+
line-height: 3em;
|
19
|
+
}
|
20
|
+
|
21
|
+
.neo-loading-message {
|
22
|
+
font-size: 2.5em;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
8
28
|
.neo-grid-container {
|
9
29
|
border : 1px solid var(--grid-container-border-color);
|
10
30
|
border-spacing : 0;
|
package/src/DefaultConfig.mjs
CHANGED
@@ -262,12 +262,12 @@ const DefaultConfig = {
|
|
262
262
|
useVdomWorker: true,
|
263
263
|
/**
|
264
264
|
* buildScripts/injectPackageVersion.mjs will update this value
|
265
|
-
* @default '8.
|
265
|
+
* @default '8.18.1'
|
266
266
|
* @memberOf! module:Neo
|
267
267
|
* @name config.version
|
268
268
|
* @type String
|
269
269
|
*/
|
270
|
-
version: '8.
|
270
|
+
version: '8.18.1'
|
271
271
|
};
|
272
272
|
|
273
273
|
Object.assign(DefaultConfig, {
|
package/src/component/Base.mjs
CHANGED
@@ -749,8 +749,8 @@ class Component extends Base {
|
|
749
749
|
*/
|
750
750
|
afterSetIsLoading(value, oldValue) {
|
751
751
|
if (value || oldValue !== undefined) {
|
752
|
-
let me
|
753
|
-
{
|
752
|
+
let me = this,
|
753
|
+
{wrapperCls, vdom} = me,
|
754
754
|
maskIndex;
|
755
755
|
|
756
756
|
if (oldValue !== undefined && vdom.cn) {
|
@@ -770,8 +770,8 @@ class Component extends Base {
|
|
770
770
|
vdom.cn.push(me.createLoadingMask(value))
|
771
771
|
}
|
772
772
|
|
773
|
-
NeoArray.toggle(
|
774
|
-
me.set({
|
773
|
+
NeoArray.toggle(wrapperCls, 'neo-masked', value);
|
774
|
+
me.set({vdom, wrapperCls})
|
775
775
|
}
|
776
776
|
}
|
777
777
|
|
@@ -447,20 +447,22 @@ class ComboBox extends Picker {
|
|
447
447
|
* @param {*} oldValue
|
448
448
|
* @override
|
449
449
|
*/
|
450
|
-
fireChangeEvent(value, oldValue) {
|
450
|
+
async fireChangeEvent(value, oldValue) {
|
451
451
|
let me = this,
|
452
452
|
FormContainer = Neo.form?.Container,
|
453
453
|
params = {component: me, oldValue, value};
|
454
454
|
|
455
|
-
|
455
|
+
await me.timeout(10);
|
456
456
|
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
457
|
+
me.fire('change', params);
|
458
|
+
|
459
|
+
if (!me.suspendEvents) {
|
460
|
+
ComponentManager.getParents(me).forEach(parent => {
|
461
|
+
if (FormContainer && parent instanceof FormContainer) {
|
462
|
+
parent.fire('fieldChange', params)
|
463
|
+
}
|
464
|
+
})
|
465
|
+
}
|
464
466
|
}
|
465
467
|
|
466
468
|
/**
|
@@ -557,7 +559,7 @@ class ComboBox extends Picker {
|
|
557
559
|
* @param {Object[]} selectionChangeEvent.selection
|
558
560
|
* @protected
|
559
561
|
*/
|
560
|
-
async onListItemSelectionChange({
|
562
|
+
async onListItemSelectionChange({selection}) {
|
561
563
|
if (selection?.length) {
|
562
564
|
let me = this,
|
563
565
|
selected = selection[0],
|
@@ -567,19 +569,15 @@ class ComboBox extends Picker {
|
|
567
569
|
|
568
570
|
me.updateTypeAheadValue(null, true);
|
569
571
|
|
572
|
+
await me.hidePicker();
|
573
|
+
|
570
574
|
me.preventFiltering = true;
|
571
575
|
me.value = record;
|
572
576
|
me.preventFiltering = false;
|
573
577
|
|
574
578
|
me.fire('select', {
|
575
579
|
value: record
|
576
|
-
})
|
577
|
-
|
578
|
-
// Short delay to let selection DOM updates get applied.
|
579
|
-
// Alternatively, we could hide the picker before the selection happen and limit updates to the vdom.
|
580
|
-
await me.timeout(20);
|
581
|
-
|
582
|
-
await me.hidePicker()
|
580
|
+
})
|
583
581
|
}
|
584
582
|
}
|
585
583
|
|
package/src/grid/View.mjs
CHANGED
@@ -494,11 +494,11 @@ class GridView extends Component {
|
|
494
494
|
gridContainer = me.parent,
|
495
495
|
columns = gridContainer.headerToolbar.items,
|
496
496
|
id = me.getRowId(record, rowIndex),
|
497
|
-
|
497
|
+
rowCls = me.getRowClass(record, rowIndex),
|
498
498
|
config, column, columnPosition, endIndex, gridRow, i, startIndex;
|
499
499
|
|
500
500
|
if (rowIndex % 2 !== 0) {
|
501
|
-
|
501
|
+
rowCls.push('neo-even')
|
502
502
|
}
|
503
503
|
|
504
504
|
if (selectedRows && record[me.selectedRecordField]) {
|
@@ -506,14 +506,14 @@ class GridView extends Component {
|
|
506
506
|
}
|
507
507
|
|
508
508
|
if (selectedRows?.includes(id)) {
|
509
|
-
|
509
|
+
rowCls.push('neo-selected');
|
510
510
|
gridContainer.fire('select', {record})
|
511
511
|
}
|
512
512
|
|
513
513
|
gridRow = {
|
514
514
|
id,
|
515
515
|
'aria-rowindex': rowIndex + 2, // header row => 1, first body row => 2
|
516
|
-
cls :
|
516
|
+
cls : rowCls,
|
517
517
|
cn : [],
|
518
518
|
role : 'row',
|
519
519
|
|
@@ -582,6 +582,8 @@ class GridView extends Component {
|
|
582
582
|
|
583
583
|
me.getVdomRoot().cn = rows;
|
584
584
|
|
585
|
+
me.parent.isLoading = false;
|
586
|
+
|
585
587
|
me.update()
|
586
588
|
}
|
587
589
|
|
@@ -745,21 +747,21 @@ class GridView extends Component {
|
|
745
747
|
}
|
746
748
|
|
747
749
|
/**
|
750
|
+
* Override this method to apply custom CSS rules to grid rows
|
748
751
|
* @param {Object} record
|
749
|
-
* @
|
752
|
+
* @param {Number} rowIndex
|
753
|
+
* @returns {String[]}
|
750
754
|
*/
|
751
|
-
|
752
|
-
return
|
755
|
+
getRowClass(record, rowIndex) {
|
756
|
+
return ['neo-grid-row']
|
753
757
|
}
|
754
758
|
|
755
759
|
/**
|
756
|
-
* Override this method to apply custom CSS rules to grid rows
|
757
760
|
* @param {Object} record
|
758
|
-
* @
|
759
|
-
* @returns {String[]}
|
761
|
+
* @returns {String}
|
760
762
|
*/
|
761
|
-
|
762
|
-
return [
|
763
|
+
getRowId(record) {
|
764
|
+
return `${this.id}__tr__${record[this.store.getKeyProperty()]}`
|
763
765
|
}
|
764
766
|
|
765
767
|
/**
|