neo.mjs 4.0.54 → 4.0.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo.mjs",
3
- "version": "4.0.54",
3
+ "version": "4.0.55",
4
4
  "description": "The webworkers driven UI framework",
5
5
  "type": "module",
6
6
  "repository": {
@@ -36,6 +36,14 @@
36
36
  }
37
37
  }
38
38
 
39
+ &.neo-invalid:not(.neo-disabled, .neo-has-content) {
40
+ .neo-label-wrapper {
41
+ .neo-center-border {
42
+ border-top-color: v(textfield-border-color-invalid);
43
+ }
44
+ }
45
+ }
46
+
39
47
  &.label-bottom {
40
48
  align-items : start;
41
49
  flex-direction: column-reverse;
@@ -10,6 +10,12 @@ import VNodeUtil from '../../util/VNode.mjs';
10
10
  * @extends Neo.form.field.Base
11
11
  */
12
12
  class Text extends Base {
13
+ /**
14
+ * Set this value to false, in case a field should display errors up front
15
+ * @member {Boolean} validBeforeMount=true
16
+ */
17
+ validBeforeMount = true
18
+
13
19
  static getStaticConfig() {return {
14
20
  /**
15
21
  * Valid values for autoCapitalize
@@ -877,19 +883,17 @@ class Text extends Base {
877
883
  onFocusLeave(data) {
878
884
  let me = this,
879
885
  centerBorderEl = me.getCenterBorderEl(), // labelPosition: 'inline'
880
- cls = me.cls,
881
- vdom;
886
+ vdom = me.vdom;
882
887
 
883
- NeoArray.remove(cls, 'neo-focus');
888
+ me.updateValidationIndicators();
889
+
890
+ NeoArray.remove(me.cls, 'neo-focus');
884
891
 
885
892
  if (centerBorderEl && me.isEmpty()) {
886
- me._cls = cls; // silent update
887
- vdom = me.vdom;
888
893
  delete centerBorderEl.width;
889
- me.vdom = vdom;
890
- } else {
891
- me.cls = cls;
892
894
  }
895
+
896
+ me.vdom = vdom;
893
897
  }
894
898
 
895
899
  /**
@@ -1023,10 +1027,12 @@ class Text extends Base {
1023
1027
  let me = this,
1024
1028
  vdom = me.vdom;
1025
1029
 
1026
- NeoArray[!me.isValid() ? 'add' : 'remove'](me._cls, 'neo-invalid');
1030
+ if (!(me.validBeforeMount && !me.mounted)) {
1031
+ NeoArray[!me.isValid() ? 'add' : 'remove'](me._cls, 'neo-invalid');
1027
1032
 
1028
- if (!silent) {
1029
- me.vdom = vdom;
1033
+ if (!silent) {
1034
+ me.vdom = vdom;
1035
+ }
1030
1036
  }
1031
1037
  }
1032
1038
  }