@sankhyalabs/core 0.0.0-bugfix-dev-KB-75210.1 → 0.0.0-bugfix-dev-KB-75940.0

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.
Files changed (49) hide show
  1. package/.docs/classes/Change.md +11 -11
  2. package/.docs/classes/DataUnit.md +154 -120
  3. package/.docs/classes/KeyboardManager.md +79 -9
  4. package/.docs/classes/LockManager.md +73 -15
  5. package/.docs/classes/SelectionInfo.md +12 -12
  6. package/.docs/classes/UserAgentUtils.md +15 -1
  7. package/.docs/enumerations/ChangeOperation.md +4 -4
  8. package/.docs/enumerations/LockManagerOperation.md +12 -0
  9. package/.docs/enumerations/SelectionMode.md +2 -2
  10. package/.docs/interfaces/DUActionInterceptor.md +1 -1
  11. package/.docs/interfaces/PageRequest.md +3 -3
  12. package/.docs/interfaces/PaginationInfo.md +12 -0
  13. package/.docs/interfaces/QuickFilter.md +3 -3
  14. package/.docs/interfaces/Record.md +4 -4
  15. package/.docs/interfaces/SavedRecord.md +5 -5
  16. package/.docs/interfaces/WaitingChange.md +3 -3
  17. package/.docs/type-aliases/DataUnitEventOptions.md +1 -1
  18. package/dist/dataunit/DataUnit.d.ts +9 -0
  19. package/dist/dataunit/DataUnit.js +25 -9
  20. package/dist/dataunit/DataUnit.js.map +1 -1
  21. package/dist/dataunit/formatting/PrettyFormatter.js +4 -0
  22. package/dist/dataunit/formatting/PrettyFormatter.js.map +1 -1
  23. package/dist/dataunit/loading/PaginationInfo.d.ts +4 -0
  24. package/dist/dataunit/state/slice/LoadingControlSlice.js +16 -0
  25. package/dist/dataunit/state/slice/LoadingControlSlice.js.map +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/utils/KeyboardManager/index.d.ts +4 -0
  30. package/dist/utils/KeyboardManager/index.js +37 -1
  31. package/dist/utils/KeyboardManager/index.js.map +1 -1
  32. package/dist/utils/KeyboardManager/interface.d.ts +1 -0
  33. package/dist/utils/LockManager.d.ts +15 -3
  34. package/dist/utils/LockManager.js +52 -2
  35. package/dist/utils/LockManager.js.map +1 -1
  36. package/dist/utils/UserAgentUtils/index.d.ts +1 -0
  37. package/dist/utils/UserAgentUtils/index.js +5 -0
  38. package/dist/utils/UserAgentUtils/index.js.map +1 -1
  39. package/package.json +1 -1
  40. package/reports/test-report.xml +87 -87
  41. package/src/dataunit/DataUnit.ts +30 -9
  42. package/src/dataunit/formatting/PrettyFormatter.ts +5 -0
  43. package/src/dataunit/loading/PaginationInfo.ts +5 -0
  44. package/src/dataunit/state/slice/LoadingControlSlice.ts +42 -0
  45. package/src/index.ts +1 -1
  46. package/src/utils/KeyboardManager/index.ts +47 -0
  47. package/src/utils/KeyboardManager/interface.ts +1 -0
  48. package/src/utils/LockManager.ts +63 -7
  49. package/src/utils/UserAgentUtils/index.ts +6 -1
@@ -17,6 +17,10 @@ export var LockManagerOperation;
17
17
  Operação de lock utilizada para controlar cliques nos botoes da taskbar.
18
18
  */
19
19
  LockManagerOperation["TASKBAR_CLICK"] = "taskbar_click";
20
+ /**
21
+ Operação de lock utilizada para controlar carregamento da aplicação.
22
+ */
23
+ LockManagerOperation["APP_LOADING"] = "app_loading";
20
24
  })(LockManagerOperation || (LockManagerOperation = {}));
