neo.mjs 5.16.4 → 5.17.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.
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='5.16.4'
23
+ * @member {String} version='5.17.0'
24
24
  */
25
- version: '5.16.4'
25
+ version: '5.17.0'
26
26
  }
27
27
 
28
28
  /**
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='5.16.4'
23
+ * @member {String} version='5.17.0'
24
24
  */
25
- version: '5.16.4'
25
+ version: '5.17.0'
26
26
  }
27
27
 
28
28
  /**
@@ -0,0 +1,80 @@
1
+ import CheckBox from '../../../src/form/field/CheckBox.mjs';
2
+ import ConfigurationViewport from '../../ConfigurationViewport.mjs';
3
+ import NumberField from '../../../src/form/field/Number.mjs';
4
+ import Radio from '../../../src/form/field/Radio.mjs';
5
+ import StatusBadge from '../../../src/component/StatusBadge.mjs';
6
+ import TextField from '../../../src/form/field/Text.mjs';
7
+
8
+ /**
9
+ * @class Neo.examples.component.statusbadge.MainContainer
10
+ * @extends Neo.examples.ConfigurationViewport
11
+ */
12
+ class MainContainer extends ConfigurationViewport {
13
+ static config = {
14
+ className : 'Neo.examples.component.statusbadge.MainContainer',
15
+ autoMount : true,
16
+ configItemLabelWidth: 110,
17
+ configItemWidth : 230,
18
+ layout : {ntype: 'hbox', align: 'stretch'}
19
+ }
20
+
21
+ createConfigurationComponents() {
22
+ let me = this;
23
+
24
+ return [{
25
+ module : CheckBox,
26
+ checked : me.exampleComponent.closable,
27
+ labelText: 'closable',
28
+ listeners: {change: me.onConfigChange.bind(me, 'closable')}
29
+ }, {
30
+ module : NumberField,
31
+ clearable : true,
32
+ labelText : 'height',
33
+ listeners : {change: me.onConfigChange.bind(me, 'height')},
34
+ maxValue : 100,
35
+ minValue : 20,
36
+ stepSize : 2,
37
+ style : {marginTop: '10px'},
38
+ value : me.exampleComponent.height
39
+ }, {
40
+ module : Radio,
41
+ checked : me.exampleComponent.state === 'error',
42
+ hideValueLabel: false,
43
+ labelText : 'state',
44
+ listeners : {change: me.onRadioChange.bind(me, 'state', 'error')},
45
+ name : 'state',
46
+ style : {marginTop: '10px'},
47
+ valueLabelText: 'error'
48
+ }, {
49
+ module : Radio,
50
+ checked : me.exampleComponent.badgePosition === 'success',
51
+ hideValueLabel: false,
52
+ labelText : '',
53
+ listeners : {change: me.onRadioChange.bind(me, 'state', 'success')},
54
+ name : 'state',
55
+ valueLabelText: 'success'
56
+ }, {
57
+ module : NumberField,
58
+ clearable : true,
59
+ labelText : 'width',
60
+ listeners : {change: me.onConfigChange.bind(me, 'width')},
61
+ maxValue : 300,
62
+ minValue : 100,
63
+ stepSize : 5,
64
+ style : {marginTop: '10px'},
65
+ value : me.exampleComponent.width
66
+ }]
67
+ }
68
+
69
+ createExampleComponent() {
70
+ return Neo.create({
71
+ module: StatusBadge,
72
+ height: 30,
73
+ state : 'error'
74
+ })
75
+ }
76
+ }
77
+
78
+ Neo.applyClassConfig(MainContainer);
79
+
80
+ export default MainContainer;
@@ -0,0 +1,6 @@
1
+ import MainContainer from './MainContainer.mjs';
2
+
3
+ export const onStart = () => Neo.app({
4
+ mainView: MainContainer,
5
+ name : 'Neo.examples.component.statusbadge'
6
+ });
@@ -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 StatusBadge</title>
7
+ </head>
8
+ <body>
9
+ <script src="../../../src/MicroLoader.mjs" type="module"></script>
10
+ </body>
11
+ </html>
@@ -0,0 +1,6 @@
1
+ {
2
+ "appPath" : "examples/component/statusbadge/app.mjs",
3
+ "basePath" : "../../../",
4
+ "environment": "development",
5
+ "mainPath" : "./Main.mjs"
6
+ }
@@ -37,9 +37,9 @@ class MainContainer extends ConfigurationViewport {
37
37
  module : FileUploadField,
38
38
  id : 'my-downloadable-test',
39
39
  uploadUrl : 'http://127.0.0.1:3000/file-upload-test',
40
- documentStatusUrl : 'http://127.0.0.1:3000/document-status-downloadable',
41
- documentDeleteUrl : 'http://127.0.0.1:3000/document-delete',
42
- downloadUrl : 'http://127.0.0.1:3000/getDocument',
40
+ documentStatusUrl : 'http://127.0.0.1:3000/document-status-downloadable?documentId={documentId}',
41
+ documentDeleteUrl : 'http://127.0.0.1:3000/document-delete?documentId={documentId}',
42
+ downloadUrl : 'http://127.0.0.1:3000/getDocument?documentId={documentId}',
43
43
  width : 350,
44
44
  maxSize : '10mb',
45
45
  types : {
@@ -47,14 +47,19 @@ class MainContainer extends ConfigurationViewport {
47
47
  jpg : 1,
48
48
  xls : 1,
49
49
  pdf : 1
50
+ },
51
+ listeners : {
52
+ beforeRequest({ headers }) {
53
+ headers['X-XSRF-TOKEN'] = 'my-xsrf-token'
54
+ }
50
55
  }
51
56
  }, {
52
57
  module : FileUploadField,
53
58
  id : 'my-not-downloadable-test',
54
59
  uploadUrl : 'http://127.0.0.1:3000/file-upload-test',
55
- documentStatusUrl : 'http://127.0.0.1:3000/document-status-not-downloadable',
56
- documentDeleteUrl : 'http://127.0.0.1:3000/document-delete',
57
- downloadUrl : 'http://127.0.0.1:3000/getDocument',
60
+ documentStatusUrl : 'http://127.0.0.1:3000/document-status-not-downloadable?documentId={documentId}',
61
+ documentDeleteUrl : 'http://127.0.0.1:3000/document-delete?documentId={documentId}',
62
+ downloadUrl : 'http://127.0.0.1:3000/getDocument?documentId={documentId}',
58
63
  width : 350,
59
64
  maxSize : '10mb',
60
65
  types : {
@@ -67,9 +72,9 @@ class MainContainer extends ConfigurationViewport {
67
72
  module : FileUploadField,
68
73
  id : 'my-upload-fail-test',
69
74
  uploadUrl : 'http://127.0.0.1:3000/file-upload-test-fail',
70
- documentStatusUrl : 'http://127.0.0.1:3000/document-status',
71
- documentDeleteUrl : 'http://127.0.0.1:3000/document-delete',
72
- downloadUrl : 'http://127.0.0.1:3000/getDocument',
75
+ documentStatusUrl : 'http://127.0.0.1:3000/document-status?documentId={documentId}',
76
+ documentDeleteUrl : 'http://127.0.0.1:3000/document-delete?documentId={documentId}',
77
+ downloadUrl : 'http://127.0.0.1:3000/getDocument?documentId={documentId}',
73
78
  width : 350,
74
79
  maxSize : '10mb',
75
80
  types : {
@@ -82,9 +87,51 @@ class MainContainer extends ConfigurationViewport {
82
87
  module : FileUploadField,
83
88
  id : 'my-scan-fail-test',
84
89
  uploadUrl : 'http://127.0.0.1:3000/file-upload-test',
85
- documentStatusUrl : 'http://127.0.0.1:3000/document-status-fail',
86
- documentDeleteUrl : 'http://127.0.0.1:3000/document-delete',
87
- downloadUrl : 'http://127.0.0.1:3000/getDocument',
90
+ documentStatusUrl : 'http://127.0.0.1:3000/document-status-fail?documentId={documentId}',
91
+ documentDeleteUrl : 'http://127.0.0.1:3000/document-delete?documentId={documentId}',
92
+ downloadUrl : 'http://127.0.0.1:3000/getDocument?documentId={documentId}',
93
+ width : 350,
94
+ maxSize : '10mb',
95
+ types : {
96
+ png : 1,
97
+ jpg : 1,
98
+ xls : 1,
99
+ pdf : 1
100
+ }
101
+ }, {
102
+ module : FileUploadField,
103
+ id : 'my-existing-document-test',
104
+ document : {
105
+ id : 2,
106
+ fileName : 'test.pdf',
107
+ size : 10664885,
108
+ status : 'UN_DOWNLOADABLE'
109
+ },
110
+ uploadUrl : 'http://127.0.0.1:3000/file-upload-test',
111
+ documentStatusUrl : 'http://127.0.0.1:3000/document-status-not-downloadable?documentId={documentId}',
112
+ documentDeleteUrl : 'http://127.0.0.1:3000/document-delete?documentId={documentId}',
113
+ downloadUrl : 'http://127.0.0.1:3000/getDocument?documentId={documentId}',
114
+ width : 350,
115
+ maxSize : '10mb',
116
+ types : {
117
+ png : 1,
118
+ jpg : 1,
119
+ xls : 1,
120
+ pdf : 1
121
+ }
122
+ }, {
123
+ module : FileUploadField,
124
+ id : 'my-non-existing-document-test',
125
+ document : {
126
+ id : 2,
127
+ fileName : 'test.pdf',
128
+ size : 10664885,
129
+ status : 'DELETED'
130
+ },
131
+ uploadUrl : 'http://127.0.0.1:3000/file-upload-test',
132
+ documentStatusUrl : 'http://127.0.0.1:3000/document-status-non-existent?documentId={documentId}',
133
+ documentDeleteUrl : 'http://127.0.0.1:3000/document-delete?documentId={documentId}',
134
+ downloadUrl : 'http://127.0.0.1:3000/getDocument?documentId={documentId}',
88
135
  width : 350,
89
136
  maxSize : '10mb',
90
137
  types : {
@@ -0,0 +1,142 @@
1
+ import ConfigurationViewport from '../ConfigurationViewport.mjs';
2
+
3
+ import Store from '../../src/data/Store.mjs';
4
+ import NumberField from '../../src/form/field/Number.mjs';
5
+ import AccordionTree from '../../src/tree/Accordion.mjs';
6
+ import CheckBox from "../../src/form/field/CheckBox.mjs";
7
+
8
+ /**
9
+ * @class Neo.examples.treeSelectionModel.MainContainer
10
+ * @extends Neo.examples.ConfigurationViewport
11
+ */
12
+ class MainContainer extends ConfigurationViewport {
13
+ static config = {
14
+ className : 'Neo.examples.treeSelectionModel.MainContainer',
15
+ autoMount : true,
16
+ configItemLabelWidth: 100,
17
+ configItemWidth : 230,
18
+ layout : {ntype: 'hbox', align: 'stretch'},
19
+ cls : ['examples-container-accordion']
20
+ }
21
+
22
+ onConfigChange(config, opts) {
23
+ this.exampleComponent.items[0][config] = opts.value;
24
+ }
25
+
26
+ createConfigurationComponents() {
27
+ let me = this,
28
+ treeList = me.exampleComponent.items[0];
29
+
30
+ return [{
31
+ module : CheckBox,
32
+ checked : treeList.rootParentsAreCollapsible,
33
+ hideLabel : true,
34
+ hideValueLabel: false,
35
+ listeners : {change: me.onConfigChange.bind(me, 'rootParentsAreCollapsible')},
36
+ valueLabelText: 'rootParentsAreCollapsible'
37
+ }, {
38
+ module : CheckBox,
39
+ checked : treeList.firstParentIsVisible,
40
+ hideLabel : true,
41
+ hideValueLabel: false,
42
+ listeners : {change: me.onConfigChange.bind(me, 'firstParentIsVisible')},
43
+ style : {marginTop: '10px'},
44
+ valueLabelText: 'firstParentIsVisible'
45
+ }, {
46
+ module : NumberField,
47
+ clearable: true,
48
+ labelText: 'height',
49
+ listeners: {change: me.onConfigChange.bind(me, 'height')},
50
+ maxValue : 1200,
51
+ minValue : 400,
52
+ stepSize : 5,
53
+ value : treeList.height,
54
+ style : {marginTop: '10px'}
55
+ }, {
56
+ module : NumberField,
57
+ clearable: true,
58
+ labelText: 'width',
59
+ listeners: {change: me.onConfigChange.bind(me, 'width')},
60
+ maxValue : 1200,
61
+ minValue : 200,
62
+ stepSize : 5,
63
+ style : {marginTop: '10px'},
64
+ value : treeList.width
65
+ }];
66
+ }
67
+
68
+ /**
69
+ * @returns {*}
70
+ */
71
+ createExampleComponent() {
72
+ const store = Neo.create(Store, {
73
+ keyProperty: 'id',
74
+ model : {
75
+ fields: [
76
+ {name: 'collapsed', type: 'Boolean'},
77
+ {name: 'content', type: 'String'},
78
+ {name: 'iconCls', type: 'String'},
79
+ {name: 'id', type: 'Integer'},
80
+ {name: 'isLeaf', type: 'Boolean'},
81
+ {name: 'name', type: 'String'},
82
+ {name: 'parentId', type: 'Integer'}
83
+ ]
84
+ }
85
+ });
86
+
87
+ return Neo.ntype({
88
+ ntype : 'container',
89
+ layout: {ntype: 'hbox', align: 'stretch'},
90
+ items : [{
91
+ // module: TextField,
92
+ // label: 'Test',
93
+ // plugin: {
94
+ // Plugin: {
95
+ // bold: true
96
+ // }
97
+ // }
98
+ // },{
99
+ module: AccordionTree,
100
+ store : store,
101
+ height: 800,
102
+ width : 400,
103
+
104
+ // ensure afterSetMounted runs only once
105
+ storeLoaded: false,
106
+ afterSetMounted() {
107
+ if (!this.storeLoaded) {
108
+ this.storeLoaded = true;
109
+ } else {
110
+ return;
111
+ }
112
+
113
+ let me = this;
114
+
115
+ Neo.Xhr.promiseJson({
116
+ url: '../../examples/treeSelectionModel/tree.json'
117
+ }).then(data => {
118
+ const items = data.json,
119
+ colorArray = ['red', 'yellow', 'green'],
120
+ iconArray = ['home', 'industry', 'user'];
121
+
122
+ // create random iconCls colors
123
+ items.forEach((item) => {
124
+ if (!item.iconCls) {
125
+ const rand = Math.floor(Math.random() * 3);
126
+
127
+ item.iconCls = 'fa fa-' + iconArray[rand] + ' color-' + colorArray[rand];
128
+ }
129
+ });
130
+
131
+ me.store.data = data.json;
132
+ me.createItems(null, me.getListItemsRoot(), 0);
133
+ });
134
+ }
135
+ }]
136
+ });
137
+ }
138
+ }
139
+
140
+ Neo.applyClassConfig(MainContainer);
141
+
142
+ export default MainContainer;
@@ -0,0 +1,6 @@
1
+ import MainContainer from './MainContainer.mjs';
2
+
3
+ export const onStart = () => Neo.app({
4
+ mainView: MainContainer,
5
+ name : 'Neo.examples.treeSelectionModel'
6
+ });
@@ -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 Tree</title>
7
+ </head>
8
+ <body>
9
+ <script src="../../src/MicroLoader.mjs" type="module"></script>
10
+ </body>
11
+ </html>
@@ -0,0 +1,7 @@
1
+ {
2
+ "appPath" : "examples/treeSelectionModel/app.mjs",
3
+ "basePath" : "../../",
4
+ "environment": "development",
5
+ "mainPath" : "./Main.mjs",
6
+ "themes" : ["neo-theme-dark", "neo-theme-light"]
7
+ }
@@ -0,0 +1,112 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "name": "ROOT",
5
+ "parentId": null,
6
+ "collapsed": false,
7
+ "isLeaf": false
8
+ },
9
+ {
10
+ "id": 2,
11
+ "name": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr,",
12
+ "parentId": 1,
13
+ "isLeaf": true,
14
+ "content": "Textfeld",
15
+ "iconCls": "fa fa-t color-blue"
16
+ },
17
+ {
18
+ "id": 3,
19
+ "name": "Sed diam nonumy",
20
+ "parentId": 1,
21
+ "isLeaf": true,
22
+ "content": "Textfeld",
23
+ "iconCls": "fa fa-t color-blue"
24
+ },
25
+ {
26
+ "id": 4,
27
+ "name": "Eirmod",
28
+ "parentId": 1,
29
+ "isLeaf": true,
30
+ "content": "Textfeld",
31
+ "iconCls": "fa fa-t color-blue"
32
+ },
33
+ {
34
+ "id": 5,
35
+ "name": "Tempor",
36
+ "parentId": 1,
37
+ "isLeaf": true,
38
+ "content": "Textfeld",
39
+ "iconCls": "fa fa-t color-blue"
40
+ },
41
+ {
42
+ "id": 6,
43
+ "name": "Invidunt ut labore",
44
+ "parentId": 1,
45
+ "isLeaf": true,
46
+ "content": "Textfeld",
47
+ "iconCls": "fa fa-t color-blue"
48
+ },
49
+ {
50
+ "id": 7,
51
+ "name": "Dolore magna aliquyam",
52
+ "parentId": null,
53
+ "collapsed": false,
54
+ "isLeaf": false
55
+ },
56
+ {
57
+ "id": 8,
58
+ "name": "V01 . At vero eos et accusam",
59
+ "parentId": 7,
60
+ "collapsed": true,
61
+ "isLeaf": false,
62
+ "content": "Auswählliste",
63
+ "iconCls": "fa fa-chevron-down color-red"
64
+ },
65
+ {
66
+ "id": 9,
67
+ "name": "Justo 1",
68
+ "parentId": 8,
69
+ "isLeaf": true,
70
+ "content": "Child",
71
+ "iconCls": "fa-regular fa-square-check color-green"
72
+ },
73
+ {
74
+ "id": 10,
75
+ "name": "Justo 2",
76
+ "parentId": 8,
77
+ "isLeaf": true,
78
+ "content": "Child",
79
+ "iconCls": "fa-regular fa-square-check color-green"
80
+ },
81
+ {
82
+ "id": 11,
83
+ "name": "Rebum",
84
+ "parentId": null,
85
+ "collapsed": false,
86
+ "isLeaf": false
87
+ },
88
+ {
89
+ "id": 12,
90
+ "name": "F0801 - Stet ",
91
+ "parentId": 11,
92
+ "isLeaf": true,
93
+ "content": "Datumfeld",
94
+ "iconCls": "fa-solid fa-calendar-days color-yellow"
95
+ },
96
+ {
97
+ "id": 13,
98
+ "name": "F0802 - Kasd",
99
+ "parentId": 11,
100
+ "isLeaf": true,
101
+ "content": "Datumfeld",
102
+ "iconCls": "fa-solid fa-calendar-days color-yellow"
103
+ },
104
+ {
105
+ "id": 14,
106
+ "name": "E30 - Gubergren",
107
+ "parentId": 11,
108
+ "isLeaf": true,
109
+ "content": "Mehrfachauswahl",
110
+ "iconCls": "fa-regular fa-square-check color-green"
111
+ }
112
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "5.16.4",
3
+ "version": "5.17.0",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -55,8 +55,8 @@
55
55
  "inquirer": "^9.2.10",
56
56
  "neo-jsdoc": "1.0.1",
57
57
  "neo-jsdoc-x": "1.0.5",
58
- "postcss": "^8.4.27",
59
- "sass": "^1.65.1",
58
+ "postcss": "^8.4.28",
59
+ "sass": "^1.66.0",
60
60
  "showdown": "^2.1.0",
61
61
  "webpack": "^5.88.2",
62
62
  "webpack-cli": "^5.1.4",
@@ -0,0 +1,9 @@
1
+ .neo-status-badge {
2
+ &.neo-state-error {
3
+ background-color: red;
4
+ }
5
+
6
+ &.neo-state-success {
7
+ background-color: darkgreen;
8
+ }
9
+ }
@@ -0,0 +1,24 @@
1
+ .examples-container-accordion {
2
+ .neo-accordion-item-icon {
3
+ &.color-blue {
4
+ background-color: lightskyblue;
5
+ color: v(list-item-background-color);
6
+ }
7
+
8
+ &.color-red {
9
+ background-color: palevioletred;
10
+ color: v(list-item-background-color);
11
+ }
12
+
13
+ &.color-yellow {
14
+ background-color: goldenrod;
15
+ color: v(list-item-background-color);
16
+ }
17
+
18
+ &.color-green {
19
+ background-color: lightseagreen;
20
+ color: v(list-container-list-color);
21
+ color: v(list-item-background-color);
22
+ }
23
+ }
24
+ }
@@ -122,13 +122,20 @@
122
122
  var(--fileuploadfield-progress-color) 180deg,
123
123
  transparent 180deg
124
124
  );
125
- animation: spinner-rotation 3s linear infinite;
125
+ animation : spinner-rotation 3s linear infinite;
126
126
 
127
127
  &::after {
128
- content : "";
129
- flex : 0 0 calc(100% - 6px);
128
+ content : "";
129
+ flex : 0 0 calc(100% - 6px);
130
+ background-color : var(--fileuploadfield-background-color);
130
131
  }
131
132
  }
133
+ // No interaction while scanning. We just have to wait.
134
+ // But
135
+ .neo-file-upload-action-button {
136
+ position : absolute;
137
+ clip : rect(0, 0, 0, 0);
138
+ }
132
139
  }
133
140
 
134
141
  // While uploading and scanning, we can abort the whole upload/scan process
@@ -141,7 +148,7 @@
141
148
  }
142
149
 
143
150
  // If the upload or scan failed, we show an error UI and the action button cancels
144
- .neo-file-upload-state-upload-failed, .neo-file-upload-state-scan-failed {
151
+ .neo-file-upload-state-upload-failed, .neo-file-upload-state-scan-failed, .neo-file-upload-field.neo-invalid {
145
152
  --fileuploadfield-progress-color : var(--fileuploadfield-error-color);
146
153
  border-color : var(--fileuploadfield-error-color);
147
154
 
@@ -201,6 +208,14 @@
201
208
  }
202
209
  }
203
210
 
211
+ .neo-file-upload-state-deleted {
212
+ .neo-file-upload-action-button {
213
+ &::after {
214
+ content : var(--cancel-icon-codepoint );
215
+ }
216
+ }
217
+ }
218
+
204
219
  .neo-file-upload-state-ready {
205
220
  // Only the input field is visible when in ready state
206
221
  // It takes up the whole component, and is the only interactive item