neo.mjs 6.10.14 → 6.10.15

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='6.10.14'
23
+ * @member {String} version='6.10.15'
24
24
  */
25
- version: '6.10.14'
25
+ version: '6.10.15'
26
26
  }
27
27
 
28
28
  /**
@@ -1,6 +1,6 @@
1
- import Base from '../../../../src/container/Base.mjs';
1
+ import Base from '../../../../src/container/Base.mjs';
2
2
  import TabContainer from '../../../../src/tab/Container.mjs';
3
- import TextArea from '../../../../src/form/field/TextArea.mjs';
3
+ import TextArea from '../../../../src/form/field/TextArea.mjs';
4
4
 
5
5
  /**
6
6
  * @class Portal.view.learn.LivePreview
@@ -76,7 +76,6 @@ class LivePreview extends Base {
76
76
 
77
77
  const className = this.findLastClassName(source);
78
78
 
79
-
80
79
  source.split('\n').forEach(line => {
81
80
  let importMatch = line.match(importRegex);
82
81
  if (importMatch) {
@@ -20,9 +20,9 @@ class ServiceWorker extends ServiceBase {
20
20
  */
21
21
  singleton: true,
22
22
  /**
23
- * @member {String} version='6.10.14'
23
+ * @member {String} version='6.10.15'
24
24
  */
25
- version: '6.10.14'
25
+ version: '6.10.15'
26
26
  }
27
27
 
