neo.mjs 4.0.52 → 4.0.53

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.
@@ -83,7 +83,7 @@ if (programOpts.info) {
83
83
  }
84
84
 
85
85
  if (programOpts.className.indexOf('.') !== -1) {
86
- console.error(chalk.red('No .dot-notation avcailable when -d option is selected.'));
86
+ console.error(chalk.red('No .dot-notation available when -d option is selected.'));
87
87
  console.info(chalk.bgCyan('Usage: createClass -d -c <className> -b <baseClass> [-s sourceParent]'));
88
88
  process.exit(1);
89
89
  }
@@ -36,6 +36,12 @@ class MainContainer extends ConfigurationViewport {
36
36
  labelText: 'clearToOriginalValue',
37
37
  listeners: {change: me.onConfigChange.bind(me, 'clearToOriginalValue')},
38
38
  style : {marginTop: '10px'}
39
+ }, {
40
+ module : CheckBox,
41
+ checked : me.exampleComponent.disabled,
42
+ labelText: 'disabled',
43
+ listeners: {change: me.onConfigChange.bind(me, 'disabled')},
44
+ style : {marginTop: '10px'}
39
45
  }, {
40
46
  module : CheckBox,
41
47
  checked : me.exampleComponent.hideLabel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "4.0.52",
3
+ "version": "4.0.53",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -8,7 +8,19 @@
8
8
 
9
9
  &.neo-focus {
10
10
  .neo-input-wrapper {
11
- border-color: v(textfield-border-color-active);
11
+ border-color: v(textfield-border-color-active) !important;
12
+ }
13
+ }
14
+
15
+ &.neo-invalid {
16
+ .neo-input-wrapper {
17
+ border-color: brown;
18
+ }
19
+
20
+ &.neo-disabled {
21
+ .neo-input-wrapper {
22
+ border-color: inherit;
23
+ }
12
24
  }
13
25
  }
14
26
 
@@ -156,10 +168,6 @@
156
168
  margin : 0; // important for Safari => #1125
157
169
  min-height : 25px;
158
170
  width : 30px;
159
-
160
- &:invalid {
161
- border: 1px solid brown;
162
- }
163
171
  }
164
172
  }
165
173
 
@@ -179,14 +187,18 @@
179
187
  outline : none;
180
188
  }
181
189
 
182
- &:invalid {
183
- border-color: brown;
184
- }
185
-
186
190
  &::-webkit-input-placeholder {
187
191
  color : v(textfield-input-placeholder-color) !important;
188
192
  opacity: v(textfield-input-placeholder-opacity) !important;
189
193
  }
194
+
195
+ &.neo-invalid {
196
+ border-color: brown;
197
+
198
+ &.neo-disabled {
199
+ border-color: inherit;
200
+ }
201
+ }
190
202
  }
191
203
 
192
204
  .neo-textfield-label {
@@ -99,6 +99,7 @@ class Number extends Text {
99
99
  * @protected
100
100
  */
101
101
  afterSetMaxValue(value, oldValue) {
102
+ this.updateValidationIndicators();
102
103
  this.changeInputElKey('max', value);
103
104
  }
104
105
 
@@ -109,6 +110,7 @@ class Number extends Text {
109
110
  * @protected
110
111
  */
111
112
  afterSetMinValue(value, oldValue) {
113
+ this.updateValidationIndicators();
112
114
  this.changeInputElKey('min', value);
113
115
  }
114
116
 
@@ -178,14 +180,17 @@ class Number extends Text {
178
180
  * @returns {Boolean}
179
181
  */
180
182
  isValid() {
181
- let me = this,
182
- value = me.value;
183
+ let me = this,
184
+ maxValue = me.maxValue,
185
+ minValue = me.minValue,
186
+ value = me.value,
187
+ isNumber = Neo.isNumber(value);
183
188
 
184
- if (Neo.isNumber(me.maxValue) && value > me.maxValue) {
189
+ if (Neo.isNumber(maxValue) && isNumber && value > maxValue) {
185
190
  return false;
186
191
  }
187
192
 
188
- if (Neo.isNumber(me.minValue) && value < me.minValue) {
193
+ if (Neo.isNumber(minValue) && isNumber && value < minValue) {
189
194
  return false;
190
195
  }
191
196
 
@@ -375,6 +375,7 @@ class Text extends Base {
375
375
  * @protected
376
376
  */
377
377
  afterSetMaxLength(value, oldValue) {
378
+ this.updateValidationIndicators();
378
379
  this.changeInputElKey('maxlength', value);
379
380
  }
380
381
 
@@ -385,6 +386,7 @@ class Text extends Base {
385
386
  * @protected
386
387
  */
387
388
  afterSetMinLength(value, oldValue) {
389
+ this.updateValidationIndicators();
388
390
  this.changeInputElKey('minlength', value);
389
391
  }
390
392
 
@@ -437,6 +439,7 @@ class Text extends Base {
437
439
  * @protected
438
440
  */
439
441
  afterSetRequired(value, oldValue) {
442
+ this.updateValidationIndicators();
440
443
  this.changeInputElKey('required', value ? value : null);
441
444
  }
442
445
 
@@ -532,6 +535,7 @@ class Text extends Base {
532
535
  }
533
536
 
534
537
  NeoArray[me.originalConfig.value !== value ? 'add' : 'remove'](me._cls, 'neo-is-dirty');
538
+ me.updateValidationIndicators();
535
539
 
536
540
  me.vdom = vdom;
537
541
 
@@ -1011,6 +1015,20 @@ class Text extends Base {
1011
1015
  });
1012
1016
  });
1013
1017
  }
1018
+
1019
+ /**
1020
+ * @param {Boolean} silent=true
1021
+ */
1022
+ updateValidationIndicators(silent=true) {
1023
+ let me = this,
1024
+ vdom = me.vdom;
1025
+
1026
+ NeoArray[!me.isValid() ? 'add' : 'remove'](me._cls, 'neo-invalid');
1027
+
1028
+ if (!silent) {
1029
+ me.vdom = vdom;
1030
+ }
1031
+ }
1014
1032
  }
1015
1033
 
1016
1034
  Neo.applyClassConfig(Text);