neo.mjs 4.0.77 → 4.0.78
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 +1 -1
- package/src/form/field/Text.mjs +17 -1
- package/src/manager/Focus.mjs +6 -6
package/package.json
CHANGED
package/src/form/field/Text.mjs
CHANGED
@@ -81,6 +81,10 @@ class Text extends Base {
|
|
81
81
|
* @member {Boolean} hideLabel_=false
|
82
82
|
*/
|
83
83
|
hideLabel_: false,
|
84
|
+
/**
|
85
|
+
* @member {RegExp|null} inputPattern=null
|
86
|
+
*/
|
87
|
+
inputPattern_: null,
|
84
88
|
/**
|
85
89
|
* @member {String} inputType_='text'
|
86
90
|
*/
|
@@ -256,6 +260,16 @@ class Text extends Base {
|
|
256
260
|
super.afterSetId(value, oldValue);
|
257
261
|
}
|
258
262
|
|
263
|
+
/**
|
264
|
+
* Triggered after the inputPattern config got changed
|
265
|
+
* @param {RegExp|null} value
|
266
|
+
* @param {RegExp|null} oldValue
|
267
|
+
* @protected
|
268
|
+
*/
|
269
|
+
afterSetInputPattern(value, oldValue) {
|
270
|
+
|
271
|
+
}
|
272
|
+
|
259
273
|
/**
|
260
274
|
* Triggered after the inputType config got changed
|
261
275
|
* @param {String} value
|
@@ -911,7 +925,9 @@ class Text extends Base {
|
|
911
925
|
vnode.vnode.attributes.value = value;
|
912
926
|
}
|
913
927
|
|
914
|
-
if (
|
928
|
+
if (me.inputPattern && !me.inputPattern.test(value) ) {
|
929
|
+
me.afterSetValue(oldValue, value);
|
930
|
+
} else if (value !== oldValue) {
|
915
931
|
me.value = value;
|
916
932
|
}
|
917
933
|
}
|
package/src/manager/Focus.mjs
CHANGED
@@ -13,11 +13,6 @@ class Focus extends CoreBase {
|
|
13
13
|
* @protected
|
14
14
|
*/
|
15
15
|
className: 'Neo.manager.Focus',
|
16
|
-
/**
|
17
|
-
* @member {Boolean} singleton=true
|
18
|
-
* @protected
|
19
|
-
*/
|
20
|
-
singleton: true,
|
21
16
|
/**
|
22
17
|
* An array containing opts objects.
|
23
18
|
* opts.componentPath
|
@@ -47,7 +42,12 @@ class Focus extends CoreBase {
|
|
47
42
|
* The maximum amount of items stored inside the history array
|
48
43
|
* @member {Number} maxHistoryLength=20
|
49
44
|
*/
|
50
|
-
maxHistoryLength: 20
|
45
|
+
maxHistoryLength: 20,
|
46
|
+
/**
|
47
|
+
* @member {Boolean} singleton=true
|
48
|
+
* @protected
|
49
|
+
*/
|
50
|
+
singleton: true
|
51
51
|
}}
|
52
52
|
|
53
53
|
/**
|