21
25
  export class LockManager {
22
26
  static buildContextID() {
@@ -60,6 +64,29 @@ export class LockManager {
60
64
  return "";
61
65
  }
62
66
  }
67
+ /**
68
+ * Reseta todos os locks existentes para um determinado contexto e operação de forma assíncrona
69
+ * @param id - ID do contexto ou elemento HTML contendo contexto
70
+ * @param operation - Operação específica para resetar os locks
71
+ * @returns Promise que será resolvida quando todos os locks forem resetados
72
+ */
73
+ static resetLocks(id, operation) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ const lockerId = this.buildLockerID(id, operation);
76
+ if (!lockerId)
77
+ return;
78
+ const currentLocks = this._locks.get(lockerId);
79
+ if (currentLocks === null || currentLocks === void 0 ? void 0 : currentLocks.length) {
80
+ yield Promise.all(currentLocks.map(lock => {
81
+ var _a;
82
+ lock.done = true;
83
+ (_a = lock.resolve) === null || _a === void 0 ? void 0 : _a.call(lock);
84
+ return lock.promise;
85
+ }));
86
+ this._locks.delete(lockerId);
87
+ }
88
+ });
89
+ }
63
90
  /**
64
91
  * Inicia um locker baseado em um contexto e uma operação.
65
92
  *
@@ -93,21 +120,44 @@ export class LockManager {
93
120
  *
94
121
  * @returns - Promise que será resolvida quando todos lockers forem finalizados.
95
122
  */
96
- static whenResolve(id, operation) {
123
+ static whenResolve(id, operation, debounce, timeOut) {
97
124
  var _a, _b;
98
125
  return __awaiter(this, void 0, void 0, function* () {
99
126
  const lockerId = LockManager.buildLockerID(id, operation);
100
127
  if (!lockerId)
101
128
  return;
129
+ if (debounce)
130
+ yield new Promise(resolve => setTimeout(resolve, debounce));
131
+ const startTime = Date.now();
102
132
  while ((_a = LockManager._locks.get(lockerId)) === null || _a === void 0 ? void 0 : _a.length) {
133
+ if (timeOut && Date.now() - startTime >= timeOut) {
134
+ yield this.resetLocks(id, operation);
135
+ return;
136
+ }
103
137
  const locks = (_b = LockManager._locks.get(lockerId)) !== null && _b !== void 0 ? _b : [];
104
138
  yield Promise.all(locks.map(lock => lock.promise));
105
139
  //Aguarda listeners da tela reagirem as mudancas de estado do dataunit
106
- yield new Promise(resolve => setTimeout(resolve, 200));
140
+ yield new Promise(resolve => setTimeout(resolve, debounce || 200));
107
141
  LockManager._locks.set(lockerId, locks.filter(lock => !lock.done));
108
142
  }
109
143
  });
110
144
  }
145
+ static whenHasLock(id, operation, timeOut) {
146
+ var _a;
147
+ return __awaiter(this, void 0, void 0, function* () {
148
+ const lockerId = LockManager.buildLockerID(id, operation);
149
+ if (!lockerId)
150
+ return;
151
+ const startTime = Date.now();
152
+ while (!((_a = LockManager._locks.get(lockerId)) === null || _a === void 0 ? void 0 : _a.length)) {
153
+ if (timeOut && Date.now() - startTime >= timeOut) {
154
+ yield this.resetLocks(id, operation);
155
+ return;
156
+ }
157
+ yield new Promise(resolve => setTimeout(resolve, 200));
158
+ }
159
+ });
160
+ }
111
161
  }
112
162
  LockManager._locks = new Map();
