@sankhyalabs/core 5.20.0-dev.72 → 5.20.0-dev.73
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/KeyboardManager.md +79 -9
- package/dist/utils/KeyboardManager/index.d.ts +4 -0
- package/dist/utils/KeyboardManager/index.js +37 -1
- package/dist/utils/KeyboardManager/index.js.map +1 -1
- package/dist/utils/KeyboardManager/interface.d.ts +1 -0
- package/package.json +1 -1
- package/reports/test-report.xml +110 -110
- package/src/utils/KeyboardManager/index.ts +47 -0
- package/src/utils/KeyboardManager/interface.ts +1 -0
|
@@ -28,7 +28,7 @@ opções para o gerenciamento de eventos de teclado.
|
|
|
28
28
|
|
|
29
29
|
#### Source
|
|
30
30
|
|
|
31
|
-
src/utils/KeyboardManager/index.ts:
|
|
31
|
+
src/utils/KeyboardManager/index.ts:20
|
|
32
32
|
|
|
33
33
|
## Properties
|
|
34
34
|
|
|
@@ -38,7 +38,7 @@ src/utils/KeyboardManager/index.ts:19
|
|
|
38
38
|
|
|
39
39
|
#### Source
|
|
40
40
|
|
|
41
|
-
src/utils/KeyboardManager/index.ts:
|
|
41
|
+
src/utils/KeyboardManager/index.ts:13
|
|
42
42
|
|
|
43
43
|
***
|
|
44
44
|
|
|
@@ -50,6 +50,16 @@ src/utils/KeyboardManager/index.ts:12
|
|
|
50
50
|
|
|
51
51
|
src/utils/KeyboardManager/index.ts:11
|
|
52
52
|
|
|
53
|
+
***
|
|
54
|
+
|
|
55
|
+
### \_shadowRoots
|
|
56
|
+
|
|
57
|
+
> `private` **\_shadowRoots**: `ShadowRoot`[] = `[]`
|
|
58
|
+
|
|
59
|
+
#### Source
|
|
60
|
+
|
|
61
|
+
src/utils/KeyboardManager/index.ts:12
|
|
62
|
+
|
|
53
63
|
## Accessors
|
|
54
64
|
|
|
55
65
|
### mappedKeys
|
|
@@ -66,10 +76,30 @@ chaves mapeadas com descrições
|
|
|
66
76
|
|
|
67
77
|
#### Source
|
|
68
78
|
|
|
69
|
-
src/utils/KeyboardManager/index.ts:
|
|
79
|
+
src/utils/KeyboardManager/index.ts:144
|
|
70
80
|
|
|
71
81
|
## Methods
|
|
72
82
|
|
|
83
|
+
### addEventListenerToNestedShadowRoots()
|
|
84
|
+
|
|
85
|
+
> `private` **addEventListenerToNestedShadowRoots**(`event`, `callback`): `void`
|
|
86
|
+
|
|
87
|
+
#### Parameters
|
|
88
|
+
|
|
89
|
+
• **event**: `"keydown"` \| `"keyup"`
|
|
90
|
+
|
|
91
|
+
• **callback**: `VoidFunction`
|
|
92
|
+
|
|
93
|
+
#### Returns
|
|
94
|
+
|
|
95
|
+
`void`
|
|
96
|
+
|
|
97
|
+
#### Source
|
|
98
|
+
|
|
99
|
+
src/utils/KeyboardManager/index.ts:56
|
|
100
|
+
|
|
101
|
+
***
|
|
102
|
+
|
|
73
103
|
### bind()
|
|
74
104
|
|
|
75
105
|
> **bind**(`keyMap`, `callback`, `options`?): [`KeyboardManager`](KeyboardManager.md)
|
|
@@ -98,7 +128,7 @@ O objeto `KeyboardManager`
|
|
|
98
128
|
|
|
99
129
|
#### Source
|
|
100
130
|
|
|
101
|
-
src/utils/KeyboardManager/index.ts:
|
|
131
|
+
src/utils/KeyboardManager/index.ts:76
|
|
102
132
|
|
|
103
133
|
***
|
|
104
134
|
|
|
@@ -126,7 +156,27 @@ Retorna se todas as teclas modificadoras foram aplicadas
|
|
|
126
156
|
|
|
127
157
|
#### Source
|
|
128
158
|
|
|
129
|
-
src/utils/KeyboardManager/index.ts:
|
|
159
|
+
src/utils/KeyboardManager/index.ts:213
|
|
160
|
+
|
|
161
|
+
***
|
|
162
|
+
|
|
163
|
+
### findAllNestedShadowRoots()
|
|
164
|
+
|
|
165
|
+
> `private` **findAllNestedShadowRoots**(`element`, `results`): `ShadowRoot`[]
|
|
166
|
+
|
|
167
|
+
#### Parameters
|
|
168
|
+
|
|
169
|
+
• **element**: `Element` \| `Document` \| `HTMLElement` \| `ChildNode`
|
|
170
|
+
|
|
171
|
+
• **results**: `ShadowRoot`[]= `[]`
|
|
172
|
+
|
|
173
|
+
#### Returns
|
|
174
|
+
|
|
175
|
+
`ShadowRoot`[]
|
|
176
|
+
|
|
177
|
+
#### Source
|
|
178
|
+
|
|
179
|
+
src/utils/KeyboardManager/index.ts:35
|
|
130
180
|
|
|
131
181
|
***
|
|
132
182
|
|
|
@@ -160,7 +210,7 @@ O evento de teclado
|
|
|
160
210
|
|
|
161
211
|
#### Source
|
|
162
212
|
|
|
163
|
-
src/utils/KeyboardManager/index.ts:
|
|
213
|
+
src/utils/KeyboardManager/index.ts:160
|
|
164
214
|
|
|
165
215
|
***
|
|
166
216
|
|
|
@@ -188,7 +238,27 @@ Retorna se o evento de teclado foi disparado e as teclas modificadoras aplicadas
|
|
|
188
238
|
|
|
189
239
|
#### Source
|
|
190
240
|
|
|
191
|
-
src/utils/KeyboardManager/index.ts:
|
|
241
|
+
src/utils/KeyboardManager/index.ts:176
|
|
242
|
+
|
|
243
|
+
***
|
|
244
|
+
|
|
245
|
+
### removeEventListenerToNestedShadowRoots()
|
|
246
|
+
|
|
247
|
+
> `private` **removeEventListenerToNestedShadowRoots**(`event`, `callback`): `void`
|
|
248
|
+
|
|
249
|
+
#### Parameters
|
|
250
|
+
|
|
251
|
+
• **event**: `"keydown"` \| `"keyup"`
|
|
252
|
+
|
|
253
|
+
• **callback**: `VoidFunction`
|
|
254
|
+
|
|
255
|
+
#### Returns
|
|
256
|
+
|
|
257
|
+
`void`
|
|
258
|
+
|
|
259
|
+
#### Source
|
|
260
|
+
|
|
261
|
+
src/utils/KeyboardManager/index.ts:62
|
|
192
262
|
|
|
193
263
|
***
|
|
194
264
|
|
|
@@ -212,7 +282,7 @@ Chave de mapeamento de teclado.
|
|
|
212
282
|
|
|
213
283
|
#### Source
|
|
214
284
|
|
|
215
|
-
src/utils/KeyboardManager/index.ts:
|
|
285
|
+
src/utils/KeyboardManager/index.ts:116
|
|
216
286
|
|
|
217
287
|
***
|
|
218
288
|
|
|
@@ -238,4 +308,4 @@ Se o evento de teclado deve ser propagado
|
|
|
238
308
|
|
|
239
309
|
#### Source
|
|
240
310
|
|
|
241
|
-
src/utils/KeyboardManager/index.ts:
|
|
311
|
+
src/utils/KeyboardManager/index.ts:249
|
|
@@ -4,6 +4,7 @@ import { IGetMappedKeys, IKeyboardOptions } from "./interface.js";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class KeyboardManager {
|
|
6
6
|
private _options;
|
|
7
|
+
private _shadowRoots;
|
|
7
8
|
private _mappedElements;
|
|
8
9
|
/**
|
|
9
10
|
* Construtor para a classe Keyboard.
|
|
@@ -11,6 +12,9 @@ export declare class KeyboardManager {
|
|
|
11
12
|
* @param {IKeyboardOptions} options - opções para o gerenciamento de eventos de teclado.
|
|
12
13
|
*/
|
|
13
14
|
constructor(options?: Partial<IKeyboardOptions>);
|
|
15
|
+
private findAllNestedShadowRoots;
|
|
16
|
+
private addEventListenerToNestedShadowRoots;
|
|
17
|
+
private removeEventListenerToNestedShadowRoots;
|
|
14
18
|
/**
|
|
15
19
|
* Associa um evento de teclado com uma função
|
|
16
20
|
*
|
|
@@ -12,8 +12,38 @@ export class KeyboardManager {
|
|
|
12
12
|
* @param {IKeyboardOptions} options - opções para o gerenciamento de eventos de teclado.
|
|
13
13
|
*/
|
|
14
14
|
constructor(options) {
|
|
15
|
+
this._shadowRoots = [];
|
|
15
16
|
this._mappedElements = {};
|
|
16
|
-
this._options = Object.assign({ type: 'keydown', propagate: false, element: document.body, debounceTime: 0 }, options);
|
|
17
|
+
this._options = Object.assign({ type: 'keydown', propagate: false, element: document.body, debounceTime: 0, enableShadowDom: false }, options);
|
|
18
|
+
if (this._options.enableShadowDom) {
|
|
19
|
+
this._shadowRoots = this.findAllNestedShadowRoots(this._options.element);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
findAllNestedShadowRoots(element, results = []) {
|
|
23
|
+
if (!element) {
|
|
24
|
+
return results;
|
|
25
|
+
}
|
|
26
|
+
const shadowRoot = element === null || element === void 0 ? void 0 : element.shadowRoot;
|
|
27
|
+
if (shadowRoot) {
|
|
28
|
+
results.push(shadowRoot);
|
|
29
|
+
shadowRoot.querySelectorAll("*").forEach((child) => {
|
|
30
|
+
this.findAllNestedShadowRoots(child, results);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
element.childNodes.forEach((child) => {
|
|
34
|
+
this.findAllNestedShadowRoots(child, results);
|
|
35
|
+
});
|
|
36
|
+
return results;
|
|
37
|
+
}
|
|
38
|
+
addEventListenerToNestedShadowRoots(event, callback) {
|
|
39
|
+
this._shadowRoots.forEach((shadowRoot) => {
|
|
40
|
+
shadowRoot.addEventListener(event, callback);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
removeEventListenerToNestedShadowRoots(event, callback) {
|
|
44
|
+
this._shadowRoots.forEach((shadowRoot) => {
|
|
45
|
+
shadowRoot.removeEventListener(event, callback);
|
|
46
|
+
});
|
|
17
47
|
}
|
|
18
48
|
/**
|
|
19
49
|
* Associa um evento de teclado com uma função
|
|
@@ -36,6 +66,9 @@ export class KeyboardManager {
|
|
|
36
66
|
options: bindOptions
|
|
37
67
|
} });
|
|
38
68
|
bindOptions.element.addEventListener(bindOptions.type, debounceFunction);
|
|
69
|
+
if (bindOptions.enableShadowDom) {
|
|
70
|
+
this.addEventListenerToNestedShadowRoots(bindOptions.type, debounceFunction);
|
|
71
|
+
}
|
|
39
72
|
return this;
|
|
40
73
|
}
|
|
41
74
|
/**
|
|
@@ -53,6 +86,9 @@ export class KeyboardManager {
|
|
|
53
86
|
delete this._mappedElements[keyMap];
|
|
54
87
|
const { callback, options: { element, type } } = unbindElement;
|
|
55
88
|
element.removeEventListener(type, callback);
|
|
89
|
+
if (unbindElement.options.enableShadowDom) {
|
|
90
|
+
this.removeEventListenerToNestedShadowRoots(type, callback);
|
|
91
|
+
}
|
|
56
92
|
return this;
|
|
57
93
|
}
|
|
58
94
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/KeyboardManager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,eAAe;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/KeyboardManager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,eAAe;IAKzB;;;;OAIG;IACH,YAAY,OAAmC;QARvC,iBAAY,GAAkB,EAAE,CAAC;QACjC,oBAAe,GAAgC,EAAE,CAAC;QAQvD,IAAI,CAAC,QAAQ,mBACV,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,KAAK,EAChB,OAAO,EAAE,QAAQ,CAAC,IAAI,EACtB,YAAY,EAAE,CAAC,EACf,eAAe,EAAE,KAAK,IACnB,OAAO,CACZ,CAAA;QAED,IAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE;YAC/B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;SAC3E;IACJ,CAAC;IAEO,wBAAwB,CAAC,OAAqD,EAAG,UAAyB,EAAE;QACjH,IAAI,CAAC,OAAO,EAAE;YACX,OAAO,OAAO,CAAC;SACjB;QAED,MAAM,UAAU,GA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|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<unitTest version="1">
|
|
3
3
|
<file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
|
|
4
|
-
<testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="
|
|
4
|
+
<testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="74"/>
|
|
5
5
|
<testCase name="StringUtils it should modify "expressions" and "parameters" properties through Setters methods" duration="1"/>
|
|
6
|
-
<testCase name="StringUtils it should return "expression" and "parameters" setted through constructor method" duration="
|
|
6
|
+
<testCase name="StringUtils it should return "expression" and "parameters" setted through constructor method" duration="0"/>
|
|
7
7
|
<testCase name="StringUtils it should return a Criteria class with "expression" and "parameters" as needed setted through "append" method" duration="1"/>
|
|
8
8
|
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "append" method" duration="1"/>
|
|
9
9
|
<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"/>
|
|
10
10
|
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
11
11
|
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
12
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="
|
|
13
|
-
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "AND" method" duration="
|
|
14
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="
|
|
12
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
13
|
+
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
14
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
15
15
|
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
16
|
-
<testCase name="StringUtils it should return a toJSON object with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="
|
|
16
|
+
<testCase name="StringUtils it should return a toJSON object with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="82"/>
|
|
17
17
|
<testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
|
|
18
18
|
</file>
|
|
19
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
|
|
20
|
+
<testCase name="StringUtils stringToNumber" duration="120"/>
|
|
21
|
+
<testCase name="StringUtils format" duration="304"/>
|
|
22
|
+
<testCase name="StringUtils format without formatnumber parameter" duration="0"/>
|
|
23
|
+
<testCase name="StringUtils format without formatnumber parameter" duration="0"/>
|
|
24
|
+
<testCase name="StringUtils format round number" duration="1"/>
|
|
25
|
+
</file>
|
|
19
26
|
<file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
|
|
20
|
-
<testCase name="Mask Formatter mask:CPF complete valid" duration="
|
|
27
|
+
<testCase name="Mask Formatter mask:CPF complete valid" duration="2"/>
|
|
21
28
|
<testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
|
|
22
29
|
<testCase name="Mask Formatter mask:CPF incomplete valid" duration="0"/>
|
|
23
30
|
<testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
|
|
24
|
-
<testCase name="Mask Formatter mask:CPF too long valid" duration="
|
|
25
|
-
<testCase name="Mask Formatter mask:CPF invalid for string" duration="
|
|
31
|
+
<testCase name="Mask Formatter mask:CPF too long valid" duration="0"/>
|
|
32
|
+
<testCase name="Mask Formatter mask:CPF invalid for string" duration="111"/>
|
|
26
33
|
<testCase name="Mask Formatter mask:CPF invalid for being too long" duration="1"/>
|
|
27
|
-
<testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="
|
|
28
|
-
<testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="
|
|
29
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="
|
|
34
|
+
<testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="73"/>
|
|
35
|
+
<testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="0"/>
|
|
36
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
30
37
|
<testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="0"/>
|
|
31
|
-
<testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="
|
|
38
|
+
<testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="1"/>
|
|
32
39
|
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
33
40
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
|
|
34
41
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
|
|
35
42
|
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
36
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="
|
|
43
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
|
|
37
44
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
|
|
38
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="
|
|
45
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="102"/>
|
|
39
46
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
|
|
40
47
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
|
|
41
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="
|
|
42
|
-
</file>
|
|
43
|
-
<file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
|
|
44
|
-
<testCase name="StringUtils stringToNumber" duration="12"/>
|
|
45
|
-
<testCase name="StringUtils format" duration="82"/>
|
|
46
|
-
<testCase name="StringUtils format without formatnumber parameter" duration="0"/>
|
|
47
|
-
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
48
|
-
<testCase name="StringUtils format round number" duration="2"/>
|
|
49
|
-
</file>
|
|
50
|
-
<file path="/builds/dti/design-system/sankhyacore/test/dataunit/loader/utils/dataUnitLoaderUtils.spec.ts">
|
|
51
|
-
<testCase name="Utility Functions applyFilter should return the original records if no filters are provided" duration="11"/>
|
|
52
|
-
<testCase name="Utility Functions applyFilter should filter records based on provided filters" duration="2"/>
|
|
53
|
-
<testCase name="Utility Functions buildPaginationInfo function should return correct pagination info with default values" duration="1"/>
|
|
54
|
-
<testCase name="Utility Functions buildPaginationInfo function should redosLenth as same size as recordsPerPage" duration="1"/>
|
|
55
|
-
<testCase name="Utility Functions buildPaginationInfo function should handle case when totalRecordsLength and offset 0" duration="1"/>
|
|
56
|
-
<testCase name="Utility Functions buildPaginationInfo function should handle case when currentPageLength is less than totalRecordsLength and lastPage" duration="8"/>
|
|
57
|
-
<testCase name="Utility Functions applySorting function should return the original records if no sorting is provided" duration="1"/>
|
|
58
|
-
<testCase name="Utility Functions applySorting function should sort records based on provided sorting criteria" duration="1"/>
|
|
48
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
59
49
|
</file>
|
|
60
50
|
<file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
|
|
61
|
-
<testCase name="OverflowWatcher should initialize with provided parameters" duration="
|
|
51
|
+
<testCase name="OverflowWatcher should initialize with provided parameters" duration="10"/>
|
|
62
52
|
<testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
|
|
63
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate" duration="
|
|
64
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="
|
|
65
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="
|
|
66
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="
|
|
67
|
-
<testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="
|
|
68
|
-
<testCase name="OverflowWatcher should ignore elements that can not overflow" duration="
|
|
69
|
-
<testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="
|
|
53
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate" duration="292"/>
|
|
54
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="125"/>
|
|
55
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="100"/>
|
|
56
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="82"/>
|
|
57
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="5"/>
|
|
58
|
+
<testCase name="OverflowWatcher should ignore elements that can not overflow" duration="92"/>
|
|
59
|
+
<testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
|
|
70
60
|
</file>
|
|
71
61
|
<file path="/builds/dti/design-system/sankhyacore/src/utils/test/objectUtils.spec.ts">
|
|
72
62
|
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="1"/>
|
|
73
|
-
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="
|
|
63
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="0"/>
|
|
74
64
|
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="0"/>
|
|
75
65
|
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="1"/>
|
|
76
66
|
<testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="0"/>
|
|
77
|
-
<testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="
|
|
67
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="0"/>
|
|
78
68
|
<testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="0"/>
|
|
79
69
|
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="0"/>
|
|
80
70
|
<testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="1"/>
|
|
81
71
|
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="0"/>
|
|
82
|
-
<testCase name="ObjectUtils should get an object value based on its path" duration="
|
|
72
|
+
<testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
|
|
83
73
|
<testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
|
|
84
74
|
<testCase name="ObjectUtils should return undefined if the path doesn't exist in the object" duration="1"/>
|
|
85
75
|
</file>
|
|
76
|
+
<file path="/builds/dti/design-system/sankhyacore/test/dataunit/loader/utils/dataUnitLoaderUtils.spec.ts">
|
|
77
|
+
<testCase name="Utility Functions applyFilter should return the original records if no filters are provided" duration="10"/>
|
|
78
|
+
<testCase name="Utility Functions applyFilter should filter records based on provided filters" duration="1"/>
|
|
79
|
+
<testCase name="Utility Functions buildPaginationInfo function should return correct pagination info with default values" duration="1"/>
|
|
80
|
+
<testCase name="Utility Functions buildPaginationInfo function should redosLenth as same size as recordsPerPage" duration="1"/>
|
|
81
|
+
<testCase name="Utility Functions buildPaginationInfo function should handle case when totalRecordsLength and offset 0" duration="1"/>
|
|
82
|
+
<testCase name="Utility Functions buildPaginationInfo function should handle case when currentPageLength is less than totalRecordsLength and lastPage" duration="84"/>
|
|
83
|
+
<testCase name="Utility Functions applySorting function should return the original records if no sorting is provided" duration="2"/>
|
|
84
|
+
<testCase name="Utility Functions applySorting function should sort records based on provided sorting criteria" duration="2"/>
|
|
85
|
+
</file>
|
|
86
|
+
<file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
|
|
87
|
+
<testCase name="HttpProvider Metodo GET" duration="1"/>
|
|
88
|
+
</file>
|
|
86
89
|
<file path="/builds/dti/design-system/sankhyacore/test/util/ColumnFilterManager.spec.ts">
|
|
87
|
-
<testCase name="ColumnFilterManager getColumnFilters should return an empty map if filters are undefined or empty" duration="
|
|
90
|
+
<testCase name="ColumnFilterManager getColumnFilters should return an empty map if filters are undefined or empty" duration="95"/>
|
|
88
91
|
<testCase name="ColumnFilterManager getColumnFilters should return a map of filters matching the pattern and not the provided fieldName" duration="1"/>
|
|
89
92
|
<testCase name="ColumnFilterManager getFilterFunction should return undefined if no filters are provided" duration="1"/>
|
|
90
|
-
<testCase name="ColumnFilterManager getFilterFunction should return a function that evaluates records based on filters" duration="
|
|
91
|
-
<testCase name="ColumnFilterManager getFilterFunction should return a function that evaluates records and return false" duration="
|
|
93
|
+
<testCase name="ColumnFilterManager getFilterFunction should return a function that evaluates records based on filters" duration="2"/>
|
|
94
|
+
<testCase name="ColumnFilterManager getFilterFunction should return a function that evaluates records and return false" duration="1"/>
|
|
92
95
|
<testCase name="ColumnFilterManager compileDistinct should return an array of distinct field values formatted correctly" duration="1"/>
|
|
93
96
|
<testCase name="ColumnFilterManager compileDistinct should filter records if a load request is present" duration="1"/>
|
|
94
97
|
</file>
|
|
95
|
-
<file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
|
|
96
|
-
<testCase name="HttpProvider Metodo GET" duration="1"/>
|
|
97
|
-
</file>
|
|
98
98
|
<file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
|
|
99
|
-
<testCase name="StringUtils valor vazio" duration="
|
|
100
|
-
<testCase name="StringUtils valor em branco" duration="
|
|
101
|
-
<testCase name="StringUtils valor null" duration="
|
|
102
|
-
<testCase name="StringUtils valor undefined" duration="
|
|
103
|
-
<testCase name="StringUtils valor 0" duration="
|
|
104
|
-
<testCase name="StringUtils com valor" duration="
|
|
105
|
-
<testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="
|
|
99
|
+
<testCase name="StringUtils valor vazio" duration="1"/>
|
|
100
|
+
<testCase name="StringUtils valor em branco" duration="1"/>
|
|
101
|
+
<testCase name="StringUtils valor null" duration="0"/>
|
|
102
|
+
<testCase name="StringUtils valor undefined" duration="7"/>
|
|
103
|
+
<testCase name="StringUtils valor 0" duration="1"/>
|
|
104
|
+
<testCase name="StringUtils com valor" duration="0"/>
|
|
105
|
+
<testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="2"/>
|
|
106
106
|
<testCase name="StringUtils should return the original value when called with an object without a toString method" duration="1"/>
|
|
107
|
-
<testCase name="StringUtils should return the original value when called with undefined" duration="
|
|
107
|
+
<testCase name="StringUtils should return the original value when called with undefined" duration="0"/>
|
|
108
108
|
</file>
|
|
109
109
|
<file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
|
|
110
|
-
<testCase name="HttpProvider Metodo POST" duration="
|
|
110
|
+
<testCase name="HttpProvider Metodo POST" duration="1"/>
|
|
111
111
|
</file>
|
|
112
112
|
<file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
|
|
113
113
|
<testCase name="StringUtils it should return the correct values of "value" and "type" through the getters methods initial setted by the constructor" duration="2"/>
|
|
114
|
-
<testCase name="StringUtils it should return the correct values of "value" and "type" through the getters methods initial setted by the setters methods" duration="
|
|
115
|
-
<testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="
|
|
114
|
+
<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"/>
|
|
115
|
+
<testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
|
|
116
116
|
</file>
|
|
117
117
|
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/state/slice/test/RecordsSlice.spec.ts">
|
|
118
118
|
<testCase name="RecordsSlice should return newlines at the end" duration="2"/>
|
|
@@ -120,96 +120,96 @@
|
|
|
120
120
|
<file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
|
|
121
121
|
<testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="1"/>
|
|
122
122
|
<testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="0"/>
|
|
123
|
-
<testCase name="TimeFormatter Case: validateTime" duration="
|
|
123
|
+
<testCase name="TimeFormatter Case: validateTime" duration="1"/>
|
|
124
|
+
</file>
|
|
125
|
+
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
|
|
126
|
+
<testCase name="DataUnit should return false when not waiting to reload" duration="2"/>
|
|
127
|
+
<testCase name="DataUnit should set waitingToReload to true" duration="0"/>
|
|
128
|
+
<testCase name="DataUnit should set waitingToReload to false" duration="1"/>
|
|
129
|
+
<testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="0"/>
|
|
124
130
|
</file>
|
|
125
131
|
<file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
|
|
126
|
-
<testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="
|
|
132
|
+
<testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="2"/>
|
|
127
133
|
<testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="1"/>
|
|
128
134
|
<testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
|
|
129
|
-
<testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="
|
|
130
|
-
<testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="
|
|
135
|
+
<testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="0"/>
|
|
136
|
+
<testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
|
|
131
137
|
<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"/>
|
|
132
138
|
</file>
|
|
133
139
|
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
|
|
134
|
-
<testCase name="addIDInfo 1 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="
|
|
135
|
-
<testCase name="addIDInfo 2 - should add data-element-id with valid id "brComSankhyaFinCadMovimentacaofinanceira_snkApplication"" duration="
|
|
136
|
-
<testCase name="addIDInfo 3 - should add data-element-id with valid id "movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="
|
|
137
|
-
<testCase name="addIDInfo 4 - should add data-element-id with valid id "meuID2_snkApplication"" duration="
|
|
140
|
+
<testCase name="addIDInfo 1 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="9"/>
|
|
141
|
+
<testCase name="addIDInfo 2 - should add data-element-id with valid id "brComSankhyaFinCadMovimentacaofinanceira_snkApplication"" duration="1"/>
|
|
142
|
+
<testCase name="addIDInfo 3 - should add data-element-id with valid id "movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="1"/>
|
|
143
|
+
<testCase name="addIDInfo 4 - should add data-element-id with valid id "meuID2_snkApplication"" duration="1"/>
|
|
138
144
|
<testCase name="addIDInfo 5 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="1"/>
|
|
139
|
-
<testCase name="addIDInfo 6 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="
|
|
140
|
-
<testCase name="addIDInfo 7 - should add data-element-id with valid id "componenteNameTest_snkApplication"" duration="
|
|
145
|
+
<testCase name="addIDInfo 6 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="1"/>
|
|
146
|
+
<testCase name="addIDInfo 7 - should add data-element-id with valid id "componenteNameTest_snkApplication"" duration="1"/>
|
|
141
147
|
<testCase name="addIDInfo 8 - should add data-element-id with valid id "componentLabel_snkApplication"" duration="1"/>
|
|
142
|
-
<testCase name="addIDInfo 9 - should add data-element-id with valid id "dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="
|
|
143
|
-
<testCase name="addIDInfo 10 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="
|
|
144
|
-
<testCase name="addIDInfo 11 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="
|
|
148
|
+
<testCase name="addIDInfo 9 - should add data-element-id with valid id "dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="1"/>
|
|
149
|
+
<testCase name="addIDInfo 10 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="1"/>
|
|
150
|
+
<testCase name="addIDInfo 11 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="1"/>
|
|
145
151
|
<testCase name="addIDInfo 12 - should add data-element-id with valid id "dataunitFinanceiro_movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
146
|
-
<testCase name="addIDInfo 13 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="
|
|
147
|
-
<testCase name="addIDInfo 14 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira"" duration="
|
|
152
|
+
<testCase name="addIDInfo 13 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="1"/>
|
|
153
|
+
<testCase name="addIDInfo 14 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira"" duration="1"/>
|
|
148
154
|
<testCase name="addIDInfo 15 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="1"/>
|
|
149
155
|
<testCase name="addIDInfo 16 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="1"/>
|
|
150
156
|
<testCase name="addIDInfo 17 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
151
|
-
<testCase name="addIDInfo 18 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="
|
|
157
|
+
<testCase name="addIDInfo 18 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="0"/>
|
|
152
158
|
<testCase name="addIDInfo 19 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
153
159
|
<testCase name="addIDInfo 20 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
154
|
-
<testCase name="addIDInfo 21 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="
|
|
155
|
-
<testCase name="addIDInfo 22 - should add data-element-id with valid id "bancoObrigatorio_movimentacaoFinanceira"" duration="
|
|
156
|
-
</file>
|
|
157
|
-
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
|
|
158
|
-
<testCase name="DataUnit should return false when not waiting to reload" duration="2"/>
|
|
159
|
-
<testCase name="DataUnit should set waitingToReload to true" duration="1"/>
|
|
160
|
-
<testCase name="DataUnit should set waitingToReload to false" duration="1"/>
|
|
161
|
-
<testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="1"/>
|
|
160
|
+
<testCase name="addIDInfo 21 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="0"/>
|
|
161
|
+
<testCase name="addIDInfo 22 - should add data-element-id with valid id "bancoObrigatorio_movimentacaoFinanceira"" duration="1"/>
|
|
162
162
|
</file>
|
|
163
163
|
<file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
|
|
164
164
|
<testCase name="getFormattedValue should return empty string when value is null" duration="6"/>
|
|
165
|
-
<testCase name="getFormattedValue should return empty string when value is not an array" duration="
|
|
165
|
+
<testCase name="getFormattedValue should return empty string when value is not an array" duration="0"/>
|
|
166
166
|
<testCase name="getFormattedValue should return empty string when value is an empty array" duration="0"/>
|
|
167
|
-
<testCase name="getFormattedValue should return file name when value is an array with one file object" duration="
|
|
167
|
+
<testCase name="getFormattedValue should return file name when value is an array with one file object" duration="1"/>
|
|
168
168
|
<testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="1"/>
|
|
169
169
|
<testCase name="getFormattedValue should return empty string for undefined file" duration="0"/>
|
|
170
170
|
<testCase name="getFormattedValue should handle OBJECT type with value field" duration="1"/>
|
|
171
171
|
<testCase name="getFormattedValue should return empty string when value is undefined" duration="0"/>
|
|
172
|
-
<testCase name="getFormattedValue should return value as string when value is not an object" duration="
|
|
173
|
-
<testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="
|
|
172
|
+
<testCase name="getFormattedValue should return value as string when value is not an object" duration="1"/>
|
|
173
|
+
<testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="0"/>
|
|
174
174
|
<testCase name="getFormattedValue should handle BOOLEAN type" duration="0"/>
|
|
175
|
-
<testCase name="getFormattedValue should format numbers correctly" duration="
|
|
176
|
-
<testCase name="getFormattedValue should format dates correctly" duration="
|
|
175
|
+
<testCase name="getFormattedValue should format numbers correctly" duration="13"/>
|
|
176
|
+
<testCase name="getFormattedValue should format dates correctly" duration="45"/>
|
|
177
177
|
<testCase name="getFormattedValue should format times correctly" duration="1"/>
|
|
178
178
|
<testCase name="getFormattedValue should format datetime correctly" duration="1"/>
|
|
179
179
|
<testCase name="getFormattedValue should call toString with correct parameters" duration="0"/>
|
|
180
180
|
<testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="0"/>
|
|
181
|
-
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="
|
|
182
|
-
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="
|
|
181
|
+
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="1"/>
|
|
182
|
+
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="8"/>
|
|
183
183
|
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
|
|
184
184
|
<testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
|
|
185
|
-
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="
|
|
186
|
-
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="
|
|
187
|
-
<testCase name="getFormattedValue should format masked values correctly" duration="
|
|
185
|
+
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
|
|
186
|
+
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="1"/>
|
|
187
|
+
<testCase name="getFormattedValue should format masked values correctly" duration="2"/>
|
|
188
188
|
</file>
|
|
189
189
|
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
|
|
190
|
-
<testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="
|
|
191
|
-
<testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="
|
|
192
|
-
<testCase name="calcMarginSize should threat values defined as zero" duration="
|
|
190
|
+
<testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="47"/>
|
|
191
|
+
<testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="54"/>
|
|
192
|
+
<testCase name="calcMarginSize should threat values defined as zero" duration="7"/>
|
|
193
193
|
</file>
|
|
194
194
|
<file path="/builds/dti/design-system/sankhyacore/test/dataunit/loader/dataUnitInMemoryLoader.spec.ts">
|
|
195
|
-
<testCase name="DataUnitInMemoryLoader - loadData should be called load data when auto load is true" duration="
|
|
196
|
-
<testCase name="DataUnitInMemoryLoader - loadData should be called load data when auto load is undefined" duration="
|
|
197
|
-
<testCase name="DataUnitInMemoryLoader - loadData should not be called load data when auto load is false" duration="
|
|
198
|
-
<testCase name="DataUnitInMemoryLoader - loadData should be called load data when config is undefined" duration="
|
|
195
|
+
<testCase name="DataUnitInMemoryLoader - loadData should be called load data when auto load is true" duration="14"/>
|
|
196
|
+
<testCase name="DataUnitInMemoryLoader - loadData should be called load data when auto load is undefined" duration="3"/>
|
|
197
|
+
<testCase name="DataUnitInMemoryLoader - loadData should not be called load data when auto load is false" duration="2"/>
|
|
198
|
+
<testCase name="DataUnitInMemoryLoader - loadData should be called load data when config is undefined" duration="4"/>
|
|
199
199
|
<testCase name="DataUnitInMemoryLoader - getConvertedValue should return the original string if descriptor is undefined" duration="1"/>
|
|
200
200
|
<testCase name="DataUnitInMemoryLoader - getConvertedValue should return the original string if dataType is TEXT" duration="1"/>
|
|
201
|
-
<testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to boolean when dataType is BOOLEAN" duration="
|
|
201
|
+
<testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to boolean when dataType is BOOLEAN" duration="0"/>
|
|
202
202
|
<testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to number when dataType is NUMBER" duration="1"/>
|
|
203
203
|
<testCase name="DataUnitInMemoryLoader - getConvertedValue should parse JSON when dataType is OBJECT" duration="1"/>
|
|
204
204
|
<testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to date when dataType is DATE and format is ISO" duration="1"/>
|
|
205
|
-
<testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to date when dataType is DATE and format is not ISO" duration="
|
|
205
|
+
<testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to date when dataType is DATE and format is not ISO" duration="7"/>
|
|
206
206
|
<testCase name="DataUnitInMemoryLoader - getConvertedValue should return the original string if no dataType matches" duration="1"/>
|
|
207
|
-
<testCase name="DataUnitInMemoryLoader - removeLoader should resolve with the provided record IDs" duration="
|
|
207
|
+
<testCase name="DataUnitInMemoryLoader - removeLoader should resolve with the provided record IDs" duration="2"/>
|
|
208
208
|
<testCase name="DataUnitInMemoryLoader - removeLoader should handle empty record ID array" duration="1"/>
|
|
209
|
-
<testCase name="DataUnitInMemoryLoader - removeLoader should resolve the promise" duration="
|
|
210
|
-
<testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should build initial records and convert field values based on metadata" duration="
|
|
209
|
+
<testCase name="DataUnitInMemoryLoader - removeLoader should resolve the promise" duration="1"/>
|
|
210
|
+
<testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should build initial records and convert field values based on metadata" duration="2"/>
|
|
211
211
|
<testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should generate unique IDs for records without "__record__id__"" duration="4"/>
|
|
212
|
-
<testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should leave fields untouched if no matching metadata exists" duration="
|
|
213
|
-
<testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should skip conversion for non-string field values" duration="
|
|
212
|
+
<testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should leave fields untouched if no matching metadata exists" duration="16"/>
|
|
213
|
+
<testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should skip conversion for non-string field values" duration="2"/>
|
|
214
214
|
</file>
|
|
215
215
|
</unitTest>
|
|
@@ -9,6 +9,7 @@ import { keyCodeEventValues } from "./keyCodes/index.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export class KeyboardManager {
|
|
11
11
|
private _options: IKeyboardOptions;
|
|
12
|
+
private _shadowRoots: ShadowRoot [] = [];
|
|
12
13
|
private _mappedElements: IKeyboardMappedKeysElements = {};
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -22,10 +23,48 @@ export class KeyboardManager {
|
|
|
22
23
|
propagate: false,
|
|
23
24
|
element: document.body,
|
|
24
25
|
debounceTime: 0,
|
|
26
|
+
enableShadowDom: false,
|
|
25
27
|
...options
|
|
26
28
|
}
|
|
29
|
+
|
|
30
|
+
if(this._options.enableShadowDom) {
|
|
31
|
+
this._shadowRoots = this.findAllNestedShadowRoots(this._options.element);
|
|
32
|
+
}
|
|
27
33
|
}
|
|
28
34
|
|
|
35
|
+
private findAllNestedShadowRoots(element: HTMLElement | Element | ChildNode | Document , results: ShadowRoot [] = []): ShadowRoot [] {
|
|
36
|
+
if (!element) {
|
|
37
|
+
return results;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const shadowRoot = (element as HTMLElement)?.shadowRoot;
|
|
41
|
+
if (shadowRoot) {
|
|
42
|
+
results.push(shadowRoot);
|
|
43
|
+
|
|
44
|
+
shadowRoot.querySelectorAll("*").forEach((child) => {
|
|
45
|
+
this.findAllNestedShadowRoots(child, results);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
element.childNodes.forEach((child) => {
|
|
50
|
+
this.findAllNestedShadowRoots(child, results);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
return results;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
private addEventListenerToNestedShadowRoots(event: 'keydown' | 'keyup', callback: VoidFunction) {
|
|
57
|
+
this._shadowRoots.forEach((shadowRoot) => {
|
|
58
|
+
shadowRoot.addEventListener(event, callback);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private removeEventListenerToNestedShadowRoots(event: 'keydown' | 'keyup', callback: VoidFunction) {
|
|
63
|
+
this._shadowRoots.forEach((shadowRoot) => {
|
|
64
|
+
shadowRoot.removeEventListener(event, callback);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
29
68
|
/**
|
|
30
69
|
* Associa um evento de teclado com uma função
|
|
31
70
|
*
|
|
@@ -61,6 +100,10 @@ export class KeyboardManager {
|
|
|
61
100
|
|
|
62
101
|
bindOptions.element.addEventListener(bindOptions.type, debounceFunction);
|
|
63
102
|
|
|
103
|
+
if(bindOptions.enableShadowDom) {
|
|
104
|
+
this.addEventListenerToNestedShadowRoots(bindOptions.type, debounceFunction);
|
|
105
|
+
}
|
|
106
|
+
|
|
64
107
|
return this;
|
|
65
108
|
}
|
|
66
109
|
|
|
@@ -86,6 +129,10 @@ export class KeyboardManager {
|
|
|
86
129
|
|
|
87
130
|
element.removeEventListener(type, callback);
|
|
88
131
|
|
|
132
|
+
if(unbindElement.options.enableShadowDom) {
|
|
133
|
+
this.removeEventListenerToNestedShadowRoots(type, callback);
|
|
134
|
+
}
|
|
135
|
+
|
|
89
136
|
return this;
|
|
90
137
|
}
|
|
91
138
|
|