@sankhyalabs/core 5.20.0-dev.71 → 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.
@@ -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:19
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:12
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:97
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:37
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:166
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:113
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:129
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:73
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:202
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;IAIzB;;;;OAIG;IACH,YAAY,OAAmC;QAPvC,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,IACZ,OAAO,CACZ,CAAA;IACJ,CAAC;IAED;;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AC9E,MAAM,cAAc,GAA4B;YAC7C,KAAK,EAAE,KAAK,CAAC,QAAQ;YACrB,IAAI,EAAE,KAAK,CAAC,OAAO;YACnB,GAAG,EAAE,KAAK,CAAC,MAAM;YACjB,IAAI,EAAE,KAAK,CAAC,OAAO;SACrB,CAAC;QAEF,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,OAAO,CAAC,CACL,cAAc,CAAC,KAAK;gBACpB,cAAc,CAAC,IAAI;gBACnB,cAAc,CAAC,GAAG;gBAClB,cAAc,CAAC,IAAI,CACrB,CAAC;SACJ;QAED,IAAI,qBAAqB,GAAG,IAAI,CAAC;QAEjC,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE;YAClC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;gBAC5B,qBAAqB,GAAG,KAAK,CAAC;gBAC9B,MAAM;aACR;SACH;QAED,OAAO,qBAAqB,CAAC;IAChC,CAAC;IAED;;;;;;OAMG;IACK,wBAAwB,CAAC,KAAoB,EAAE,SAAkB;;QACtE,IAAI,CAAC,SAAS,EAAE;YACb,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,cAAc,qDAAI,CAAC;YAC1B,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,qDAAI,CAAC;SAC7B;IACJ,CAAC;CACH"}
@@ -1,6 +1,7 @@
1
1
  export interface IKeyboardOptions {
2
2
  type: 'keydown' | 'keyup';
3
3
  propagate: boolean;
4
+ enableShadowDom: boolean;
4
5
  element: HTMLElement | Document;
5
6
  debounceTime: number;
6
7
  description?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/core",
3
- "version": "5.20.0-dev.71",
3
+ "version": "5.20.0-dev.73",
4
4
  "description": "Modulo core JavaScript da Sankhya.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -1,15 +1,38 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <unitTest version="1">
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="74"/>
5
+ <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="1"/>
6
+ <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="0"/>
7
+ <testCase name="StringUtils it should return a Criteria class with &quot;expression&quot; and &quot;parameters&quot; as needed setted through &quot;append&quot; method" duration="1"/>
8
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;append&quot; method" duration="1"/>
9
+ <testCase name="StringUtils it should return undefined as &quot;expression&quot; and &quot;[]&quot; as parameters as we use an empty criteria as first entry in the constructor" duration="1"/>
10
+ <testCase name="StringUtils it should return a Criteria class with &quot;Expression&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="1"/>
11
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="1"/>
12
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="1"/>
13
+ <testCase name="StringUtils it should return a Criteria class with &quot;Expression&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
14
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
15
+ <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
16
+ <testCase name="StringUtils it should return a toJSON object with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="82"/>
17
+ <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
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>
3
26
  <file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
4
- <testCase name="Mask Formatter mask:CPF complete valid" duration="7"/>
27
+ <testCase name="Mask Formatter mask:CPF complete valid" duration="2"/>
5
28
  <testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
6
29
  <testCase name="Mask Formatter mask:CPF incomplete valid" duration="0"/>
7
30
  <testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
8
- <testCase name="Mask Formatter mask:CPF too long valid" duration="1"/>
9
- <testCase name="Mask Formatter mask:CPF invalid for string" duration="401"/>
10
- <testCase name="Mask Formatter mask:CPF invalid for being too long" duration="81"/>
11
- <testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="1"/>
12
- <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
31
+ <testCase name="Mask Formatter mask:CPF too long valid" duration="0"/>
32
+ <testCase name="Mask Formatter mask:CPF invalid for string" duration="111"/>
33
+ <testCase name="Mask Formatter mask:CPF invalid for being too long" duration="1"/>
34
+ <testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="73"/>
35
+ <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="0"/>
13
36
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
14
37
  <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="0"/>
15
38
  <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="1"/>
@@ -17,199 +40,176 @@
17
40
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
18
41
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
19
42
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
43
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
44
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
45
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="102"/>
20
46
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
21
47
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
22
48
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
23
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="5"/>
24
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
25
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
49
+ </file>
50
+ <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
51
+ <testCase name="OverflowWatcher should initialize with provided parameters" duration="10"/>
52
+ <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
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"/>
26
60
  </file>
27
61
  <file path="/builds/dti/design-system/sankhyacore/src/utils/test/objectUtils.spec.ts">
28
- <testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="16"/>
29
- <testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="1"/>
62
+ <testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="1"/>
63
+ <testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="0"/>
30
64
  <testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="0"/>
31
- <testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="0"/>
32
- <testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="1"/>
65
+ <testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="1"/>
66
+ <testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="0"/>
33
67
  <testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="0"/>
34
68
  <testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="0"/>
35
69
  <testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="0"/>
36
70
  <testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="1"/>
37
71
  <testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="0"/>
38
- <testCase name="ObjectUtils should get an object value based on its path" duration="79"/>
39
- <testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
40
- <testCase name="ObjectUtils should return undefined if the path doesn&apos;t exist in the object" duration="0"/>
72
+ <testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
73
+ <testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
74
+ <testCase name="ObjectUtils should return undefined if the path doesn&apos;t exist in the object" duration="1"/>
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"/>
41
85
  </file>
42
86
  <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
43
- <testCase name="HttpProvider Metodo GET" duration="0"/>
87
+ <testCase name="HttpProvider Metodo GET" duration="1"/>
44
88
  </file>
45
- <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
46
- <testCase name="HttpProvider Metodo POST" duration="1"/>
89
+ <file path="/builds/dti/design-system/sankhyacore/test/util/ColumnFilterManager.spec.ts">
90
+ <testCase name="ColumnFilterManager getColumnFilters should return an empty map if filters are undefined or empty" duration="95"/>
91
+ <testCase name="ColumnFilterManager getColumnFilters should return a map of filters matching the pattern and not the provided fieldName" duration="1"/>
92
+ <testCase name="ColumnFilterManager getFilterFunction should return undefined if no filters are provided" duration="1"/>
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"/>
95
+ <testCase name="ColumnFilterManager compileDistinct should return an array of distinct field values formatted correctly" duration="1"/>
96
+ <testCase name="ColumnFilterManager compileDistinct should filter records if a load request is present" duration="1"/>
47
97
  </file>
48
98
  <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
49
99
  <testCase name="StringUtils valor vazio" duration="1"/>
50
100
  <testCase name="StringUtils valor em branco" duration="1"/>
51
101
  <testCase name="StringUtils valor null" duration="0"/>
52
- <testCase name="StringUtils valor undefined" duration="1"/>
53
- <testCase name="StringUtils valor 0" duration="0"/>
102
+ <testCase name="StringUtils valor undefined" duration="7"/>
103
+ <testCase name="StringUtils valor 0" duration="1"/>
54
104
  <testCase name="StringUtils com valor" duration="0"/>
55
105
  <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="2"/>
56
- <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="2"/>
106
+ <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="1"/>
57
107
  <testCase name="StringUtils should return the original value when called with undefined" duration="0"/>
58
108
  </file>
59
- <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
60
- <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="6"/>
61
- <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="1"/>
62
- <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="1"/>
63
- <testCase name="StringUtils it should return a Criteria class with &quot;expression&quot; and &quot;parameters&quot; as needed setted through &quot;append&quot; method" duration="1"/>
64
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;append&quot; method" duration="92"/>
65
- <testCase name="StringUtils it should return undefined as &quot;expression&quot; and &quot;[]&quot; as parameters as we use an empty criteria as first entry in the constructor" duration="1"/>
66
- <testCase name="StringUtils it should return a Criteria class with &quot;Expression&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="2"/>
67
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="0"/>
68
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;OR&quot; method" duration="1"/>
69
- <testCase name="StringUtils it should return a Criteria class with &quot;Expression&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
70
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="1"/>
71
- <testCase name="StringUtils it should return a Criteria class with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="81"/>
72
- <testCase name="StringUtils it should return a toJSON object with &quot;Criteria class&quot; and &quot;parameters&quot; concatenaded as needed setted through &quot;AND&quot; method" duration="2"/>
73
- <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
74
- </file>
75
- <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
76
- <testCase name="StringUtils stringToNumber" duration="194"/>
77
- <testCase name="StringUtils format" duration="189"/>
78
- <testCase name="StringUtils format without formatnumber parameter" duration="0"/>
79
- <testCase name="StringUtils format without formatnumber parameter" duration="4"/>
80
- <testCase name="StringUtils format round number" duration="1"/>
109
+ <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
110
+ <testCase name="HttpProvider Metodo POST" duration="1"/>
81
111
  </file>
82
112
  <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
83
- <testCase name="StringUtils it should return the correct values of &quot;value&quot; and &quot;type&quot; through the getters methods initial setted by the constructor" duration="78"/>
84
- <testCase name="StringUtils it should return the correct values of &quot;value&quot; and &quot;type&quot; through the getters methods initial setted by the setters methods" duration="0"/>
113
+ <testCase name="StringUtils it should return the correct values of &quot;value&quot; and &quot;type&quot; through the getters methods initial setted by the constructor" duration="2"/>
114
+ <testCase name="StringUtils it should return the correct values of &quot;value&quot; and &quot;type&quot; through the getters methods initial setted by the setters methods" duration="1"/>
85
115
  <testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
86
116
  </file>
87
- <file path="/builds/dti/design-system/sankhyacore/test/util/ColumnFilterManager.spec.ts">
88
- <testCase name="ColumnFilterManager getColumnFilters should return an empty map if filters are undefined or empty" duration="7"/>
89
- <testCase name="ColumnFilterManager getColumnFilters should return a map of filters matching the pattern and not the provided fieldName" duration="1"/>
90
- <testCase name="ColumnFilterManager getFilterFunction should return undefined if no filters are provided" duration="189"/>
91
- <testCase name="ColumnFilterManager getFilterFunction should return a function that evaluates records based on filters" duration="2"/>
92
- <testCase name="ColumnFilterManager getFilterFunction should return a function that evaluates records and return false" duration="107"/>
93
- <testCase name="ColumnFilterManager compileDistinct should return an array of distinct field values formatted correctly" duration="84"/>
94
- <testCase name="ColumnFilterManager compileDistinct should filter records if a load request is present" duration="1"/>
95
- </file>
96
- <file path="/builds/dti/design-system/sankhyacore/test/dataunit/loader/utils/dataUnitLoaderUtils.spec.ts">
97
- <testCase name="Utility Functions applyFilter should return the original records if no filters are provided" duration="100"/>
98
- <testCase name="Utility Functions applyFilter should filter records based on provided filters" duration="1"/>
99
- <testCase name="Utility Functions buildPaginationInfo function should return correct pagination info with default values" duration="1"/>
100
- <testCase name="Utility Functions buildPaginationInfo function should redosLenth as same size as recordsPerPage" duration="1"/>
101
- <testCase name="Utility Functions buildPaginationInfo function should handle case when totalRecordsLength and offset 0" duration="0"/>
102
- <testCase name="Utility Functions buildPaginationInfo function should handle case when currentPageLength is less than totalRecordsLength and lastPage" duration="2"/>
103
- <testCase name="Utility Functions applySorting function should return the original records if no sorting is provided" duration="1"/>
104
- <testCase name="Utility Functions applySorting function should sort records based on provided sorting criteria" duration="1"/>
117
+ <file path="/builds/dti/design-system/sankhyacore/src/dataunit/state/slice/test/RecordsSlice.spec.ts">
118
+ <testCase name="RecordsSlice should return newlines at the end" duration="2"/>
105
119
  </file>
106
120
  <file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
107
121
  <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="1"/>
108
- <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="72"/>
122
+ <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="0"/>
109
123
  <testCase name="TimeFormatter Case: validateTime" duration="1"/>
110
124
  </file>
111
- <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
112
- <testCase name="OverflowWatcher should initialize with provided parameters" duration="7"/>
113
- <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="94"/>
114
- <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="298"/>
115
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="13"/>
116
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="108"/>
117
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="6"/>
118
- <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="4"/>
119
- <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="18"/>
120
- <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
121
- </file>
122
- <file path="/builds/dti/design-system/sankhyacore/src/dataunit/state/slice/test/RecordsSlice.spec.ts">
123
- <testCase name="RecordsSlice should return newlines at the end" duration="2"/>
124
- </file>
125
125
  <file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
126
126
  <testCase name="DataUnit should return false when not waiting to reload" duration="2"/>
127
- <testCase name="DataUnit should set waitingToReload to true" duration="75"/>
128
- <testCase name="DataUnit should set waitingToReload to false" duration="9"/>
129
- <testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="1"/>
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"/>
130
130
  </file>
131
131
  <file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
132
- <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="6"/>
132
+ <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="2"/>
133
133
  <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="1"/>
134
- <testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="70"/>
135
- <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
134
+ <testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
135
+ <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="0"/>
136
136
  <testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
137
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"/>
138
138
  </file>
139
139
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
140
- <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="10"/>
141
- <testCase name="addIDInfo 2 - should add data-element-id with valid id &quot;brComSankhyaFinCadMovimentacaofinanceira_snkApplication&quot;" duration="2"/>
140
+ <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="9"/>
141
+ <testCase name="addIDInfo 2 - should add data-element-id with valid id &quot;brComSankhyaFinCadMovimentacaofinanceira_snkApplication&quot;" duration="1"/>
142
142
  <testCase name="addIDInfo 3 - should add data-element-id with valid id &quot;movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
143
143
  <testCase name="addIDInfo 4 - should add data-element-id with valid id &quot;meuID2_snkApplication&quot;" duration="1"/>
144
144
  <testCase name="addIDInfo 5 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="1"/>
145
- <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="81"/>
146
- <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="2"/>
145
+ <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="1"/>
146
+ <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="1"/>
147
147
  <testCase name="addIDInfo 8 - should add data-element-id with valid id &quot;componentLabel_snkApplication&quot;" duration="1"/>
148
- <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
149
- <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
150
- <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="2"/>
148
+ <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
149
+ <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
150
+ <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="1"/>
151
151
  <testCase name="addIDInfo 12 - should add data-element-id with valid id &quot;dataunitFinanceiro_movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
152
152
  <testCase name="addIDInfo 13 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="1"/>
153
- <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="4"/>
153
+ <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="1"/>
154
154
  <testCase name="addIDInfo 15 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
155
155
  <testCase name="addIDInfo 16 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
156
156
  <testCase name="addIDInfo 17 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
157
157
  <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
158
- <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="76"/>
158
+ <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
159
159
  <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
160
- <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="7"/>
161
- <testCase name="addIDInfo 22 - should add data-element-id with valid id &quot;bancoObrigatorio_movimentacaoFinanceira&quot;" duration="2"/>
162
- </file>
163
- <file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
164
- <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="196"/>
165
- <testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="3"/>
166
- <testCase name="calcMarginSize should threat values defined as zero" duration="4"/>
167
- </file>
168
- <file path="/builds/dti/design-system/sankhyacore/test/dataunit/loader/dataUnitInMemoryLoader.spec.ts">
169
- <testCase name="DataUnitInMemoryLoader - loadData should be called load data when auto load is true" duration="85"/>
170
- <testCase name="DataUnitInMemoryLoader - loadData should be called load data when auto load is undefined" duration="2"/>
171
- <testCase name="DataUnitInMemoryLoader - loadData should not be called load data when auto load is false" duration="1"/>
172
- <testCase name="DataUnitInMemoryLoader - loadData should be called load data when config is undefined" duration="1"/>
173
- <testCase name="DataUnitInMemoryLoader - getConvertedValue should return the original string if descriptor is undefined" duration="1"/>
174
- <testCase name="DataUnitInMemoryLoader - getConvertedValue should return the original string if dataType is TEXT" duration="0"/>
175
- <testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to boolean when dataType is BOOLEAN" duration="1"/>
176
- <testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to number when dataType is NUMBER" duration="0"/>
177
- <testCase name="DataUnitInMemoryLoader - getConvertedValue should parse JSON when dataType is OBJECT" duration="1"/>
178
- <testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to date when dataType is DATE and format is ISO" duration="1"/>
179
- <testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to date when dataType is DATE and format is not ISO" duration="82"/>
180
- <testCase name="DataUnitInMemoryLoader - getConvertedValue should return the original string if no dataType matches" duration="1"/>
181
- <testCase name="DataUnitInMemoryLoader - removeLoader should resolve with the provided record IDs" duration="1"/>
182
- <testCase name="DataUnitInMemoryLoader - removeLoader should handle empty record ID array" duration="1"/>
183
- <testCase name="DataUnitInMemoryLoader - removeLoader should resolve the promise" duration="1"/>
184
- <testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should build initial records and convert field values based on metadata" duration="2"/>
185
- <testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should generate unique IDs for records without &quot;__record__id__&quot;" duration="6"/>
186
- <testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should leave fields untouched if no matching metadata exists" duration="2"/>
187
- <testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should skip conversion for non-string field values" duration="1"/>
160
+ <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
161
+ <testCase name="addIDInfo 22 - should add data-element-id with valid id &quot;bancoObrigatorio_movimentacaoFinanceira&quot;" duration="1"/>
188
162
  </file>
189
163
  <file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
190
- <testCase name="getFormattedValue should return empty string when value is null" duration="85"/>
191
- <testCase name="getFormattedValue should return empty string when value is not an array" duration="1"/>
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="0"/>
192
166
  <testCase name="getFormattedValue should return empty string when value is an empty array" duration="0"/>
193
- <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="0"/>
167
+ <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="1"/>
194
168
  <testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="1"/>
195
169
  <testCase name="getFormattedValue should return empty string for undefined file" duration="0"/>
196
170
  <testCase name="getFormattedValue should handle OBJECT type with value field" duration="1"/>
197
171
  <testCase name="getFormattedValue should return empty string when value is undefined" duration="0"/>
198
- <testCase name="getFormattedValue should return value as string when value is not an object" duration="0"/>
172
+ <testCase name="getFormattedValue should return value as string when value is not an object" duration="1"/>
199
173
  <testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="0"/>
200
174
  <testCase name="getFormattedValue should handle BOOLEAN type" duration="0"/>
201
- <testCase name="getFormattedValue should format numbers correctly" duration="15"/>
202
- <testCase name="getFormattedValue should format dates correctly" duration="6"/>
175
+ <testCase name="getFormattedValue should format numbers correctly" duration="13"/>
176
+ <testCase name="getFormattedValue should format dates correctly" duration="45"/>
203
177
  <testCase name="getFormattedValue should format times correctly" duration="1"/>
204
- <testCase name="getFormattedValue should format datetime correctly" duration="0"/>
205
- <testCase name="getFormattedValue should call toString with correct parameters" duration="1"/>
206
- <testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="1"/>
207
- <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="0"/>
208
- <testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="0"/>
209
- <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="1"/>
178
+ <testCase name="getFormattedValue should format datetime correctly" duration="1"/>
179
+ <testCase name="getFormattedValue should call toString with correct parameters" duration="0"/>
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="1"/>
182
+ <testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="8"/>
183
+ <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
210
184
  <testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
211
185
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
212
186
  <testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="1"/>
213
- <testCase name="getFormattedValue should format masked values correctly" duration="66"/>
187
+ <testCase name="getFormattedValue should format masked values correctly" duration="2"/>
188
+ </file>
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="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
+ </file>
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="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
+ <testCase name="DataUnitInMemoryLoader - getConvertedValue should return the original string if descriptor is undefined" duration="1"/>
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="0"/>
202
+ <testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to number when dataType is NUMBER" duration="1"/>
203
+ <testCase name="DataUnitInMemoryLoader - getConvertedValue should parse JSON when dataType is OBJECT" duration="1"/>
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="7"/>
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="2"/>
208
+ <testCase name="DataUnitInMemoryLoader - removeLoader should handle empty record ID array" duration="1"/>
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
+ <testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should generate unique IDs for records without &quot;__record__id__&quot;" duration="4"/>
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
 
@@ -1,6 +1,7 @@
1
1
  export interface IKeyboardOptions {
2
2
  type: 'keydown' | 'keyup',
3
3
  propagate: boolean,
4
+ enableShadowDom: boolean,
4
5
  element: HTMLElement | Document,
5
6
  debounceTime: number,
6
7
  description?: string,