28
28
  /**
@@ -2,5 +2,6 @@
2
2
  "appPath" : "examples/button/base/app.mjs",
3
3
  "basePath" : "../../../",
4
4
  "environment": "development",
5
- "mainPath" : "./Main.mjs"
5
+ "mainPath" : "./Main.mjs",
6
+ "themes" : ["neo-theme-neo-light"]
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name" : "neo.mjs",
3
- "version" : "6.10.14",
3
+ "version" : "6.10.15",
4
4
  "description" : "The webworkers driven UI framework",
5
5
  "type" : "module",
6
6
  "repository" : {
@@ -91,7 +91,6 @@ Neo.applyClassConfig(MainView);
91
91
  export default MainView;
92
92
  </pre>
93
93
 
94
-
95
94
  Note the entry in `items:[]`. That's a description of the button that will be the single item in our
96
95
  container. In Neo.mjs terms we're _configuring_ the button. Neo.mjs is a declarative framework, in
97
96
  which components and objects are described. It's an abstraction. In other words, the code describes
@@ -0,0 +1 @@
1
+ ### todo: Adding Properties
@@ -0,0 +1 @@
1
+ ### todo: Updating View State
@@ -64,4 +64,4 @@ modify the code to specify `ntype:'hbox'` and run it again.
64
64
 
65
65
  Note that the layout specifies `ntype` rather than `module`. An `ntype` is an alias for a class
66
66
  that has already been imported. Containers import all the layout types, so since we've already
67
- imported container we can simply use `ntype` to specify which layout we want.
67
+ imported container we can simply use `ntype` to specify which layout we want.
@@ -289,7 +289,6 @@ layout: {
289
289
 
290
290
  <img src="https://s3.amazonaws.com/mjs.neo.learning.images/earthquakes/EarthquakesSingleVoxStartButton.png" style="width:80%"/>
291
291
 
292
-
293
292
  </details>
294
293
 
295
294
  <!-- /lab -->
@@ -1404,6 +1403,4 @@ Save, refresh, and confirm that you see the value logged when you click on a map
1404
1403
 
1405
1404
  </details>
1406
1405
 
1407
-
1408
-
1409
1406
  <!-- /lab -->
@@ -0,0 +1,32 @@
1
+ .newwebsite-viewport {
2
+ align-items : center !important;
3
+ display : flex !important;
4
+ gap : 48px;
5
+ justify-content: center !important;
6
+ padding : 10% 15% 15% 15%;
7
+ }
8
+
9
+ .button-group {
10
+ display : flex !important;
11
+ flex-direction: row-reverse !important;
12
+ gap : 8px !important;
13
+ }
14
+
15
+ .neo-h1 {
16
+ font-size : 48px;
17
+ font-weight: 600;
18
+ text-align : center;
19
+ }
20
+
21
+ .vector {
22
+ background-image : url("../../../../../../resources/images/Neo_Vector.svg");
23
+ background-position: center center;
24
+ background-repeat : no-repeat;
25
+ background-size : contain;
26
+ height : 150px;
27
+ width : 100%;
28
+ }
29
+
30
+ .get-started-button {
31
+ cursor: not-allowed !important;
32
+ }
@@ -77,5 +77,4 @@
77
77
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
78
78
  }
79
79
 
80
-
81
80
  }
@@ -54,7 +54,63 @@
54
54
  cursor: pointer;
55
55
 
56
56
  &:hover {
57
- background-color: var(--list-item-background-color-hover);
57
+ background-color: var(--list-item-background-color-hover) !important;
58
+ color : var(--list-container-list-color);
59
+ }
60
+ &:active {
61
+ background-color: var(--list-item-background-color-active);
62
+ color : var(--list-container-list-color);
63
+ }
64
+ &:active {
65
+ background-color: var(--list-item-background-color-active);
66
+ color : var(--list-container-list-color);
67
+ }
68
+ &:active {
69
+ background-color: var(--list-item-background-color-active);
70
+ color : var(--list-container-list-color);
71
+ }
72
+ &:active {
73
+ background-color: var(--list-item-background-color-active);
74
+ color : var(--list-container-list-color);
75
+ }
76
+ &:active {
77
+ background-color: var(--list-item-background-color-active);
78
+ color : var(--list-container-list-color);
79
+ }
80
+ &:active {
81
+ background-color: var(--list-item-background-color-active);
82
+ color : var(--list-container-list-color);
83
+ }
84
+ &:active {
85
+ background-color: var(--list-item-background-color-active);
86
+ color : var(--list-container-list-color);
87
+ }
88
+ &:active {
89
+ background-color: var(--list-item-background-color-active);
90
+ color : var(--list-container-list-color);
91
+ }
92
+ &:active {
93
+ background-color: var(--list-item-background-color-active);
94
+ color : var(--list-container-list-color);
95
+ }
96
+ &:active {
97
+ background-color: var(--list-item-background-color-active);
98
+ color : var(--list-container-list-color);
99
+ }
100
+ &:active {
101
+ background-color: var(--list-item-background-color-active);
102
+ color : var(--list-container-list-color);
103
+ }
104
+ &:active {
105
+ background-color: var(--list-item-background-color-active);
106
+ color : var(--list-container-list-color);
107
+ }
108
+ &:active {
109
+ background-color: var(--list-item-background-color-active);
110
+ color : var(--list-container-list-color);
111
+ }
112
+ &:active {
113
+ background-color: var(--list-item-background-color-active);
58
114
  color : var(--list-container-list-color);
59
115
  }
60
116
  &:active {
@@ -0,0 +1,3 @@
1
+ :root .neo-theme-neo-light {
2
+ --cmp-button-bg : blue;
3
+ }
@@ -236,12 +236,12 @@ const DefaultConfig = {
236
236
  useVdomWorker: true,
237
237
  /**
238
238
  * buildScripts/injectPackageVersion.mjs will update this value
239
- * @default '6.10.14'
239
+ * @default '6.10.15'
240
240
  * @memberOf! module:Neo
241
241
  * @name config.version
242
242
  * @type String
243
243
  */
244
- version: '6.10.14'
244
+ version: '6.10.15'
245
245
  };
246
246
 