113
163
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"LockManager.js","sourceRoot":"","sources":["../../src/utils/LockManager.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC3C;;EAEE;AACN,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC5B;;MAEE;IACF,uDAA+B,CAAA;AACnC,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B;AAQD,MAAM,OAAO,WAAW;IAQZ,MAAM,CAAC,cAAc;QACzB,OAAO,WAAW,CAAC,YAAY,EAAE,CAAC;IACtC,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,KAAwB,EAAE,SAA+B;QAClF,IAAG,KAAK,IAAI,SAAS;YAAE,OAAO,SAAS,CAAC;QAExC,IAAI,UAAU,GAAO,KAAK,CAAC;QAE3B,IAAG,UAAU,YAAY,WAAW,EAAC;YACjC,UAAU,GAAI,KAAqB,CAAC,YAAY,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;YAC7E,IAAG,CAAC,UAAU;gBAAE,OAAO,SAAS,CAAC;SACpC;QAED,OAAO,GAAG,UAAU,IAAI,SAAS,EAAE,CAAC;IACxC,CAAC;IAmCF;;;;;;OAMG;IACK,MAAM,CAAC,mBAAmB,CAAC,YAAyB;;QACvD,IAAG;YACC,IAAI,CAAC,YAAY,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;gBACjD,OAAO,EAAE,CAAC;aACb;YAED,MAAM,KAAK,GAAG,MAAA,WAAW,CAAC,iBAAiB,CAAC,YAAY,CAAC,mCAAI,WAAW,CAAC,cAAc,EAAE,CAAC;YAE1F,IAAI,cAAc,GAAuB,YAAY,CAAC;YAEtD,OAAO,cAAc,IAAI,cAAc,CA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B,CAAC,CAAA;AAEc,8BAAkB,GAAG,CAAC,OAAoB,EAAE,KAAa,EAAQ,EAAE;IAC9E,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QACzE,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;KAC3D;IACD,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3C,IAAI,KAAK,YAAY,WAAW,EAAE;YAC9B,WAAW,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SAChD;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
@@ -7,6 +7,7 @@ export declare class UserAgentUtils {
7
7
  * @returns Verdadeiro se o navegador do usuário for o firefox.
8
8
  */
9
9
  static isFirefox(): boolean;
10
+ static isElectron(): boolean;
10
11
  /**
11
12
  * Obtém nome e versão do navegador que está sendo utilizado.
12
13
  * @returns Objeto com o nome e versão do navegador.
@@ -12,6 +12,10 @@ export class UserAgentUtils {
12
12
  const browser = this.getBrowserInfo();
13
13
  return !!browser.firefox;
14
14
  }
15
+ static isElectron() {
16
+ const browser = this.getBrowserInfo();
17
+ return !!browser.electron;
18
+ }
15
19
  /**
16
20
  * Obtém nome e versão do navegador que está sendo utilizado.
17
21
  * @returns Objeto com o nome e versão do navegador.
@@ -35,6 +39,7 @@ export class UserAgentUtils {
35
39
  }
36
40
  catch (e) {
37
41
  //ignored
42
+ console.warn(e);
38
43
  }
39
44
  browser = Object.assign(Object.assign(Object.assign({}, browser), { name, version: (result === null || result === void 0 ? void 0 : result[1]) || "", simpleVersion }), (Array.isArray(type) ? type.reduce((acc, val) => (Object.assign(Object.assign({}, acc), { [val]: true })), {}) : { [type]: true }));
40
45
  return !hasFound;
@@ -1 +1 @@
1
-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AC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CACxG,CAAA;oBACD,OAAO,CAAC,QAAQ,CAAC;iBACpB;YACL,CAAC,CAAC,CAAA;YAEF,OAAO,CAAC,QAAQ,CAAC;QACrB,CAAC,CAAC,CAAA;QAEF,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankhyalabs/core",
3
- "version": "0.0.0-bugfix-dev-KB-75210.1",
3
+ "version": "0.0.0-bugfix-dev-KB-75940.0",
4
4
  "description": "Modulo core JavaScript da Sankhya.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -1,175 +1,175 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <unitTest version="1">
3
- <file path="/builds/dti/design-system/sankhyacore/src/utils/test/objectUtils.spec.ts">
4
- <testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="84"/>
5
- <testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="1"/>
6
- <testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="0"/>
7
- <testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="4"/>
8
- <testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="1"/>
9
- <testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="0"/>
10
- <testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="1"/>
11
- <testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="0"/>
12
- <testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="1"/>
13
- <testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="0"/>
14
- <testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
15
- <testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
16
- <testCase name="ObjectUtils should return undefined if the path doesn&apos;t exist in the object" duration="0"/>
17
- </file>
18
3
  <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
19
- <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="7"/>
4
+ <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="80"/>
20
5
  <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="1"/>
21
6
  <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="1"/>
22
- <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"/>
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="2"/>
23
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"/>
24
- <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"/>
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="16"/>
25
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"/>
26
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"/>
27
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"/>
28
- <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="4"/>
29
- <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"/>
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="10"/>
30
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="0"/>
31
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="1"/>
32
17
  <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
33
18
  </file>
19
+ <file path="/builds/dti/design-system/sankhyacore/src/utils/test/objectUtils.spec.ts">
20
+ <testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="5"/>
21
+ <testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="75"/>
22
+ <testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="0"/>
23
+ <testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="1"/>
24
+ <testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="0"/>
25
+ <testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="1"/>
26
+ <testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="0"/>
27
+ <testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="0"/>
28
+ <testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="1"/>
29
+ <testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="0"/>
30
+ <testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
31
+ <testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
32
+ <testCase name="ObjectUtils should return undefined if the path doesn&apos;t exist in the object" duration="1"/>
33
+ </file>
34
34
  <file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
35
- <testCase name="Mask Formatter mask:CPF complete valid" duration="24"/>
36
- <testCase name="Mask Formatter mask:CPF complete valid literals" duration="4"/>
37
- <testCase name="Mask Formatter mask:CPF incomplete valid" duration="1"/>
35
+ <testCase name="Mask Formatter mask:CPF complete valid" duration="73"/>
36
+ <testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
37
+ <testCase name="Mask Formatter mask:CPF incomplete valid" duration="2"/>
38
38
  <testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
39
- <testCase name="Mask Formatter mask:CPF too long valid" duration="6"/>
40
- <testCase name="Mask Formatter mask:CPF invalid for string" duration="211"/>
41
- <testCase name="Mask Formatter mask:CPF invalid for being too long" duration="1"/>
42
- <testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="1"/>
39
+ <testCase name="Mask Formatter mask:CPF too long valid" duration="1"/>
40
+ <testCase name="Mask Formatter mask:CPF invalid for string" duration="207"/>
41
+ <testCase name="Mask Formatter mask:CPF invalid for being too long" duration="0"/>
42
+ <testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="0"/>
43
43
  <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
44
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
44
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="79"/>
45
45
  <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="1"/>
46
- <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="1"/>
47
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="3"/>
48
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
49
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
46
+ <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="5"/>
50
47
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
51
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
48
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
52
49
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
53
50
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
54
51
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
52
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
53
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
54
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
55
55
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
56
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
56
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
57
57
  </file>
58
58
  <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
59
- <testCase name="HttpProvider Metodo GET" duration="0"/>
60
- </file>
61
- <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
62
- <testCase name="StringUtils stringToNumber" duration="101"/>
63
- <testCase name="StringUtils format" duration="109"/>
64
- <testCase name="StringUtils format without formatnumber parameter" duration="2"/>
65
- <testCase name="StringUtils format without formatnumber parameter" duration="88"/>
66
- <testCase name="StringUtils format round number" duration="2"/>
59
+ <testCase name="HttpProvider Metodo GET" duration="1"/>
67
60
  </file>
68
61
  <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
69
62
  <testCase name="StringUtils valor vazio" duration="1"/>
70
- <testCase name="StringUtils valor em branco" duration="0"/>
63
+ <testCase name="StringUtils valor em branco" duration="1"/>
71
64
  <testCase name="StringUtils valor null" duration="0"/>
72
65
  <testCase name="StringUtils valor undefined" duration="0"/>
73
66
  <testCase name="StringUtils valor 0" duration="1"/>
74
67
  <testCase name="StringUtils com valor" duration="0"/>
75
68
  <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="1"/>
76
69
  <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="2"/>
77
- <testCase name="StringUtils should return the original value when called with undefined" duration="0"/>
70
+ <testCase name="StringUtils should return the original value when called with undefined" duration="1"/>
71
+ </file>
72
+ <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
73
+ <testCase name="StringUtils stringToNumber" duration="14"/>
74
+ <testCase name="StringUtils format" duration="106"/>
75
+ <testCase name="StringUtils format without formatnumber parameter" duration="77"/>
76
+ <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
77
+ <testCase name="StringUtils format round number" duration="2"/>
78
78
  </file>
79
79
  <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
80
80
  <testCase name="HttpProvider Metodo POST" duration="1"/>
81
81
  </file>
82
+ <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
83
+ <testCase name="OverflowWatcher should initialize with provided parameters" duration="8"/>
84
+ <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="3"/>
85
+ <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="216"/>
86
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="95"/>
87
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="88"/>
88
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="108"/>
89
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="7"/>
90
+ <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="93"/>
91
+ <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
92
+ </file>
82
93
  <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="2"/>
94
+ <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="1"/>
84
95
  <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"/>
85
96
  <testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
86
97
  </file>
87
- <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
88
- <testCase name="OverflowWatcher should initialize with provided parameters" duration="18"/>
89
- <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="69"/>
90
- <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="310"/>
91
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="23"/>
92
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="118"/>
93
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="29"/>
94
- <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="64"/>
95
- <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="126"/>
96
- <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
97
- </file>
98
98
  <file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
99
- <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="2"/>
99
+ <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="89"/>
100
100
  <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="1"/>
101
101
  <testCase name="TimeFormatter Case: validateTime" duration="1"/>
102
102
  </file>
103
103
  <file path="/builds/dti/design-system/sankhyacore/src/dataunit/state/slice/test/RecordsSlice.spec.ts">
104
- <testCase name="RecordsSlice should return newlines at the end" duration="2"/>
104
+ <testCase name="RecordsSlice should return newlines at the end" duration="92"/>
105
105
  </file>
106
106
  <file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
107
107
  <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="2"/>
108
- <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="1"/>
108
+ <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="0"/>
109
109
  <testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
110
- <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="0"/>
110
+ <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
111
111
  <testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
112
- <testCase name="DataUnitStorage remove should not remove any DataUnit instance if the specified DataUnit instance or name is not found in the DataUnitStorage" duration="1"/>
112
+ <testCase name="DataUnitStorage remove should not remove any DataUnit instance if the specified DataUnit instance or name is not found in the DataUnitStorage" duration="7"/>
113
113
  </file>
114
114
  <file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
115
115
  <testCase name="DataUnit should return false when not waiting to reload" duration="3"/>
116
116
  <testCase name="DataUnit should set waitingToReload to true" duration="1"/>
117
117
  <testCase name="DataUnit should set waitingToReload to false" duration="1"/>
118
- <testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="1"/>
118
+ <testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="3"/>
119
119
  </file>
120
120
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
121
- <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="86"/>
122
- <testCase name="addIDInfo 2 - should add data-element-id with valid id &quot;brComSankhyaFinCadMovimentacaofinanceira_snkApplication&quot;" duration="2"/>
121
+ <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="14"/>
122
+ <testCase name="addIDInfo 2 - should add data-element-id with valid id &quot;brComSankhyaFinCadMovimentacaofinanceira_snkApplication&quot;" duration="7"/>
123
123
  <testCase name="addIDInfo 3 - should add data-element-id with valid id &quot;movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
124
124
  <testCase name="addIDInfo 4 - should add data-element-id with valid id &quot;meuID2_snkApplication&quot;" duration="1"/>
125
125
  <testCase name="addIDInfo 5 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="1"/>
126
- <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="1"/>
127
- <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="2"/>
126
+ <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="2"/>
127
+ <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="1"/>
128
128
  <testCase name="addIDInfo 8 - should add data-element-id with valid id &quot;componentLabel_snkApplication&quot;" duration="1"/>
129
- <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="5"/>
129
+ <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="81"/>
130
130
  <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
131
131
  <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="2"/>
132
132
  <testCase name="addIDInfo 12 - should add data-element-id with valid id &quot;dataunitFinanceiro_movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
133
133
  <testCase name="addIDInfo 13 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="1"/>
134
- <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="6"/>
134
+ <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="4"/>
135
135
  <testCase name="addIDInfo 15 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
136
136
  <testCase name="addIDInfo 16 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="0"/>
137
- <testCase name="addIDInfo 17 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
138
- <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
139
- <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
137
+ <testCase name="addIDInfo 17 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
138
+ <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
139
+ <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
140
140
  <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
141
- <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
141
+ <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
142
142
  <testCase name="addIDInfo 22 - should add data-element-id with valid id &quot;bancoObrigatorio_movimentacaoFinanceira&quot;" duration="1"/>
143
143
  </file>
144
144
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
145
- <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="120"/>
146
- <testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="78"/>
147
- <testCase name="calcMarginSize should threat values defined as zero" duration="5"/>
145
+ <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="47"/>
146
+ <testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="1"/>
147
+ <testCase name="calcMarginSize should threat values defined as zero" duration="2"/>
148
148
  </file>
149
149
  <file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
150
- <testCase name="getFormattedValue should return empty string when value is null" duration="66"/>
150
+ <testCase name="getFormattedValue should return empty string when value is null" duration="7"/>
151
151
  <testCase name="getFormattedValue should return empty string when value is not an array" duration="1"/>
152
152
  <testCase name="getFormattedValue should return empty string when value is an empty array" duration="0"/>
153
153
  <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="1"/>
154
154
  <testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="1"/>
155
- <testCase name="getFormattedValue should return empty string for undefined file" duration="1"/>
156
- <testCase name="getFormattedValue should handle OBJECT type with value field" duration="0"/>
155
+ <testCase name="getFormattedValue should return empty string for undefined file" duration="0"/>
156
+ <testCase name="getFormattedValue should handle OBJECT type with value field" duration="1"/>
157
157
  <testCase name="getFormattedValue should return empty string when value is undefined" duration="0"/>
158
158
  <testCase name="getFormattedValue should return value as string when value is not an object" duration="1"/>
159
159
  <testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="1"/>
160
160
  <testCase name="getFormattedValue should handle BOOLEAN type" duration="0"/>
161
- <testCase name="getFormattedValue should format numbers correctly" duration="17"/>
162
- <testCase name="getFormattedValue should format dates correctly" duration="74"/>
163
- <testCase name="getFormattedValue should format times correctly" duration="0"/>
161
+ <testCase name="getFormattedValue should format numbers correctly" duration="18"/>
162
+ <testCase name="getFormattedValue should format dates correctly" duration="4"/>
163
+ <testCase name="getFormattedValue should format times correctly" duration="1"/>
164
164
  <testCase name="getFormattedValue should format datetime correctly" duration="0"/>
165
- <testCase name="getFormattedValue should call toString with correct parameters" duration="0"/>
166
- <testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="1"/>
167
- <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="1"/>
165
+ <testCase name="getFormattedValue should call toString with correct parameters" duration="1"/>
166
+ <testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="0"/>
167
+ <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="0"/>
168
168
  <testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="0"/>
169
- <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
170
- <testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="1"/>
169
+ <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="1"/>
170
+ <testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
171
171
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
172
172
  <testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="1"/>
173
- <testCase name="getFormattedValue should format masked values correctly" duration="2"/>
173
+ <testCase name="getFormattedValue should format masked values correctly" duration="1"/>
174
174
  </file>
175
175
  </unitTest>
@@ -34,7 +34,7 @@ import SilentException from "../exceptions/SilentException.js";
34
34
  * `DataUnit`: Atua como uma camada de abstração entre o back-end e a interface do usuário.
35
35
  */
36
36
  export default class DataUnit {
37
-
37
+
38
38
  public static CHANGING_PAGE_LOADING_SOURCE = "CHANGING_PAGE_LOADING_SOURCE";
39
39
  public static ALL_RECORDS_SELECTION_SOURCE = "ALL_RECORDS_SELECTION_SOURCE";
40
40
  public static DEFAULT_DATAUNIT_NAME = "dataunit";
@@ -54,6 +54,7 @@ export default class DataUnit {
54
54
  private _defaultSorting: Array<Sort>;
55
55
  private _allowReleaseCallbacks: boolean;
56
56
  private _waitingToReload: boolean = false;
57
+ private _cancelPagination: boolean = false;
57
58
 
58
59
  public metadataLoader?: (dataUnit: DataUnit) => Promise<UnitMetadata>;
59
60
  public dataLoader?: (dataUnit: DataUnit, request: LoadDataRequest) => Promise<LoadDataResponse>;
@@ -152,6 +153,7 @@ export default class DataUnit {
152
153
  return this._uuid;
153
154
  }
154
155
 
156
+
155
157
  /**
156
158
  * Retorna se o dataUnit está com recarregamento pendente.
157
159
  */
@@ -167,6 +169,20 @@ export default class DataUnit {
167
169
  this._waitingToReload = isWaiting;
168
170
  }
169
171
 
172
+ /**
173
+ * Informa se a paginação deve ser cancelada.
174
+ */
175
+ public get cancelPagination(): boolean {
176
+ return this._cancelPagination;
177
+ }
178
+
179
+ /**
180
+ * Informa se a paginação deve ser cancelada.
181
+ */
182
+ public set cancelPagination(cancelPagination: boolean) {
183
+ this._cancelPagination = cancelPagination;
184
+ }
185
+
170
186
  /**
171
187
  *
172
188
  * Obtém o nome de identificação do DataUnit (geralmente em formato de URI - Uniform Resource Identifier).
@@ -511,7 +527,8 @@ export default class DataUnit {
511
527
  resolve();
512
528
  }
513
529
  if(cause instanceof SilentException){
514
- fail();
530
+ fail(cause);
531
+ return;
515
532
  }
516
533
  fail(new ErrorException("Erro ao salvar alterações", cause, errorCode));
517
534
  });
@@ -763,6 +780,7 @@ export default class DataUnit {
763
780
  return this.dispatchAction(Action.PAGINATION_UPDATED, info, undefined);
764
781
  }
765
782
 
783
+
766
784
  /**
767
785
  *
768
786
  * Define a lógica de ordenação dos registros.
@@ -1685,18 +1703,21 @@ export default class DataUnit {
1685
1703
  public reloadCurrentRecord(): Promise<Array<Record>>{
1686
1704
  return new Promise(async (resolve, fail) => {
1687
1705
  const selection = getSelection(this._stateManager);
1688
- this.dispatchAction(Action.LOADING_RECORD, selection);
1706
+ await this.dispatchAction(Action.LOADING_RECORD, selection);
1689
1707
 
1690
1708
  if(!this.recordLoader || !this.dataLoader) {
1691
- this.dispatchAction(Action.LOADING_PROPERTIES_CLEANED);
1709
+ await this.dispatchAction(Action.LOADING_PROPERTIES_CLEANED);
1710
+ resolve([]);
1692
1711
  return;
1693
1712
  }
1694
1713
 
1695
- this.recordLoader(this, selection).then(response => {
1696
- this.dispatchAction(Action.RECORD_LOADED, response)
1697
- this.dispatchAction(Action.LOADING_PROPERTIES_CLEANED);
1698
- }).catch(cause => {
1699
- this.dispatchAction(Action.LOADING_PROPERTIES_CLEANED);
1714
+ this.recordLoader(this, selection).then(async response => {
1715
+ await this.dispatchAction(Action.RECORD_LOADED, response)
1716
+ await this.dispatchAction(Action.LOADING_PROPERTIES_CLEANED);
1717
+
1718
+ resolve(response);
1719
+ }).catch(async cause => {
1720
+ await this.dispatchAction(Action.LOADING_PROPERTIES_CLEANED);
1700
1721
  const {errorCode} = cause;
1701
1722
  fail(new ErrorException("Erro ao recarregar registro", cause, errorCode));
1702
1723
  });
@@ -1,6 +1,7 @@
1
1
  import DateUtils from '../../utils/DateUtils.js';
2
2
  import { MaskFormatter } from '../../utils/MaskFormatter.js';
3
3
  import { NumberUtils } from '../../utils/NumberUtils.js';
4
+ import { TimeFormatter } from '../../utils/TimeFormatter.js';
4
5
  import { DataType, toString } from '../metadata/DataType.js';
5
6
  import { FieldDescriptor, UserInterface } from '../metadata/UnitMetadata.js';
6
7
 
@@ -39,6 +40,10 @@ export const getFormattedValue = (value: any, descriptor?: FieldDescriptor) => {
39
40
  return DateUtils.formatTime(value);
40
41
  }
41
42
 
43
+ if(descriptor?.userInterface === UserInterface.ELAPSEDTIME){
44
+ return TimeFormatter.prepareValue(value, true);
45
+ }
46
+
42
47
  if(descriptor?.userInterface === UserInterface.DATETIME){
43
48
  return DateUtils.formatDateTime(value);
44
49
  }
@@ -23,4 +23,9 @@ export interface PaginationInfo {
23
23
  * Caso o dataunit não tenha carga paralela o valor será indefinido
24
24
  */
25
25
  loadingInProgress?: boolean;
26
+
27
+ /**
28
+ * Informa se deve exibir diálogo para cancelar carregamento de registros
29
+ */
30
+ askRowsLimit?: number;
26
31
  }