neo.mjs 4.0.81 → 4.0.84
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.
@@ -153,6 +153,11 @@ class MainContainer extends ConfigurationViewport {
|
|
153
153
|
stepSize : 5,
|
154
154
|
style : {marginTop: '10px'},
|
155
155
|
value : me.exampleComponent.width
|
156
|
+
}, {
|
157
|
+
ntype : 'button',
|
158
|
+
handler: (() => {me.exampleComponent.reset()}),
|
159
|
+
style : {marginTop: '10px', width: '50%'},
|
160
|
+
text : 'reset()'
|
156
161
|
}];
|
157
162
|
}
|
158
163
|
|
package/package.json
CHANGED
@@ -194,9 +194,11 @@
|
|
194
194
|
}
|
195
195
|
|
196
196
|
.neo-textfield-error {
|
197
|
-
color
|
198
|
-
font-size
|
199
|
-
margin-top: .3em;
|
197
|
+
color : v(textfield-border-color-invalid);
|
198
|
+
font-size : 11px;
|
199
|
+
margin-top : .3em;
|
200
|
+
white-space: break-spaces;
|
201
|
+
word-break : break-word;
|
200
202
|
}
|
201
203
|
|
202
204
|
.neo-textfield-input {
|
package/src/form/Container.mjs
CHANGED
@@ -156,11 +156,11 @@ class Container extends BaseContainer {
|
|
156
156
|
* Updates the invalid state for all fields, which have updateValidationIndicators() implemented.
|
157
157
|
* This can be useful for create entity forms which show up "clean", when pressing a submit button.
|
158
158
|
*/
|
159
|
-
|
159
|
+
validate() {
|
160
160
|
let fields = this.getFields();
|
161
161
|
|
162
162
|
fields.forEach(item => {
|
163
|
-
item.
|
163
|
+
item.validate?.(false);
|
164
164
|
});
|
165
165
|
}
|
166
166
|
}
|
package/src/form/field/Text.mjs
CHANGED
@@ -969,11 +969,17 @@ class Text extends Base {
|
|
969
969
|
* @param {String|null} [value=null]
|
970
970
|
*/
|
971
971
|
reset(value=null) {
|
972
|
-
|
973
|
-
|
972
|
+
let me = this;
|
973
|
+
|
974
|
+
if (value && me.clearToOriginalValue) {
|
975
|
+
me.originalConfig.value = value;
|
974
976
|
}
|
975
977
|
|
976
978
|
super.reset(value);
|
979
|
+
|
980
|
+
if (value === null && me.validBeforeMount) {
|
981
|
+
me.updateError(null);
|
982
|
+
}
|
977
983
|
}
|
978
984
|
|
979
985
|
/**
|
@@ -1006,6 +1012,8 @@ class Text extends Base {
|
|
1006
1012
|
errorNode, isValid;
|
1007
1013
|
|
1008
1014
|
if (!(me.validBeforeMount && !me.mounted)) {
|
1015
|
+
me._error = value;
|
1016
|
+
|
1009
1017
|
isValid = !value || value === '';
|
1010
1018
|
|
1011
1019
|
NeoArray[!isValid ? 'add' : 'remove'](me._cls, 'neo-invalid');
|