cx 23.2.1 → 23.3.1

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/dist/util.js CHANGED
@@ -587,7 +587,7 @@ function parseStyle(str) {
587
587
 
588
588
  function quoteStr(str) {
589
589
  if (str == null) return str;
590
- return "'" + str.replace(/'/g, "\\i") + "'";
590
+ return JSON.stringify(str);
591
591
  }
592
592
 
593
593
  function findScrollableParent(sourceEl, horizontal) {
package/dist/widgets.js CHANGED
@@ -11709,7 +11709,7 @@ var Input$1 = /*#__PURE__*/ (function(_VDOM$Component) {
11709
11709
  var decimalSeparator = this.getDecimalSeparator(fmt) || Format.value(1.1, "n;1")[1];
11710
11710
  var formatted = Format.value(value, fmt); //re-parse to avoid differences between formatted value and value in the store
11711
11711
 
11712
- value = widget.parseValue(formatted, instance) * data.scale + data.offset; //allow users to type numbers like 100.0003 without interruptions
11712
+ value = widget.parseValue(formatted, instance) * data.scale + data.offset; //allow users to type numbers like 100.0003 or -0.05 without interruptions
11713
11713
  //if the last typed in character is zero or dot (decimal separator) skip processing it
11714
11714
 
11715
11715
  if (
@@ -11717,7 +11717,8 @@ var Input$1 = /*#__PURE__*/ (function(_VDOM$Component) {
11717
11717
  this.input.selectionStart == this.input.selectionEnd &&
11718
11718
  this.input.selectionEnd >= this.getLengthWithoutSuffix(this.input.value, decimalSeparator) &&
11719
11719
  (e.target.value[this.input.selectionEnd - 1] == decimalSeparator ||
11720
- (e.target.value.indexOf(decimalSeparator) >= 0 && e.target.value[this.input.selectionEnd - 1] == "0"))
11720
+ (e.target.value.indexOf(decimalSeparator) >= 0 && e.target.value[this.input.selectionEnd - 1] == "0") ||
11721
+ (this.input.selectionEnd == 2 && e.target.value[0] === "-" && e.target.value[1] === "0"))
11721
11722
  )
11722
11723
  return;
11723
11724
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cx",
3
- "version": "23.2.1",
3
+ "version": "23.3.1",
4
4
  "description": "Advanced JavaScript UI framework for admin and dashboard applications with ready to use grid, form and chart components.",
5
5
  "main": "index.js",
6
6
  "jsnext:main": "src/index.js",
@@ -1,68 +1,59 @@
1
- import {expression} from './Expression';
1
+ import { expression } from "./Expression";
2
2
 
3
- import {quoteStr} from '../util/quote';
3
+ import { quoteStr } from "../util/quote";
4
4
 
5
5
  function plus(str) {
6
- return str.length ? str + ' + ' : str;
6
+ return str.length ? str + " + " : str;
7
7
  }
8
8
 
9
- var tplCache = {};
9
+ let tplCache = {};
10
10
 
11
11
  export function stringTemplate(str) {
12
+ let expr = tplCache[str];
13
+ if (expr) return expr;
12
14
 
13
- var expr = tplCache[str];
14
- if (expr)
15
- return expr;
15
+ expr = "";
16
16
 
17
- expr = '';
18
-
19
- var termStart = -1,
17
+ let termStart = -1,
20
18
  quoteStart = 0,
21
19
  term,
22
20
  bracketsOpen = 0,
23
21
  percentSign;
24
22
 
25
- for (var i = 0; i < str.length; i++) {
26
- var c = str[i];
23
+ for (let i = 0; i < str.length; i++) {
24
+ let c = str[i];
27
25
  switch (c) {
28
-
29
- case '{':
26
+ case "{":
30
27
  if (termStart < 0) {
31
- if (str[i + 1] == '{' && str[i - 1] != '%') {
32
- expr = plus(expr) + quoteStr(str.substring(quoteStart, i) + '{');
28
+ if (str[i + 1] == "{" && str[i - 1] != "%") {
29
+ expr = plus(expr) + quoteStr(str.substring(quoteStart, i) + "{");
33
30
  i++;
34
31
  quoteStart = i + 1;
35
- }
36
- else {
32
+ } else {
37
33
  termStart = i + 1;
38
- percentSign = str[i - 1] == '%';
39
- if (i > quoteStart)
40
- expr = plus(expr) + quoteStr(str.substring(quoteStart, percentSign ? i-1 : i));
34
+ percentSign = str[i - 1] == "%";
35
+ if (i > quoteStart) expr = plus(expr) + quoteStr(str.substring(quoteStart, percentSign ? i - 1 : i));
41
36
  bracketsOpen = 1;
42
37
  }
43
- }
44
- else
45
- bracketsOpen++;
38
+ } else bracketsOpen++;
46
39
  break;
47
40
 
48
- case '}':
41
+ case "}":
49
42
  if (termStart >= 0) {
50
43
  if (--bracketsOpen == 0) {
51
44
  term = str.substring(termStart, i);
52
- if (term.indexOf(':') == -1) {
53
- let nullSepIndex = term.indexOf('|');
54
- if (nullSepIndex == -1)
55
- term += ':s';
56
- else
57
- term = term.substring(0, nullSepIndex) + ":s" + term.substring(nullSepIndex);
45
+ if (term.indexOf(":") == -1) {
46
+ let nullSepIndex = term.indexOf("|");
47
+ if (nullSepIndex == -1) term += ":s";
48
+ else term = term.substring(0, nullSepIndex) + ":s" + term.substring(nullSepIndex);
58
49
  }
59
- expr = plus(expr) + (percentSign ? '%{' : '{') + term + '}';
50
+ expr = plus(expr) + (percentSign ? "%{" : "{") + term + "}";
60
51
  termStart = -1;
61
52
  quoteStart = i + 1;
62
53
  bracketsOpen = 0;
63
54
  }
64
- } else if (str[i + 1] == '}') {
65
- expr = plus(expr) + quoteStr(str.substring(quoteStart, i) + '}');
55
+ } else if (str[i + 1] == "}") {
56
+ expr = plus(expr) + quoteStr(str.substring(quoteStart, i) + "}");
66
57
  i++;
67
58
  quoteStart = i + 1;
68
59
  }
@@ -70,16 +61,12 @@ export function stringTemplate(str) {
70
61
  }
71
62
  }
72
63
 
73
- if (quoteStart < str.length)
74
- expr = plus(expr) + quoteStr(str.substring(quoteStart));
75
-
76
- //console.log(expr);
64
+ if (quoteStart < str.length) expr = plus(expr) + quoteStr(str.substring(quoteStart));
77
65
 
78
- return tplCache[str] = expression(expr);
66
+ return (tplCache[str] = expression(expr));
79
67
  }
80
68
 
81
69
  export const StringTemplate = {
82
-
83
70
  get: function (str) {
84
71
  return stringTemplate(str);
85
72
  },
@@ -90,9 +77,9 @@ export const StringTemplate = {
90
77
 
91
78
  format: function (format, ...args) {
92
79
  return stringTemplate(format)(args);
93
- }
94
- }
80
+ },
81
+ };
95
82
 
96
83
  export function invalidateStringTemplateCache() {
97
84
  tplCache = {};
98
- }
85
+ }
@@ -1,82 +1,95 @@
1
- import {StringTemplate} from './StringTemplate';
2
- import assert from 'assert';
1
+ import { StringTemplate } from "./StringTemplate";
2
+ import assert from "assert";
3
3
 
4
- describe('StringTemplate', function() {
5
- describe('#compile()', function () {
6
- it('returns a selector', function () {
7
- var e = StringTemplate.compile('Hello {person.name}');
8
- var state = {
9
- person: {
10
- name: 'Jim'
11
- }
12
- };
13
- assert.equal(e(state), 'Hello Jim');
14
- });
15
- });
4
+ describe("StringTemplate", function () {
5
+ describe("#compile()", function () {
6
+ it("returns a selector", function () {
7
+ var e = StringTemplate.compile("Hello {person.name}");
8
+ var state = {
9
+ person: {
10
+ name: "Jim",
11
+ },
12
+ };
13
+ assert.equal(e(state), "Hello Jim");
14
+ });
15
+
16
+ it("properly encodes ' and \"", function () {
17
+ var e = StringTemplate.compile('It\'s "working"!');
18
+ assert.equal(e({}), 'It\'s "working"!');
19
+ });
20
+
21
+ it("supports multi-line strings", function () {
22
+ var e = StringTemplate.compile("a\nb");
23
+ assert.equal(e(), "a\nb");
24
+
25
+ var e = StringTemplate.compile("a\r\nb");
26
+ assert.equal(e(), "a\r\nb");
27
+ });
28
+ });
16
29
 
17
- describe('double brackets are used to escape brackets', function() {
18
- it('double brackets are preserved', function () {
19
- var e = StringTemplate.compile('Hello {{person.name}}');
30
+ describe("double brackets are used to escape brackets", function () {
31
+ it("double brackets are preserved", function () {
32
+ var e = StringTemplate.compile("Hello {{person.name}}");
20
33
  var state = {
21
34
  person: {
22
- name: 'Jim'
23
- }
35
+ name: "Jim",
36
+ },
24
37
  };
25
- assert.equal(e(state), 'Hello {person.name}');
38
+ assert.equal(e(state), "Hello {person.name}");
26
39
  });
27
40
 
28
- it('triple brackets are converted to single brackets and a binding', function () {
29
- var e = StringTemplate.compile('Hello {{{person.name}}}');
41
+ it("triple brackets are converted to single brackets and a binding", function () {
42
+ var e = StringTemplate.compile("Hello {{{person.name}}}");
30
43
  var state = {
31
44
  person: {
32
- name: 'Jim'
33
- }
45
+ name: "Jim",
46
+ },
34
47
  };
35
- assert.equal(e(state), 'Hello {Jim}');
48
+ assert.equal(e(state), "Hello {Jim}");
36
49
  });
37
50
  });
38
51
 
39
- describe('supports formatting', function() {
40
- it('with colon', function () {
41
- var e = StringTemplate.compile('{str:suffix;kg}');
42
- assert.equal(e({ str: '5'}), '5kg');
52
+ describe("supports formatting", function () {
53
+ it("with colon", function () {
54
+ var e = StringTemplate.compile("{str:suffix;kg}");
55
+ assert.equal(e({ str: "5" }), "5kg");
43
56
  });
44
57
 
45
- it('with multiple formats', function () {
46
- var e = StringTemplate.compile('{str:suffix;kg:wrap;(;)}');
47
- assert.equal(e({ str: '5'}), '(5kg)');
58
+ it("with multiple formats", function () {
59
+ var e = StringTemplate.compile("{str:suffix;kg:wrap;(;)}");
60
+ assert.equal(e({ str: "5" }), "(5kg)");
48
61
  });
49
62
 
50
63
  it("with null values", function () {
51
- var e = StringTemplate.compile('{str:suffix;kg:|N/A}');
52
- assert.equal(e({ str: null}), 'N/A');
64
+ var e = StringTemplate.compile("{str:suffix;kg:|N/A}");
65
+ assert.equal(e({ str: null }), "N/A");
53
66
  });
54
67
 
55
68
  it("of null values", function () {
56
- var e = StringTemplate.compile('{str|N/A}');
57
- assert.equal(e({ str: null}), 'N/A');
69
+ var e = StringTemplate.compile("{str|N/A}");
70
+ assert.equal(e({ str: null }), "N/A");
58
71
  });
59
72
  });
60
73
 
61
- describe('supports expressions', function() {
62
- it('using []', function () {
63
- var e = StringTemplate.compile('1 + 2 = {[1+2]}');
64
- assert.equal(e(), '1 + 2 = 3');
74
+ describe("supports expressions", function () {
75
+ it("using []", function () {
76
+ var e = StringTemplate.compile("1 + 2 = {[1+2]}");
77
+ assert.equal(e(), "1 + 2 = 3");
65
78
  });
66
79
 
67
- it('using %', function () {
68
- var e = StringTemplate.compile('1 + 2 = %{1+2}');
69
- assert.equal(e(), '1 + 2 = 3');
80
+ it("using %", function () {
81
+ var e = StringTemplate.compile("1 + 2 = %{1+2}");
82
+ assert.equal(e(), "1 + 2 = 3");
70
83
  });
71
84
 
72
- it('with subexpressions', function () {
73
- var e = StringTemplate.compile('1 + 2 = {[%{1+2}]}');
74
- assert.equal(e(), '1 + 2 = 3');
85
+ it("with subexpressions", function () {
86
+ var e = StringTemplate.compile("1 + 2 = {[%{1+2}]}");
87
+ assert.equal(e(), "1 + 2 = 3");
75
88
  });
76
89
 
77
- it('with a conditional operator', function () {
78
- var e = StringTemplate.compile('1 + 2 = {[true ? 3 : 2]:s}');
79
- assert.equal(e(), '1 + 2 = 3');
90
+ it("with a conditional operator", function () {
91
+ var e = StringTemplate.compile("1 + 2 = {[true ? 3 : 2]:s}");
92
+ assert.equal(e(), "1 + 2 = 3");
80
93
  });
81
94
  });
82
95
  });
@@ -21,6 +21,44 @@ export function computable(
21
21
  p4: string,
22
22
  computeFn: (v1: any, v2: any, v3: any, v4: any) => any
23
23
  ): Computable;
24
+ export function computable(
25
+ p1: string,
26
+ p2: string,
27
+ p3: string,
28
+ p4: string,
29
+ p5: string,
30
+ computeFn: (v1: any, v2: any, v3: any, v4: any, v5: any) => any
31
+ ): Computable;
32
+ export function computable(
33
+ p1: string,
34
+ p2: string,
35
+ p3: string,
36
+ p4: string,
37
+ p5: string,
38
+ p6: string,
39
+ computeFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any) => any
40
+ ): Computable;
41
+ export function computable(
42
+ p1: string,
43
+ p2: string,
44
+ p3: string,
45
+ p4: string,
46
+ p5: string,
47
+ p6: string,
48
+ p7: string,
49
+ computeFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any) => any
50
+ ): Computable;
51
+ export function computable(
52
+ p1: string,
53
+ p2: string,
54
+ p3: string,
55
+ p4: string,
56
+ p5: string,
57
+ p6: string,
58
+ p7: string,
59
+ p8: string,
60
+ computeFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any, v8: any) => any
61
+ ): Computable;
24
62
 
25
63
  export function computable<V1, R>(arg1: AccessorChain<V1>, compute: (v1: V1) => R): Computable<R>;
26
64
  export function computable<V1, V2, R>(
@@ -43,3 +81,45 @@ export function computable<V1, V2, V3, V4, R>(
43
81
  arg4: AccessorChain<V4>,
44
82
  compute: (v1: V1, v2: V2, v3: V3, v4: V4) => R
45
83
  ): Computable<R>;
84
+
85
+ export function computable<V1, V2, V3, V4, V5, R>(
86
+ arg1: AccessorChain<V1>,
87
+ arg2: AccessorChain<V2>,
88
+ arg3: AccessorChain<V3>,
89
+ arg4: AccessorChain<V4>,
90
+ arg5: AccessorChain<V5>,
91
+ compute: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5) => R
92
+ ): Computable<R>;
93
+
94
+ export function computable<V1, V2, V3, V4, V5, V6, R>(
95
+ arg1: AccessorChain<V1>,
96
+ arg2: AccessorChain<V2>,
97
+ arg3: AccessorChain<V3>,
98
+ arg4: AccessorChain<V4>,
99
+ arg5: AccessorChain<V5>,
100
+ arg6: AccessorChain<V6>,
101
+ compute: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5, v6: V6) => R
102
+ ): Computable<R>;
103
+
104
+ export function computable<V1, V2, V3, V4, V5, V6, V7, R>(
105
+ arg1: AccessorChain<V1>,
106
+ arg2: AccessorChain<V2>,
107
+ arg3: AccessorChain<V3>,
108
+ arg4: AccessorChain<V4>,
109
+ arg5: AccessorChain<V5>,
110
+ arg6: AccessorChain<V6>,
111
+ arg7: AccessorChain<V7>,
112
+ compute: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5, v6: V6, v7: V7) => R
113
+ ): Computable<R>;
114
+
115
+ export function computable<V1, V2, V3, V4, V5, V6, V7, V8, R>(
116
+ arg1: AccessorChain<V1>,
117
+ arg2: AccessorChain<V2>,
118
+ arg3: AccessorChain<V3>,
119
+ arg4: AccessorChain<V4>,
120
+ arg5: AccessorChain<V5>,
121
+ arg6: AccessorChain<V6>,
122
+ arg7: AccessorChain<V7>,
123
+ arg8: AccessorChain<V8>,
124
+ compute: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5, v6: V6, v7: V7, v8: V8) => R
125
+ ): Computable<R>;
@@ -37,6 +37,60 @@ export class Controller<D = any> {
37
37
  callback: (v1: V1, v2: V2, v3: V3, v4: V4) => void,
38
38
  autoRun?: boolean
39
39
  ): void;
40
+ addTrigger<V1, V2, V3, V4, V5>(
41
+ name: string,
42
+ args: [
43
+ Cx.AccessorChain<V1>,
44
+ Cx.AccessorChain<V2>,
45
+ Cx.AccessorChain<V3>,
46
+ Cx.AccessorChain<V4>,
47
+ Cx.AccessorChain<V5>
48
+ ],
49
+ callback: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5) => void,
50
+ autoRun?: boolean
51
+ ): void;
52
+ addTrigger<V1, V2, V3, V4, V5, V6>(
53
+ name: string,
54
+ args: [
55
+ Cx.AccessorChain<V1>,
56
+ Cx.AccessorChain<V2>,
57
+ Cx.AccessorChain<V3>,
58
+ Cx.AccessorChain<V4>,
59
+ Cx.AccessorChain<V5>,
60
+ Cx.AccessorChain<V6>
61
+ ],
62
+ callback: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5, v6: V6) => void,
63
+ autoRun?: boolean
64
+ ): void;
65
+ addTrigger<V1, V2, V3, V4, V5, V6, V7>(
66
+ name: string,
67
+ args: [
68
+ Cx.AccessorChain<V1>,
69
+ Cx.AccessorChain<V2>,
70
+ Cx.AccessorChain<V3>,
71
+ Cx.AccessorChain<V4>,
72
+ Cx.AccessorChain<V5>,
73
+ Cx.AccessorChain<V6>,
74
+ Cx.AccessorChain<V7>
75
+ ],
76
+ callback: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5, v6: V6, v7: V7) => void,
77
+ autoRun?: boolean
78
+ ): void;
79
+ addTrigger<V1, V2, V3, V4, V5, V6, V7, V8>(
80
+ name: string,
81
+ args: [
82
+ Cx.AccessorChain<V1>,
83
+ Cx.AccessorChain<V2>,
84
+ Cx.AccessorChain<V3>,
85
+ Cx.AccessorChain<V4>,
86
+ Cx.AccessorChain<V5>,
87
+ Cx.AccessorChain<V6>,
88
+ Cx.AccessorChain<V7>,
89
+ Cx.AccessorChain<V8>
90
+ ],
91
+ callback: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5, v6: V6, v7: V7, v8: v8) => void,
92
+ autoRun?: boolean
93
+ ): void;
40
94
 
41
95
  addTrigger(
42
96
  name: string,
@@ -61,6 +115,56 @@ export class Controller<D = any> {
61
115
  args: [Cx.AccessorChain<V1>, Cx.AccessorChain<V2>, Cx.AccessorChain<V3>, Cx.AccessorChain<V4>],
62
116
  callback: (v1: V1, v2: V2, v3: V3, v4: V4) => R
63
117
  ): void;
118
+ addComputable<V1, V2, V3, V4, V5, R>(
119
+ path: Cx.AccessorChain<R>,
120
+ args: [
121
+ Cx.AccessorChain<V1>,
122
+ Cx.AccessorChain<V2>,
123
+ Cx.AccessorChain<V3>,
124
+ Cx.AccessorChain<V4>,
125
+ Cx.AccessorChain<V5>
126
+ ],
127
+ callback: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5) => R
128
+ ): void;
129
+ addComputable<V1, V2, V3, V4, V5, V6, R>(
130
+ path: Cx.AccessorChain<R>,
131
+ args: [
132
+ Cx.AccessorChain<V1>,
133
+ Cx.AccessorChain<V2>,
134
+ Cx.AccessorChain<V3>,
135
+ Cx.AccessorChain<V4>,
136
+ Cx.AccessorChain<V5>,
137
+ Cx.AccessorChain<V6>
138
+ ],
139
+ callback: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5, v6: V6) => R
140
+ ): void;
141
+ addComputable<V1, V2, V3, V4, V5, V6, V7, R>(
142
+ path: Cx.AccessorChain<R>,
143
+ args: [
144
+ Cx.AccessorChain<V1>,
145
+ Cx.AccessorChain<V2>,
146
+ Cx.AccessorChain<V3>,
147
+ Cx.AccessorChain<V4>,
148
+ Cx.AccessorChain<V5>,
149
+ Cx.AccessorChain<V6>,
150
+ Cx.AccessorChain<V7>
151
+ ],
152
+ callback: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5, v6: V6, v7: V7) => R
153
+ ): void;
154
+ addComputable<V1, V2, V3, V4, V5, V6, V7, V8, R>(
155
+ path: Cx.AccessorChain<R>,
156
+ args: [
157
+ Cx.AccessorChain<V1>,
158
+ Cx.AccessorChain<V2>,
159
+ Cx.AccessorChain<V3>,
160
+ Cx.AccessorChain<V4>,
161
+ Cx.AccessorChain<V5>,
162
+ Cx.AccessorChain<V6>,
163
+ Cx.AccessorChain<V7>,
164
+ Cx.AccessorChain<V8>
165
+ ],
166
+ callback: (v1: V1, v2: V2, v3: V3, v4: V4, v5: V5, v6: V6, v7: V7, v8: V8) => R
167
+ ): void;
64
168
 
65
169
  addComputable(path: string, args: (string | Cx.AccessorChain<any>)[], callback: (...args) => any): void;
66
170
 
package/src/util/quote.js CHANGED
@@ -1,5 +1,4 @@
1
1
  export function quoteStr(str) {
2
- if (str==null)
3
- return str;
4
- return "'" + str.replace(/'/g, "\\i") + "'";
2
+ if (str == null) return str;
3
+ return JSON.stringify(str);
5
4
  }
@@ -30,7 +30,7 @@ interface DragSourceProps extends Cx.StyledContainerProps {
30
30
  clone?: Cx.Config;
31
31
 
32
32
  /** CSS styles to be applied to the clone of the element being dragged. */
33
- cloneStyle: Cx.StyleProp;
33
+ cloneStyle?: Cx.StyleProp;
34
34
 
35
35
  /** CSS styles to be applied to the element being dragged. */
36
36
  draggedStyle: Cx.StyleProp;
@@ -417,14 +417,15 @@ class Input extends VDOM.Component {
417
417
 
418
418
  value = widget.parseValue(formatted, instance) * data.scale + data.offset;
419
419
 
420
- //allow users to type numbers like 100.0003 without interruptions
420
+ //allow users to type numbers like 100.0003 or -0.05 without interruptions
421
421
  //if the last typed in character is zero or dot (decimal separator) skip processing it
422
422
  if (
423
423
  change == "change" &&
424
424
  this.input.selectionStart == this.input.selectionEnd &&
425
425
  this.input.selectionEnd >= this.getLengthWithoutSuffix(this.input.value, decimalSeparator) &&
426
426
  (e.target.value[this.input.selectionEnd - 1] == decimalSeparator ||
427
- (e.target.value.indexOf(decimalSeparator) >= 0 && e.target.value[this.input.selectionEnd - 1] == "0"))
427
+ (e.target.value.indexOf(decimalSeparator) >= 0 && e.target.value[this.input.selectionEnd - 1] == "0") ||
428
+ (this.input.selectionEnd == 2 && e.target.value[0] === "-" && e.target.value[1] === "0"))
428
429
  )
429
430
  return;
430
431