@sankhyalabs/core 5.20.0-dev.56 → 5.20.0-dev.57
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/.docs/classes/MaskFormatter.md +61 -13
- package/.docs/namespaces/MaskFormatter/type-aliases/MaskCharacter.md +1 -1
- package/.docs/namespaces/MaskFormatter/variables/MaskCharacter.md +1 -1
- package/dist/utils/MaskFormatter.d.ts +14 -0
- package/dist/utils/MaskFormatter.js +77 -1
- package/dist/utils/MaskFormatter.js.map +1 -1
- package/package.json +1 -1
- package/reports/test-report.xml +114 -114
- package/src/utils/MaskFormatter.ts +88 -1
|
@@ -66,7 +66,7 @@ resultaria na string '123-____'.
|
|
|
66
66
|
|
|
67
67
|
#### Source
|
|
68
68
|
|
|
69
|
-
src/utils/MaskFormatter.ts:
|
|
69
|
+
src/utils/MaskFormatter.ts:92
|
|
70
70
|
|
|
71
71
|
## Properties
|
|
72
72
|
|
|
@@ -76,7 +76,7 @@ src/utils/MaskFormatter.ts:91
|
|
|
76
76
|
|
|
77
77
|
#### Source
|
|
78
78
|
|
|
79
|
-
src/utils/MaskFormatter.ts:
|
|
79
|
+
src/utils/MaskFormatter.ts:66
|
|
80
80
|
|
|
81
81
|
***
|
|
82
82
|
|
|
@@ -86,7 +86,7 @@ src/utils/MaskFormatter.ts:65
|
|
|
86
86
|
|
|
87
87
|
#### Source
|
|
88
88
|
|
|
89
|
-
src/utils/MaskFormatter.ts:
|
|
89
|
+
src/utils/MaskFormatter.ts:67
|
|
90
90
|
|
|
91
91
|
***
|
|
92
92
|
|
|
@@ -99,7 +99,7 @@ ou seja, aqueles que o usuário ainda não informou. Por padrão usamos um espa
|
|
|
99
99
|
|
|
100
100
|
#### Source
|
|
101
101
|
|
|
102
|
-
src/utils/MaskFormatter.ts:
|
|
102
|
+
src/utils/MaskFormatter.ts:73
|
|
103
103
|
|
|
104
104
|
***
|
|
105
105
|
|
|
@@ -129,7 +129,7 @@ src/utils/MaskFormatter.ts:55
|
|
|
129
129
|
|
|
130
130
|
#### Source
|
|
131
131
|
|
|
132
|
-
src/utils/MaskFormatter.ts:
|
|
132
|
+
src/utils/MaskFormatter.ts:466
|
|
133
133
|
|
|
134
134
|
***
|
|
135
135
|
|
|
@@ -149,7 +149,7 @@ src/utils/MaskFormatter.ts:54
|
|
|
149
149
|
|
|
150
150
|
#### Source
|
|
151
151
|
|
|
152
|
-
src/utils/MaskFormatter.ts:
|
|
152
|
+
src/utils/MaskFormatter.ts:480
|
|
153
153
|
|
|
154
154
|
***
|
|
155
155
|
|
|
@@ -179,7 +179,7 @@ src/utils/MaskFormatter.ts:49
|
|
|
179
179
|
|
|
180
180
|
#### Source
|
|
181
181
|
|
|
182
|
-
src/utils/MaskFormatter.ts:
|
|
182
|
+
src/utils/MaskFormatter.ts:391
|
|
183
183
|
|
|
184
184
|
***
|
|
185
185
|
|
|
@@ -209,7 +209,7 @@ src/utils/MaskFormatter.ts:52
|
|
|
209
209
|
|
|
210
210
|
#### Source
|
|
211
211
|
|
|
212
|
-
src/utils/MaskFormatter.ts:
|
|
212
|
+
src/utils/MaskFormatter.ts:372
|
|
213
213
|
|
|
214
214
|
***
|
|
215
215
|
|
|
@@ -219,7 +219,7 @@ src/utils/MaskFormatter.ts:285
|
|
|
219
219
|
|
|
220
220
|
#### Source
|
|
221
221
|
|
|
222
|
-
src/utils/MaskFormatter.ts:
|
|
222
|
+
src/utils/MaskFormatter.ts:443
|
|
223
223
|
|
|
224
224
|
***
|
|
225
225
|
|
|
@@ -239,7 +239,7 @@ src/utils/MaskFormatter.ts:51
|
|
|
239
239
|
|
|
240
240
|
#### Source
|
|
241
241
|
|
|
242
|
-
src/utils/MaskFormatter.ts:
|
|
242
|
+
src/utils/MaskFormatter.ts:420
|
|
243
243
|
|
|
244
244
|
## Accessors
|
|
245
245
|
|
|
@@ -265,10 +265,34 @@ A última máscara informada.
|
|
|
265
265
|
|
|
266
266
|
#### Source
|
|
267
267
|
|
|
268
|
-
src/utils/MaskFormatter.ts:
|
|
268
|
+
src/utils/MaskFormatter.ts:88
|
|
269
269
|
|
|
270
270
|
## Methods
|
|
271
271
|
|
|
272
|
+
### applyMask()
|
|
273
|
+
|
|
274
|
+
> **applyMask**(`value`): `string`
|
|
275
|
+
|
|
276
|
+
Aplica a máscara quando o input é alterado
|
|
277
|
+
|
|
278
|
+
#### Parameters
|
|
279
|
+
|
|
280
|
+
• **value**: `string`
|
|
281
|
+
|
|
282
|
+
Valor a ser aplicado com a máscara.
|
|
283
|
+
|
|
284
|
+
#### Returns
|
|
285
|
+
|
|
286
|
+
`string`
|
|
287
|
+
|
|
288
|
+
O valor processado de acordo com o padrão.
|
|
289
|
+
|
|
290
|
+
#### Source
|
|
291
|
+
|
|
292
|
+
src/utils/MaskFormatter.ts:103
|
|
293
|
+
|
|
294
|
+
***
|
|
295
|
+
|
|
272
296
|
### format()
|
|
273
297
|
|
|
274
298
|
> **format**(`value`, `trimBefore`): `string`
|
|
@@ -293,7 +317,31 @@ O valor processado de acordo com o padrão.
|
|
|
293
317
|
|
|
294
318
|
#### Source
|
|
295
319
|
|
|
296
|
-
src/utils/MaskFormatter.ts:
|
|
320
|
+
src/utils/MaskFormatter.ts:189
|
|
321
|
+
|
|
322
|
+
***
|
|
323
|
+
|
|
324
|
+
### removeMask()
|
|
325
|
+
|
|
326
|
+
> **removeMask**(`value`): `string`
|
|
327
|
+
|
|
328
|
+
Remove a máscara formatando a string retornando sem máscara
|
|
329
|
+
|
|
330
|
+
#### Parameters
|
|
331
|
+
|
|
332
|
+
• **value**: `string`
|
|
333
|
+
|
|
334
|
+
Valor a ser formatado com máscara.
|
|
335
|
+
|
|
336
|
+
#### Returns
|
|
337
|
+
|
|
338
|
+
`string`
|
|
339
|
+
|
|
340
|
+
O valor processado de acordo com o padrão.
|
|
341
|
+
|
|
342
|
+
#### Source
|
|
343
|
+
|
|
344
|
+
src/utils/MaskFormatter.ts:169
|
|
297
345
|
|
|
298
346
|
***
|
|
299
347
|
|
|
@@ -309,4 +357,4 @@ Prepara a formatação internamente de acordo com o padrão.
|
|
|
309
357
|
|
|
310
358
|
#### Source
|
|
311
359
|
|
|
312
|
-
src/utils/MaskFormatter.ts:
|
|
360
|
+
src/utils/MaskFormatter.ts:209
|
|
@@ -71,6 +71,20 @@ export declare class MaskFormatter {
|
|
|
71
71
|
*/
|
|
72
72
|
get mask(): string;
|
|
73
73
|
constructor(mask: string);
|
|
74
|
+
/**
|
|
75
|
+
* Aplica a máscara quando o input é alterado
|
|
76
|
+
*
|
|
77
|
+
* @param value Valor a ser aplicado com a máscara.
|
|
78
|
+
* @return O valor processado de acordo com o padrão.
|
|
79
|
+
*/
|
|
80
|
+
applyMask(value: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* Remove a máscara formatando a string retornando sem máscara
|
|
83
|
+
*
|
|
84
|
+
* @param value Valor a ser formatado com máscara.
|
|
85
|
+
* @return O valor processado de acordo com o padrão.
|
|
86
|
+
*/
|
|
87
|
+
removeMask(value: string): string;
|
|
74
88
|
/**
|
|
75
89
|
* Formata a string passada baseada na máscara definda pelo atributo mask.
|
|
76
90
|
*
|
|
@@ -70,6 +70,81 @@ export class MaskFormatter {
|
|
|
70
70
|
this.placeholder = ' ';
|
|
71
71
|
this.mask = mask;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Aplica a máscara quando o input é alterado
|
|
75
|
+
*
|
|
76
|
+
* @param value Valor a ser aplicado com a máscara.
|
|
77
|
+
* @return O valor processado de acordo com o padrão.
|
|
78
|
+
*/
|
|
79
|
+
applyMask(value) {
|
|
80
|
+
if (this.mask === MaskFormatter.DEFAULT_MASKS.cor_rgb) {
|
|
81
|
+
value = value.replace("#", "");
|
|
82
|
+
const expectedFormattedValue = this.format(value.replace(/\s/g, ""));
|
|
83
|
+
if (value === expectedFormattedValue) {
|
|
84
|
+
return value;
|
|
85
|
+
}
|
|
86
|
+
if (value.length >= 6) {
|
|
87
|
+
const formattedValue = this.format(value);
|
|
88
|
+
return formattedValue;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const expectedFormattedValue = this.format(value.replace(/\s/g, ""));
|
|
95
|
+
if (value === expectedFormattedValue) {
|
|
96
|
+
return value;
|
|
97
|
+
}
|
|
98
|
+
const maskPlaceholders = this.mask.match(/[UAL#?*']/g) || [];
|
|
99
|
+
const placeholderCount = maskPlaceholders.length;
|
|
100
|
+
const validValue = value.split('').filter((char, index) => {
|
|
101
|
+
const placeholder = maskPlaceholders[index];
|
|
102
|
+
if (!placeholder)
|
|
103
|
+
return false;
|
|
104
|
+
switch (placeholder) {
|
|
105
|
+
case MaskFormatter.DIGIT_KEY:
|
|
106
|
+
return /\d/.test(char);
|
|
107
|
+
case MaskFormatter.UPPERCASE_KEY:
|
|
108
|
+
return /[a-zA-Z]/.test(char);
|
|
109
|
+
case MaskFormatter.LOWERCASE_KEY:
|
|
110
|
+
return /[a-zA-Z]/.test(char);
|
|
111
|
+
case MaskFormatter.ALPHA_NUMERIC_KEY:
|
|
112
|
+
return /[a-zA-Z0-9]/.test(char);
|
|
113
|
+
case MaskFormatter.CHARACTER_KEY:
|
|
114
|
+
return /[a-zA-Z]/.test(char);
|
|
115
|
+
case MaskFormatter.ANYTHING_KEY:
|
|
116
|
+
return true;
|
|
117
|
+
case MaskFormatter.LITERAL_KEY:
|
|
118
|
+
const literalChar = this.mask.charAt(index);
|
|
119
|
+
return char === literalChar;
|
|
120
|
+
default:
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
if (validValue.length >= placeholderCount) {
|
|
125
|
+
const formattedValue = this.format(validValue.join(''));
|
|
126
|
+
return formattedValue;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
const partialValue = validValue.join('');
|
|
130
|
+
return partialValue;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Remove a máscara formatando a string retornando sem máscara
|
|
135
|
+
*
|
|
136
|
+
* @param value Valor a ser formatado com máscara.
|
|
137
|
+
* @return O valor processado de acordo com o padrão.
|
|
138
|
+
*/
|
|
139
|
+
removeMask(value) {
|
|
140
|
+
const maskString = this.mask.replace("#", "");
|
|
141
|
+
const maskElements = maskString.split("");
|
|
142
|
+
let valueMapped = value;
|
|
143
|
+
maskElements.forEach(maskChar => {
|
|
144
|
+
valueMapped = valueMapped.replace(maskChar, "");
|
|
145
|
+
});
|
|
146
|
+
return valueMapped;
|
|
147
|
+
}
|
|
73
148
|
/**
|
|
74
149
|
* Formata a string passada baseada na máscara definda pelo atributo mask.
|
|
75
150
|
*
|
|
@@ -146,7 +221,8 @@ MaskFormatter.DEFAULT_MASKS = {
|
|
|
146
221
|
"cnpj": "##.###.###/####-##",
|
|
147
222
|
"cpf": "###.###.###-##",
|
|
148
223
|
"phone": "(##) ####-####",
|
|
149
|
-
"cep": "##.###-###"
|
|
224
|
+
"cep": "##.###-###",
|
|
225
|
+
"cor_rgb": "'#AAAAAA"
|
|
150
226
|
};
|
|
151
227
|
//
|
|
152
228
|
// Classes internas usadas para representar a máscara.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaskFormatter.js","sourceRoot":"","sources":["../../src/utils/MaskFormatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,OAAO,aAAa;
|
|
1
|
+
{"version":3,"file":"MaskFormatter.js","sourceRoot":"","sources":["../../src/utils/MaskFormatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,OAAO,aAAa;IA4BtB;;OAEG;IACH,IAAW,IAAI,CAAC,IAAY;QACxB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC9B,CAAC;IA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C,CAAC,CAAC;IACnE,CAAC;IAED;;;;;MAKE;IACK,OAAO,CAAC,KAAa;QACxB,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC/B,CAAC;CACJ,CAAA;AAEc,gCAAkB,GAAG,KAAM,SAAQ,aAAa,CAAC,aAAa;IAEzE;;;;;MAKE;IACK,gBAAgB,CAAC,KAAa;QACjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;IAED;;;;;MAKE;IACK,OAAO,CAAC,KAAa;QACxB,OAAO,KAAK,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;CACJ,CAAA;AAEc,mCAAqB,GAAG,KAAM,SAAQ,aAAa,CAAC,aAAa;IAE5E;;;;;MAKE;IACK,gBAAgB,CAAC,KAAa;QACjC,qFAAqF;QACrF,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC;CACJ,CAAA;AAEc,2BAAa,GAAG,KAAM,SAAQ,aAAa,CAAC,aAAa;IACpE;;;;;MAKE;IACK,gBAAgB,CAAC,KAAa;QACjC,oFAAoF;QACpF,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;CAEJ,CAAA"}
|
package/package.json
CHANGED
package/reports/test-report.xml
CHANGED
|
@@ -1,175 +1,175 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<unitTest version="1">
|
|
3
|
-
<file path="/builds/dti/design-system/sankhyacore/
|
|
4
|
-
<testCase name="
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<testCase name="
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<testCase name="
|
|
11
|
-
<testCase name="
|
|
12
|
-
<testCase name="
|
|
13
|
-
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="1"/>
|
|
14
|
-
<testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
|
|
15
|
-
<testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
|
|
16
|
-
<testCase name="ObjectUtils should return undefined if the path doesn't exist in the object" duration="0"/>
|
|
3
|
+
<file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
|
|
4
|
+
<testCase name="HttpProvider Metodo POST" duration="93"/>
|
|
5
|
+
</file>
|
|
6
|
+
<file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
|
|
7
|
+
<testCase name="HttpProvider Metodo GET" duration="21"/>
|
|
8
|
+
</file>
|
|
9
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
|
|
10
|
+
<testCase name="StringUtils it should return the correct values of "value" and "type" through the getters methods initial setted by the constructor" duration="115"/>
|
|
11
|
+
<testCase name="StringUtils it should return the correct values of "value" and "type" through the getters methods initial setted by the setters methods" duration="1"/>
|
|
12
|
+
<testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
|
|
17
13
|
</file>
|
|
18
14
|
<file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
|
|
19
|
-
<testCase name="Mask Formatter mask:CPF complete valid" duration="
|
|
20
|
-
<testCase name="Mask Formatter mask:CPF complete valid literals" duration="
|
|
21
|
-
<testCase name="Mask Formatter mask:CPF incomplete valid" duration="
|
|
15
|
+
<testCase name="Mask Formatter mask:CPF complete valid" duration="20"/>
|
|
16
|
+
<testCase name="Mask Formatter mask:CPF complete valid literals" duration="64"/>
|
|
17
|
+
<testCase name="Mask Formatter mask:CPF incomplete valid" duration="1"/>
|
|
22
18
|
<testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
|
|
23
|
-
<testCase name="Mask Formatter mask:CPF too long valid" duration="
|
|
19
|
+
<testCase name="Mask Formatter mask:CPF too long valid" duration="1"/>
|
|
24
20
|
<testCase name="Mask Formatter mask:CPF invalid for string" duration="197"/>
|
|
25
|
-
<testCase name="Mask Formatter mask:CPF invalid for being too long" duration="
|
|
26
|
-
<testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="
|
|
21
|
+
<testCase name="Mask Formatter mask:CPF invalid for being too long" duration="1"/>
|
|
22
|
+
<testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="0"/>
|
|
27
23
|
<testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
|
|
28
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="
|
|
24
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
|
|
29
25
|
<testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="1"/>
|
|
30
|
-
<testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="
|
|
31
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="
|
|
26
|
+
<testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="0"/>
|
|
27
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="11"/>
|
|
32
28
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
|
|
33
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="
|
|
34
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
35
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
|
|
36
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
|
|
29
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
|
|
37
30
|
<testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
|
|
38
31
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
|
|
39
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="
|
|
32
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
|
|
40
33
|
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
34
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="4"/>
|
|
35
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
|
|
36
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="5"/>
|
|
37
|
+
</file>
|
|
38
|
+
<file path="/builds/dti/design-system/sankhyacore/src/utils/test/objectUtils.spec.ts">
|
|
39
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="14"/>
|
|
40
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="1"/>
|
|
41
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="1"/>
|
|
42
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="1"/>
|
|
43
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="1"/>
|
|
44
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="73"/>
|
|
45
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="0"/>
|
|
46
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="0"/>
|
|
47
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="0"/>
|
|
48
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="1"/>
|
|
49
|
+
<testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
|
|
50
|
+
<testCase name="ObjectUtils should get an object value based on its path" duration="213"/>
|
|
51
|
+
<testCase name="ObjectUtils should return undefined if the path doesn't exist in the object" duration="0"/>
|
|
41
52
|
</file>
|
|
42
53
|
<file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
|
|
43
|
-
<testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="
|
|
54
|
+
<testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="15"/>
|
|
44
55
|
<testCase name="StringUtils it should modify "expressions" and "parameters" properties through Setters methods" duration="1"/>
|
|
45
|
-
<testCase name="StringUtils it should return "expression" and "parameters" setted through constructor method" duration="
|
|
46
|
-
<testCase name="StringUtils it should return a Criteria class with "expression" and "parameters" as needed setted through "append" method" duration="
|
|
47
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "append" method" duration="
|
|
56
|
+
<testCase name="StringUtils it should return "expression" and "parameters" setted through constructor method" duration="2"/>
|
|
57
|
+
<testCase name="StringUtils it should return a Criteria class with "expression" and "parameters" as needed setted through "append" method" duration="2"/>
|
|
58
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "append" method" duration="2"/>
|
|
48
59
|
<testCase name="StringUtils it should return undefined as "expression" and "[]" as parameters as we use an empty criteria as first entry in the constructor" duration="1"/>
|
|
49
60
|
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
50
61
|
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
51
62
|
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
52
|
-
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "AND" method" duration="
|
|
53
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="
|
|
63
|
+
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "AND" method" duration="5"/>
|
|
64
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="4"/>
|
|
54
65
|
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
55
|
-
<testCase name="StringUtils it should return a toJSON object with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="
|
|
56
|
-
<testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="
|
|
66
|
+
<testCase name="StringUtils it should return a toJSON object with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
67
|
+
<testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
|
|
57
68
|
</file>
|
|
58
|
-
<file path="/builds/dti/design-system/sankhyacore/test/
|
|
59
|
-
<testCase name="
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
<testCase name="StringUtils stringToNumber" duration="88"/>
|
|
63
|
-
<testCase name="StringUtils format" duration="92"/>
|
|
64
|
-
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
65
|
-
<testCase name="StringUtils format without formatnumber parameter" duration="2"/>
|
|
66
|
-
<testCase name="StringUtils format round number" duration="2"/>
|
|
69
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
|
|
70
|
+
<testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="10"/>
|
|
71
|
+
<testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="0"/>
|
|
72
|
+
<testCase name="TimeFormatter Case: validateTime" duration="1"/>
|
|
67
73
|
</file>
|
|
68
|
-
<file path="/builds/dti/design-system/sankhyacore/test/
|
|
69
|
-
<testCase name="
|
|
70
|
-
<testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
|
|
71
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate" duration="289"/>
|
|
72
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="18"/>
|
|
73
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="83"/>
|
|
74
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="7"/>
|
|
75
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="99"/>
|
|
76
|
-
<testCase name="OverflowWatcher should ignore elements that can not overflow" duration="103"/>
|
|
77
|
-
<testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
|
|
74
|
+
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/state/slice/test/RecordsSlice.spec.ts">
|
|
75
|
+
<testCase name="RecordsSlice should return newlines at the end" duration="2"/>
|
|
78
76
|
</file>
|
|
79
77
|
<file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
|
|
80
|
-
<testCase name="StringUtils valor vazio" duration="
|
|
78
|
+
<testCase name="StringUtils valor vazio" duration="83"/>
|
|
81
79
|
<testCase name="StringUtils valor em branco" duration="1"/>
|
|
82
|
-
<testCase name="StringUtils valor null" duration="
|
|
83
|
-
<testCase name="StringUtils valor undefined" duration="
|
|
80
|
+
<testCase name="StringUtils valor null" duration="2"/>
|
|
81
|
+
<testCase name="StringUtils valor undefined" duration="1"/>
|
|
84
82
|
<testCase name="StringUtils valor 0" duration="1"/>
|
|
85
83
|
<testCase name="StringUtils com valor" duration="0"/>
|
|
86
|
-
<testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="
|
|
87
|
-
<testCase name="StringUtils should return the original value when called with an object without a toString method" duration="
|
|
88
|
-
<testCase name="StringUtils should return the original value when called with undefined" duration="
|
|
89
|
-
</file>
|
|
90
|
-
<file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
|
|
91
|
-
<testCase name="HttpProvider Metodo POST" duration="0"/>
|
|
84
|
+
<testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="11"/>
|
|
85
|
+
<testCase name="StringUtils should return the original value when called with an object without a toString method" duration="3"/>
|
|
86
|
+
<testCase name="StringUtils should return the original value when called with undefined" duration="1"/>
|
|
92
87
|
</file>
|
|
93
|
-
<file path="/builds/dti/design-system/sankhyacore/test/util/
|
|
94
|
-
<testCase name="StringUtils
|
|
95
|
-
<testCase name="StringUtils
|
|
96
|
-
<testCase name="StringUtils
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="2"/>
|
|
100
|
-
<testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="1"/>
|
|
101
|
-
<testCase name="TimeFormatter Case: validateTime" duration="1"/>
|
|
102
|
-
</file>
|
|
103
|
-
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/state/slice/test/RecordsSlice.spec.ts">
|
|
104
|
-
<testCase name="RecordsSlice should return newlines at the end" duration="2"/>
|
|
88
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
|
|
89
|
+
<testCase name="StringUtils stringToNumber" duration="119"/>
|
|
90
|
+
<testCase name="StringUtils format" duration="288"/>
|
|
91
|
+
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
92
|
+
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
93
|
+
<testCase name="StringUtils format round number" duration="1"/>
|
|
105
94
|
</file>
|
|
106
|
-
<file path="/builds/dti/design-system/sankhyacore/
|
|
107
|
-
<testCase name="
|
|
108
|
-
<testCase name="
|
|
109
|
-
<testCase name="
|
|
110
|
-
<testCase name="
|
|
95
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
|
|
96
|
+
<testCase name="OverflowWatcher should initialize with provided parameters" duration="22"/>
|
|
97
|
+
<testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
|
|
98
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate" duration="422"/>
|
|
99
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="90"/>
|
|
100
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="96"/>
|
|
101
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="10"/>
|
|
102
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="8"/>
|
|
103
|
+
<testCase name="OverflowWatcher should ignore elements that can not overflow" duration="177"/>
|
|
104
|
+
<testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
|
|
111
105
|
</file>
|
|
112
106
|
<file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
|
|
113
|
-
<testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="
|
|
114
|
-
<testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="
|
|
107
|
+
<testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="8"/>
|
|
108
|
+
<testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="4"/>
|
|
115
109
|
<testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
|
|
116
110
|
<testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
|
|
117
111
|
<testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
|
|
118
|
-
<testCase name="DataUnitStorage remove should not remove any DataUnit instance if the specified DataUnit instance or name is not found in the DataUnitStorage" duration="
|
|
112
|
+
<testCase name="DataUnitStorage remove should not remove any DataUnit instance if the specified DataUnit instance or name is not found in the DataUnitStorage" duration="1"/>
|
|
113
|
+
</file>
|
|
114
|
+
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
|
|
115
|
+
<testCase name="DataUnit should return false when not waiting to reload" duration="3"/>
|
|
116
|
+
<testCase name="DataUnit should set waitingToReload to true" duration="1"/>
|
|
117
|
+
<testCase name="DataUnit should set waitingToReload to false" duration="0"/>
|
|
118
|
+
<testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="2"/>
|
|
119
119
|
</file>
|
|
120
120
|
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
|
|
121
|
-
<testCase name="addIDInfo 1 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="
|
|
122
|
-
<testCase name="addIDInfo 2 - should add data-element-id with valid id "brComSankhyaFinCadMovimentacaofinanceira_snkApplication"" duration="
|
|
121
|
+
<testCase name="addIDInfo 1 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="12"/>
|
|
122
|
+
<testCase name="addIDInfo 2 - should add data-element-id with valid id "brComSankhyaFinCadMovimentacaofinanceira_snkApplication"" duration="3"/>
|
|
123
123
|
<testCase name="addIDInfo 3 - should add data-element-id with valid id "movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="2"/>
|
|
124
124
|
<testCase name="addIDInfo 4 - should add data-element-id with valid id "meuID2_snkApplication"" duration="1"/>
|
|
125
|
-
<testCase name="addIDInfo 5 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="
|
|
125
|
+
<testCase name="addIDInfo 5 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="2"/>
|
|
126
126
|
<testCase name="addIDInfo 6 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="1"/>
|
|
127
|
-
<testCase name="addIDInfo 7 - should add data-element-id with valid id "componenteNameTest_snkApplication"" duration="
|
|
128
|
-
<testCase name="addIDInfo 8 - should add data-element-id with valid id "componentLabel_snkApplication"" duration="
|
|
127
|
+
<testCase name="addIDInfo 7 - should add data-element-id with valid id "componenteNameTest_snkApplication"" duration="1"/>
|
|
128
|
+
<testCase name="addIDInfo 8 - should add data-element-id with valid id "componentLabel_snkApplication"" duration="1"/>
|
|
129
129
|
<testCase name="addIDInfo 9 - should add data-element-id with valid id "dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="2"/>
|
|
130
|
-
<testCase name="addIDInfo 10 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="
|
|
130
|
+
<testCase name="addIDInfo 10 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="2"/>
|
|
131
131
|
<testCase name="addIDInfo 11 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="2"/>
|
|
132
132
|
<testCase name="addIDInfo 12 - should add data-element-id with valid id "dataunitFinanceiro_movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
133
|
-
<testCase name="addIDInfo 13 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="
|
|
134
|
-
<testCase name="addIDInfo 14 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira"" duration="
|
|
133
|
+
<testCase name="addIDInfo 13 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="1"/>
|
|
134
|
+
<testCase name="addIDInfo 14 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira"" duration="2"/>
|
|
135
135
|
<testCase name="addIDInfo 15 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="1"/>
|
|
136
136
|
<testCase name="addIDInfo 16 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="1"/>
|
|
137
137
|
<testCase name="addIDInfo 17 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
138
138
|
<testCase name="addIDInfo 18 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
139
|
-
<testCase name="addIDInfo 19 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="
|
|
139
|
+
<testCase name="addIDInfo 19 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
140
140
|
<testCase name="addIDInfo 20 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
141
|
-
<testCase name="addIDInfo 21 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="
|
|
141
|
+
<testCase name="addIDInfo 21 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
142
142
|
<testCase name="addIDInfo 22 - should add data-element-id with valid id "bancoObrigatorio_movimentacaoFinanceira"" duration="1"/>
|
|
143
143
|
</file>
|
|
144
|
-
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
|
|
145
|
-
<testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="28"/>
|
|
146
|
-
<testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="2"/>
|
|
147
|
-
<testCase name="calcMarginSize should threat values defined as zero" duration="3"/>
|
|
148
|
-
</file>
|
|
149
144
|
<file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
|
|
150
145
|
<testCase name="getFormattedValue should return empty string when value is null" duration="4"/>
|
|
151
|
-
<testCase name="getFormattedValue should return empty string when value is not an array" duration="
|
|
146
|
+
<testCase name="getFormattedValue should return empty string when value is not an array" duration="0"/>
|
|
152
147
|
<testCase name="getFormattedValue should return empty string when value is an empty array" duration="0"/>
|
|
153
|
-
<testCase name="getFormattedValue should return file name when value is an array with one file object" duration="
|
|
148
|
+
<testCase name="getFormattedValue should return file name when value is an array with one file object" duration="0"/>
|
|
154
149
|
<testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="0"/>
|
|
155
|
-
<testCase name="getFormattedValue should return empty string for undefined file" duration="
|
|
156
|
-
<testCase name="getFormattedValue should handle OBJECT type with value field" duration="
|
|
157
|
-
<testCase name="getFormattedValue should return empty string when value is undefined" duration="
|
|
150
|
+
<testCase name="getFormattedValue should return empty string for undefined file" duration="1"/>
|
|
151
|
+
<testCase name="getFormattedValue should handle OBJECT type with value field" duration="36"/>
|
|
152
|
+
<testCase name="getFormattedValue should return empty string when value is undefined" duration="1"/>
|
|
158
153
|
<testCase name="getFormattedValue should return value as string when value is not an object" duration="0"/>
|
|
159
154
|
<testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="0"/>
|
|
160
|
-
<testCase name="getFormattedValue should handle BOOLEAN type" duration="
|
|
161
|
-
<testCase name="getFormattedValue should format numbers correctly" duration="
|
|
162
|
-
<testCase name="getFormattedValue should format dates correctly" duration="
|
|
155
|
+
<testCase name="getFormattedValue should handle BOOLEAN type" duration="1"/>
|
|
156
|
+
<testCase name="getFormattedValue should format numbers correctly" duration="17"/>
|
|
157
|
+
<testCase name="getFormattedValue should format dates correctly" duration="5"/>
|
|
163
158
|
<testCase name="getFormattedValue should format times correctly" duration="1"/>
|
|
164
|
-
<testCase name="getFormattedValue should format datetime correctly" duration="
|
|
165
|
-
<testCase name="getFormattedValue should call toString with correct parameters" duration="
|
|
166
|
-
<testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="
|
|
167
|
-
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="
|
|
168
|
-
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="
|
|
159
|
+
<testCase name="getFormattedValue should format datetime correctly" duration="1"/>
|
|
160
|
+
<testCase name="getFormattedValue should call toString with correct parameters" duration="0"/>
|
|
161
|
+
<testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="0"/>
|
|
162
|
+
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="1"/>
|
|
163
|
+
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="0"/>
|
|
169
164
|
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
|
|
170
165
|
<testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
|
|
171
|
-
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="
|
|
166
|
+
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="1"/>
|
|
172
167
|
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="0"/>
|
|
173
|
-
<testCase name="getFormattedValue should format masked values correctly" duration="
|
|
168
|
+
<testCase name="getFormattedValue should format masked values correctly" duration="2"/>
|
|
169
|
+
</file>
|
|
170
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
|
|
171
|
+
<testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="68"/>
|
|
172
|
+
<testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="3"/>
|
|
173
|
+
<testCase name="calcMarginSize should threat values defined as zero" duration="5"/>
|
|
174
174
|
</file>
|
|
175
175
|
</unitTest>
|
|
@@ -58,7 +58,8 @@ export class MaskFormatter {
|
|
|
58
58
|
"cnpj": "##.###.###/####-##",
|
|
59
59
|
"cpf": "###.###.###-##",
|
|
60
60
|
"phone": "(##) ####-####",
|
|
61
|
-
"cep": "##.###-###"
|
|
61
|
+
"cep": "##.###-###",
|
|
62
|
+
"cor_rgb" : "'#AAAAAA"
|
|
62
63
|
};
|
|
63
64
|
|
|
64
65
|
|
|
@@ -92,6 +93,92 @@ export class MaskFormatter {
|
|
|
92
93
|
this.mask = mask;
|
|
93
94
|
}
|
|
94
95
|
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Aplica a máscara quando o input é alterado
|
|
99
|
+
*
|
|
100
|
+
* @param value Valor a ser aplicado com a máscara.
|
|
101
|
+
* @return O valor processado de acordo com o padrão.
|
|
102
|
+
*/
|
|
103
|
+
public applyMask(value: string) {
|
|
104
|
+
if (this.mask === MaskFormatter.DEFAULT_MASKS.cor_rgb) {
|
|
105
|
+
value = value.replace("#", "")
|
|
106
|
+
|
|
107
|
+
const expectedFormattedValue = this.format(value.replace(/\s/g, ""));
|
|
108
|
+
|
|
109
|
+
if (value === expectedFormattedValue) {
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (value.length >= 6) {
|
|
114
|
+
const formattedValue = this.format(value);
|
|
115
|
+
return formattedValue;
|
|
116
|
+
} else {
|
|
117
|
+
return value;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const expectedFormattedValue = this.format(value.replace(/\s/g, ""));
|
|
122
|
+
|
|
123
|
+
if (value === expectedFormattedValue) {
|
|
124
|
+
return value;
|
|
125
|
+
}
|
|
126
|
+
const maskPlaceholders = this.mask.match(/[UAL#?*']/g) || [];
|
|
127
|
+
const placeholderCount = maskPlaceholders.length;
|
|
128
|
+
|
|
129
|
+
const validValue = value.split('').filter((char, index) => {
|
|
130
|
+
const placeholder = maskPlaceholders[index];
|
|
131
|
+
if (!placeholder) return false;
|
|
132
|
+
|
|
133
|
+
switch (placeholder) {
|
|
134
|
+
case MaskFormatter.DIGIT_KEY:
|
|
135
|
+
return /\d/.test(char);
|
|
136
|
+
case MaskFormatter.UPPERCASE_KEY:
|
|
137
|
+
return /[a-zA-Z]/.test(char);
|
|
138
|
+
case MaskFormatter.LOWERCASE_KEY:
|
|
139
|
+
return /[a-zA-Z]/.test(char);
|
|
140
|
+
case MaskFormatter.ALPHA_NUMERIC_KEY:
|
|
141
|
+
return /[a-zA-Z0-9]/.test(char);
|
|
142
|
+
case MaskFormatter.CHARACTER_KEY:
|
|
143
|
+
return /[a-zA-Z]/.test(char);
|
|
144
|
+
case MaskFormatter.ANYTHING_KEY:
|
|
145
|
+
return true;
|
|
146
|
+
case MaskFormatter.LITERAL_KEY:
|
|
147
|
+
const literalChar = this.mask.charAt(index);
|
|
148
|
+
return char === literalChar;
|
|
149
|
+
default:
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
if (validValue.length >= placeholderCount) {
|
|
155
|
+
const formattedValue = this.format(validValue.join(''));
|
|
156
|
+
return formattedValue;
|
|
157
|
+
} else {
|
|
158
|
+
const partialValue = validValue.join('');
|
|
159
|
+
return partialValue;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Remove a máscara formatando a string retornando sem máscara
|
|
165
|
+
*
|
|
166
|
+
* @param value Valor a ser formatado com máscara.
|
|
167
|
+
* @return O valor processado de acordo com o padrão.
|
|
168
|
+
*/
|
|
169
|
+
public removeMask(value: string): string {
|
|
170
|
+
const maskString = this.mask.replace("#", "");
|
|
171
|
+
const maskElements = maskString.split("");
|
|
172
|
+
|
|
173
|
+
let valueMapped = value
|
|
174
|
+
|
|
175
|
+
maskElements.forEach(maskChar => {
|
|
176
|
+
valueMapped = valueMapped.replace(maskChar, "")
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
return valueMapped;
|
|
180
|
+
}
|
|
181
|
+
|
|
95
182
|
/**
|
|
96
183
|
* Formata a string passada baseada na máscara definda pelo atributo mask.
|
|
97
184
|
*
|