247
247
  Object.assign(DefaultConfig, {
@@ -68,6 +68,9 @@ class RecordFactory extends Base {
68
68
  properties;
69
69
 
70
70
  Object.defineProperties(me, {
71
+ [Symbol.for('isRecord')]: {
72
+ value: true
73
+ },
71
74
  _isModified: {
72
75
  value : false,
73
76
  writable: true
@@ -76,7 +79,7 @@ class RecordFactory extends Base {
76
79
 
77
80
  if (Array.isArray(model.fields)) {
78
81
  model.fields.forEach(field => {
79
- let value = config[field.name],
82
+ let value = config[field.mapping || field.name],
80
83
  symbol = Symbol.for(field.name),
81
84
  parsedValue;
82
85
 
@@ -209,7 +212,7 @@ class RecordFactory extends Base {
209
212
  * @returns {Boolean}
210
213
  */
211
214
  isRecord(record) {
212
- return record?.[Symbol.for('isRecord')] || false;
215
+ return record?.isRecord;
213
216
  }
214
217
 
215
218
  /**
@@ -1325,7 +1325,7 @@ class Text extends Base {
1325
1325
  onInputValueChange(data) {
1326
1326
  let me = this,
1327
1327
  oldValue = me.value,
1328
- value = data.value,
1328
+ value = data.value ? data.value.toString().trim() : me.emptyValue,
1329
1329
  vnode = VNodeUtil.findChildVnode(me.vnode, {nodeName: 'input'});
1330
1330
 
1331
1331
  if (vnode) {
@@ -1528,7 +1528,7 @@ class Text extends Base {
1528
1528
  minLength = me.minLength,
1529
1529
  required = me.required,
1530
1530
  returnValue = true,
1531
- value = me.value,
1531
+ value = me.value ? me.value.toString().trim() : me.emptyValue,
1532
1532
  valueLength = value?.toString().length,
1533
1533
  inputPattern = me.inputPattern,
1534
1534
  isEmpty = value !== 0 && (!value || valueLength < 1),
@@ -85,7 +85,7 @@ class Flexbox extends Base {
85
85
  * @protected
86
86
  */
87
87
  afterSetAlign(value, oldValue) {
88
- oldValue && this.updateInputValue(value, oldValue, 'align');
88
+ oldValue && this.updateInputValue(value, oldValue, 'align')
89
89
  }
90
90
 
91
91
  /**
@@ -95,7 +95,7 @@ class Flexbox extends Base {
95
95
  * @protected
96
96
  */
97
97
  afterSetDirection(value, oldValue) {
98
- oldValue && this.updateInputValue(value, oldValue, 'direction');
98
+ oldValue && this.updateInputValue(value, oldValue, 'direction')
99
99
  }
100
100
 
101
101
  /**
@@ -111,7 +111,7 @@ class Flexbox extends Base {
111
111
  style = item.wrapperStyle;
112
112
 
113
113
  style.gap = value;
114
- item.wrapperStyle = style;
114
+ item.wrapperStyle = style
115
115
  }
116
116
 
117
117
  /**
@@ -121,7 +121,7 @@ class Flexbox extends Base {
121
121
  * @protected
122
122
  */
123
123
  afterSetPack(value, oldValue) {
124
- oldValue && this.updateInputValue(value, oldValue, 'pack');
124
+ oldValue && this.updateInputValue(value, oldValue, 'pack')
125
125
  }
126
126
 
127
127
  /**
@@ -131,7 +131,7 @@ class Flexbox extends Base {
131
131
  * @protected
132
132
  */
133
133
  afterSetWrap(value, oldValue) {
134
- oldValue && this.updateInputValue(value, oldValue, 'wrap');
134
+ oldValue && this.updateInputValue(value, oldValue, 'wrap')
135
135
  }
136
136
 
137
137
  /**
@@ -143,11 +143,11 @@ class Flexbox extends Base {
143
143
  flex = style.flex || item.flex || (this.align === 'stretch' ? 1 : '0 1 auto');
144
144
 
145
145
  if (flex === 1) {
146
- flex = '1 1 auto';
146
+ flex = '1 1 auto'
147
147
  }
148
148
 
149
149
  style.flex = flex;
150
- item.wrapperStyle = style;
150
+ item.wrapperStyle = style
151
151
  }
152
152
 
153
153
  /**
@@ -160,7 +160,7 @@ class Flexbox extends Base {
160
160
  wrapperCls = container?.wrapperCls || [];
161
161
 
162
162
  if (!container) {
163
- Neo.logError('layout.Flexbox: applyRenderAttributes -> container not yet created', me.containerId);
163
+ Neo.logError('layout.Flexbox: applyRenderAttributes -> container not yet created', me.containerId)
164
164
  }
165
165
 
166
166
  NeoArray.add(wrapperCls, prefix + 'container');
@@ -170,7 +170,7 @@ class Flexbox extends Base {
170
170
  me.pack && NeoArray.add(wrapperCls, prefix + 'pack-' + me.pack);
171
171
  me.wrap && NeoArray.add(wrapperCls, prefix + 'wrap-' + me.wrap);
172
172
 
173
- container.wrapperCls = wrapperCls;
173
+ container.wrapperCls = wrapperCls
174
174
  }
175
175
 
176
176
  /**
@@ -181,7 +181,7 @@ class Flexbox extends Base {
181
181
  * @returns {String|null} value
182
182
  */
183
183
  beforeSetAlign(value, oldValue) {
184
- return this.testInputValue(value, oldValue, 'alignValues', 'align');
184
+ return this.testInputValue(value, oldValue, 'alignValues', 'align')
185
185
  }
186
186
 
187
187
  /**
@@ -203,7 +203,7 @@ class Flexbox extends Base {
203
203
  * @returns {String|null} value
204
204
  */
205
205
  beforeSetPack(value, oldValue) {
206
- return this.testInputValue(value, oldValue, 'packValues', 'pack');
206
+ return this.testInputValue(value, oldValue, 'packValues', 'pack')
207
207
  }
208
208
 
209
209
  /**
@@ -214,7 +214,7 @@ class Flexbox extends Base {
214
214
  * @returns {String} value
215
215
  */
216
216
  beforeSetWrap(value, oldValue) {
217
- return this.testInputValue(value, oldValue, 'wrapValues', 'wrap');
217
+ return this.testInputValue(value, oldValue, 'wrapValues', 'wrap')
218
218
  }
219
219
 
220
220
  /**
@@ -227,7 +227,7 @@ class Flexbox extends Base {
227
227
  let style = item.wrapperStyle || {};
228
228
 
229
229
  style.flex = item.flex || null;
230
- item.wrapperStyle = style;
230
+ item.wrapperStyle = style
231
231
  }
232
232
 
233
233
  /**
@@ -242,25 +242,17 @@ class Flexbox extends Base {
242
242
  wrapperCls = container?.wrapperCls || [];
243
243
 
244
244
  if (!container) {
245
- Neo.logError('layout.Flexbox: removeRenderAttributes -> container not yet created', me.containerId);
245
+ Neo.logError('layout.Flexbox: removeRenderAttributes -> container not yet created', me.containerId)
246
246
  }
247
247
 
248
248
  NeoArray.remove(wrapperCls, prefix + 'container');
249
249
 
250
- if (me.align) {
251
- NeoArray.remove(wrapperCls, prefix + 'align-' + me.align);
252
- }
253
- if (me.direction) {
254
- NeoArray.remove(wrapperCls, prefix + 'direction-' + me.direction);
255
- }
256
- if (me.pack) {
257
- NeoArray.remove(wrapperCls, prefix + 'pack-' + me.pack);
258
- }
259
- if (me.wrap) {
260
- NeoArray.remove(wrapperCls, prefix + 'wrap-' + me.wrap);
261
- }
250
+ me.align && NeoArray.remove(wrapperCls, prefix + 'align-' + me.align);
251
+ me.direction && NeoArray.remove(wrapperCls, prefix + 'direction-' + me.direction);
252
+ me.pack && NeoArray.remove(wrapperCls, prefix + 'pack-' + me.pack);
253
+ me.wrap && NeoArray.remove(wrapperCls, prefix + 'wrap-' + me.wrap);
262
254
 
263
- container.wrapperCls = wrapperCls;
255
+ container.wrapperCls = wrapperCls
264
256
  }
265
257
 
266
258
  /**
@@ -277,10 +269,10 @@ class Flexbox extends Base {
277
269
 
278
270
  if (!NeoArray.hasItem(validValues, value)) {
279
271
  Neo.logError(this.containerId, '-> layout: supported values for "' + propertyName + '" are' , validValues);
280
- return oldValue;
272
+ return oldValue
281
273
  }
282
274
 
283
- return value;
275
+ return value
284
276
  }
285
277
 
286
278
  /**
@@ -300,10 +292,10 @@ class Flexbox extends Base {
300
292
  NeoArray.remove(wrapperCls, prefix + propertyName + '-' + oldValue);
301
293
 
302
294
  if (value !== null) {
303
- NeoArray.add(wrapperCls, prefix + propertyName + '-' + value);
295
+ NeoArray.add(wrapperCls, prefix + propertyName + '-' + value)
304
296
  }
305
297
 
306
- container.wrapperCls = wrapperCls;
298
+ container.wrapperCls = wrapperCls
307
299
  }
308
300
  }
309
301
  }
@@ -29,7 +29,7 @@ class HBox extends Flexbox {
29
29
  */
30
30
  applyChildAttributes(item) {
31
31
  // Do not apply flex if fixed width
32
- !item.width && super.applyChildAttributes(item);
32
+ !item.width && super.applyChildAttributes(item)
33
33
  }
34
34
  }
35
35
 
@@ -29,7 +29,7 @@ class VBox extends Flexbox {
29
29
  */
30
30
  applyChildAttributes(item) {
31
31
  // Do not apply flex if fixed height
32
- !item.height && super.applyChildAttributes(item);
32
+ !item.height && super.applyChildAttributes(item)
33
33
  }
34
34
  }
35
35