@sankhyalabs/core 5.20.0-dev.32 → 5.20.0-dev.33

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 (39) hide show
  1. package/.docs/classes/Change.md +11 -11
  2. package/.docs/classes/DataUnit.md +157 -129
  3. package/.docs/classes/IDBRepository.md +22 -0
  4. package/.docs/classes/MaskFormatter.md +13 -9
  5. package/.docs/classes/SelectionInfo.md +25 -11
  6. package/.docs/enumerations/ChangeOperation.md +4 -4
  7. package/.docs/enumerations/SelectionMode.md +2 -2
  8. package/.docs/interfaces/DUActionInterceptor.md +1 -1
  9. package/.docs/interfaces/IRepository.md +18 -0
  10. package/.docs/interfaces/LoadDataRequest.md +1 -1
  11. package/.docs/interfaces/PageRequest.md +3 -3
  12. package/.docs/interfaces/QuickFilter.md +3 -3
  13. package/.docs/interfaces/Record.md +4 -4
  14. package/.docs/interfaces/SavedRecord.md +5 -5
  15. package/.docs/interfaces/WaitingChange.md +3 -3
  16. package/.docs/namespaces/MaskFormatter/type-aliases/MaskCharacter.md +1 -1
  17. package/.docs/namespaces/MaskFormatter/variables/MaskCharacter.md +1 -1
  18. package/.docs/type-aliases/DataUnitEventOptions.md +1 -1
  19. package/dist/dataunit/DataUnit.d.ts +6 -3
  20. package/dist/dataunit/DataUnit.js +19 -7
  21. package/dist/dataunit/DataUnit.js.map +1 -1
  22. package/dist/dataunit/formatting/PrettyFormatter.js +1 -1
  23. package/dist/dataunit/formatting/PrettyFormatter.js.map +1 -1
  24. package/dist/dataunit/loading/LoadDataRequest.d.ts +1 -1
  25. package/dist/repository/IRepository.d.ts +6 -0
  26. package/dist/repository/indexeddb/IDBRepository.d.ts +1 -0
  27. package/dist/repository/indexeddb/IDBRepository.js +3 -0
  28. package/dist/repository/indexeddb/IDBRepository.js.map +1 -1
  29. package/dist/utils/MaskFormatter.d.ts +2 -1
  30. package/dist/utils/MaskFormatter.js +5 -1
  31. package/dist/utils/MaskFormatter.js.map +1 -1
  32. package/package.json +1 -1
  33. package/reports/test-report.xml +96 -96
  34. package/src/dataunit/DataUnit.ts +31 -16
  35. package/src/dataunit/formatting/PrettyFormatter.ts +1 -1
  36. package/src/dataunit/loading/LoadDataRequest.ts +1 -1
  37. package/src/repository/IRepository.ts +7 -0
  38. package/src/repository/indexeddb/IDBRepository.ts +4 -0
  39. package/src/utils/MaskFormatter.ts +5 -1
@@ -1,151 +1,151 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <unitTest version="1">
3
+ <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
4
+ <testCase name="HttpProvider Metodo GET" duration="13"/>
5
+ </file>
6
+ <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
7
+ <testCase name="HttpProvider Metodo POST" duration="88"/>
8
+ </file>
9
+ <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
10
+ <testCase name="StringUtils it should return the correct values of &quot;value&quot; and &quot;type&quot; through the getters methods initial setted by the constructor" duration="383"/>
11
+ <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="101"/>
12
+ <testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
13
+ </file>
14
+ <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
15
+ <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="7"/>
16
+ <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="1"/>
17
+ <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="1"/>
18
+ <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="89"/>
19
+ <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"/>
20
+ <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"/>
21
+ <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"/>
22
+ <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"/>
23
+ <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"/>
24
+ <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="2"/>
25
+ <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"/>
26
+ <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"/>
27
+ <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"/>
28
+ <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
29
+ </file>
3
30
  <file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
4
- <testCase name="Mask Formatter mask:CPF complete valid" duration="7"/>
31
+ <testCase name="Mask Formatter mask:CPF complete valid" duration="91"/>
5
32
  <testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
6
- <testCase name="Mask Formatter mask:CPF incomplete valid" duration="1"/>
33
+ <testCase name="Mask Formatter mask:CPF incomplete valid" duration="2"/>
7
34
  <testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
8
35
  <testCase name="Mask Formatter mask:CPF too long valid" duration="1"/>
9
- <testCase name="Mask Formatter mask:CPF invalid for string" duration="124"/>
36
+ <testCase name="Mask Formatter mask:CPF invalid for string" duration="392"/>
10
37
  <testCase name="Mask Formatter mask:CPF invalid for being too long" duration="1"/>
11
38
  <testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="1"/>
12
- <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
39
+ <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="0"/>
13
40
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
14
41
  <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="0"/>
15
- <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="0"/>
42
+ <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="3"/>
16
43
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
17
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
18
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
44
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
45
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
19
46
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
20
47
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
21
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
48
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="77"/>
49
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
50
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
51
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
22
52
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
23
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
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="2"/>
26
53
  </file>
27
- <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
28
- <testCase name="StringUtils stringToNumber" duration="89"/>
29
- <testCase name="StringUtils format" duration="202"/>
30
- <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
31
- <testCase name="StringUtils format without formatnumber parameter" duration="3"/>
32
- <testCase name="StringUtils format round number" duration="14"/>
54
+ <file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
55
+ <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="3"/>
56
+ <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="1"/>
57
+ <testCase name="TimeFormatter Case: validateTime" duration="1"/>
33
58
  </file>
34
- <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
35
- <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="72"/>
36
- <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="1"/>
37
- <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="1"/>
38
- <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"/>
39
- <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="2"/>
40
- <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"/>
41
- <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"/>
42
- <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"/>
43
- <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"/>
44
- <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="8"/>
45
- <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"/>
46
- <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"/>
47
- <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"/>
48
- <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
59
+ <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
60
+ <testCase name="StringUtils valor vazio" duration="6"/>
61
+ <testCase name="StringUtils valor em branco" duration="1"/>
62
+ <testCase name="StringUtils valor null" duration="1"/>
63
+ <testCase name="StringUtils valor undefined" duration="0"/>
64
+ <testCase name="StringUtils valor 0" duration="0"/>
65
+ <testCase name="StringUtils com valor" duration="2"/>
66
+ <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="2"/>
67
+ <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="3"/>
68
+ <testCase name="StringUtils should return the original value when called with undefined" duration="0"/>
49
69
  </file>
50
- <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
51
- <testCase name="HttpProvider Metodo GET" duration="1"/>
70
+ <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
71
+ <testCase name="StringUtils stringToNumber" duration="13"/>
72
+ <testCase name="StringUtils format" duration="107"/>
73
+ <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
74
+ <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
75
+ <testCase name="StringUtils format round number" duration="1"/>
52
76
  </file>
53
77
  <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
54
- <testCase name="OverflowWatcher should initialize with provided parameters" duration="10"/>
78
+ <testCase name="OverflowWatcher should initialize with provided parameters" duration="83"/>
55
79
  <testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="2"/>
56
- <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="198"/>
57
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="97"/>
58
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="87"/>
59
- <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="7"/>
80
+ <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="213"/>
81
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="95"/>
82
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="9"/>
83
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="75"/>
60
84
  <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="4"/>
61
- <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="11"/>
62
- <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="3"/>
63
- </file>
64
- <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
65
- <testCase name="HttpProvider Metodo POST" duration="0"/>
66
- </file>
67
- <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
68
- <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"/>
69
- <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"/>
70
- <testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
71
- </file>
72
- <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
73
- <testCase name="StringUtils valor vazio" duration="1"/>
74
- <testCase name="StringUtils valor em branco" duration="1"/>
75
- <testCase name="StringUtils valor null" duration="0"/>
76
- <testCase name="StringUtils valor undefined" duration="1"/>
77
- <testCase name="StringUtils valor 0" duration="0"/>
78
- <testCase name="StringUtils com valor" duration="1"/>
79
- <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="1"/>
80
- <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="2"/>
81
- <testCase name="StringUtils should return the original value when called with undefined" duration="1"/>
82
- </file>
83
- <file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
84
- <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="1"/>
85
- <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="0"/>
86
- <testCase name="TimeFormatter Case: validateTime" duration="1"/>
85
+ <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="10"/>
86
+ <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
87
87
  </file>
88
88
  <file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
89
- <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="52"/>
90
- <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="1"/>
89
+ <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="81"/>
90
+ <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="0"/>
91
91
  <testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
92
- <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="0"/>
92
+ <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
93
93
  <testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
94
- <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"/>
94
+ <testCase name="DataUnitStorage remove should not remove any DataUnit instance if the specified DataUnit instance or name is not found in the DataUnitStorage" duration="6"/>
95
95
  </file>
96
96
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
97
97
  <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="12"/>
98
98
  <testCase name="addIDInfo 2 - should add data-element-id with valid id &quot;brComSankhyaFinCadMovimentacaofinanceira_snkApplication&quot;" duration="2"/>
99
- <testCase name="addIDInfo 3 - should add data-element-id with valid id &quot;movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
99
+ <testCase name="addIDInfo 3 - should add data-element-id with valid id &quot;movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
100
100
  <testCase name="addIDInfo 4 - should add data-element-id with valid id &quot;meuID2_snkApplication&quot;" duration="1"/>
101
101
  <testCase name="addIDInfo 5 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="1"/>
102
102
  <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="2"/>
103
103
  <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="1"/>
104
- <testCase name="addIDInfo 8 - should add data-element-id with valid id &quot;componentLabel_snkApplication&quot;" duration="1"/>
105
- <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
106
- <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="67"/>
107
- <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="2"/>
108
- <testCase name="addIDInfo 12 - should add data-element-id with valid id &quot;dataunitFinanceiro_movFinanceira_movimentacaoFinanceira&quot;" duration="2"/>
104
+ <testCase name="addIDInfo 8 - should add data-element-id with valid id &quot;componentLabel_snkApplication&quot;" duration="66"/>
105
+ <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
106
+ <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="1"/>
107
+ <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="1"/>
108
+ <testCase name="addIDInfo 12 - should add data-element-id with valid id &quot;dataunitFinanceiro_movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
109
109
  <testCase name="addIDInfo 13 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="1"/>
110
- <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="3"/>
110
+ <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="5"/>
111
111
  <testCase name="addIDInfo 15 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
112
- <testCase name="addIDInfo 16 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="6"/>
113
- <testCase name="addIDInfo 17 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
114
- <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
115
- <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
116
- <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
117
- <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
112
+ <testCase name="addIDInfo 16 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
113
+ <testCase name="addIDInfo 17 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
114
+ <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
115
+ <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
116
+ <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
117
+ <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
118
118
  <testCase name="addIDInfo 22 - should add data-element-id with valid id &quot;bancoObrigatorio_movimentacaoFinanceira&quot;" duration="1"/>
119
119
  </file>
120
120
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
121
- <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="40"/>
122
- <testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="1"/>
123
- <testCase name="calcMarginSize should threat values defined as zero" duration="3"/>
121
+ <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="59"/>
122
+ <testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="3"/>
123
+ <testCase name="calcMarginSize should threat values defined as zero" duration="5"/>
124
124
  </file>
125
125
  <file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
126
126
  <testCase name="getFormattedValue should return empty string when value is null" duration="5"/>
127
- <testCase name="getFormattedValue should return empty string when value is not an array" duration="0"/>
128
- <testCase name="getFormattedValue should return empty string when value is an empty array" duration="1"/>
129
- <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="0"/>
130
- <testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="1"/>
127
+ <testCase name="getFormattedValue should return empty string when value is not an array" duration="1"/>
128
+ <testCase name="getFormattedValue should return empty string when value is an empty array" duration="0"/>
129
+ <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="1"/>
130
+ <testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="0"/>
131
131
  <testCase name="getFormattedValue should return empty string for undefined file" duration="0"/>
132
- <testCase name="getFormattedValue should handle OBJECT type with value field" duration="1"/>
132
+ <testCase name="getFormattedValue should handle OBJECT type with value field" duration="0"/>
133
133
  <testCase name="getFormattedValue should return empty string when value is undefined" duration="0"/>
134
134
  <testCase name="getFormattedValue should return value as string when value is not an object" duration="1"/>
135
135
  <testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="0"/>
136
136
  <testCase name="getFormattedValue should handle BOOLEAN type" duration="1"/>
137
- <testCase name="getFormattedValue should format numbers correctly" duration="15"/>
138
- <testCase name="getFormattedValue should format dates correctly" duration="5"/>
137
+ <testCase name="getFormattedValue should format numbers correctly" duration="13"/>
138
+ <testCase name="getFormattedValue should format dates correctly" duration="4"/>
139
139
  <testCase name="getFormattedValue should format times correctly" duration="1"/>
140
- <testCase name="getFormattedValue should format datetime correctly" duration="1"/>
141
- <testCase name="getFormattedValue should call toString with correct parameters" duration="0"/>
140
+ <testCase name="getFormattedValue should format datetime correctly" duration="0"/>
141
+ <testCase name="getFormattedValue should call toString with correct parameters" duration="1"/>
142
142
  <testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="0"/>
143
143
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="1"/>
144
144
  <testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="0"/>
145
145
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
146
- <testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="1"/>
146
+ <testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
147
147
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
148
148
  <testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="0"/>
149
- <testCase name="getFormattedValue should format masked values correctly" duration="2"/>
149
+ <testCase name="getFormattedValue should format masked values correctly" duration="1"/>
150
150
  </file>
151
151
  </unitTest>
@@ -33,6 +33,7 @@ import { getLoadingProperties, LoadingPropertiesReducer } from "./state/slice/Lo
33
33
  export default class DataUnit {
34
34
 
35
35
  public static CHANGING_PAGE_LOADING_SOURCE = "CHANGING_PAGE_LOADING_SOURCE";
36
+ public static ALL_RECORDS_SELECTION_SOURCE = "ALL_RECORDS_SELECTION_SOURCE";
36
37
  public static DEFAULT_DATAUNIT_NAME = "dataunit";
37
38
 
38
39
  private _uuid: string;
@@ -55,6 +56,7 @@ export default class DataUnit {
55
56
  public saveLoader?: (dataUnit: DataUnit, changes: Array<Change>) => Promise<Array<SavedRecord>>;
56
57
  public removeLoader?: (dataUnit: DataUnit, recordIds: Array<string>) => Promise<Array<string>>;
57
58
  public recordLoader?: (dataUnit: DataUnit, recordIds: Array<string>) => Promise<Array<Record>>;
59
+ public allRecordsLoader?: (dataUnit: DataUnit) => Array<Record> | undefined;
58
60
 
59
61
  constructor(name: string = DataUnit.DEFAULT_DATAUNIT_NAME, parentDataUnit?: DataUnit) {
60
62
  this._uuid = uuid()
@@ -550,8 +552,8 @@ export default class DataUnit {
550
552
  if(selection.isAllRecords()){
551
553
  throw new Error("Exclusão remota não implementada.");
552
554
  }
553
- const records = selection?.records || [];
554
- const recordIds = selection?.recordIds || [];
555
+ const records = selection?.records as Array<Record> || [];
556
+ const recordIds = selection?.recordIds as Array<string> || [];
555
557
  return this.removeRecords(recordIds, records, buffered, undefined, silent);
556
558
  }
557
559
  return Promise.resolve([]);
@@ -653,13 +655,13 @@ export default class DataUnit {
653
655
  */
654
656
  public getFormattedValue(fieldName: string, value?: any): string {
655
657
  const descriptor = this.getField(fieldName);
656
- if (value === undefined) {
658
+ if (value == undefined) {
657
659
  value = this.getFieldValue(fieldName);
658
660
  } else if (typeof value === "string" && descriptor?.dataType != DataType.TEXT){
659
661
  value = this.valueFromString(fieldName, value);
660
662
  }
661
663
 
662
- if(value === undefined){
664
+ if(value == undefined){
663
665
  return "";
664
666
  }
665
667
 
@@ -887,8 +889,12 @@ export default class DataUnit {
887
889
  public copySelected(executionCtx?: ExecutionContext): void {
888
890
  const selectionInfo = this.getSelectionInfo();
889
891
  if (selectionInfo) {
890
- const selectedRecords = selectionInfo.records;
892
+ if(selectionInfo.isAllRecords()){
893
+ throw new Error("Erro interno: Impossível copiar os registros selecionados pois a seleção atual é virtual.");
894
+ }
895
+ const selectedRecords = selectionInfo.records as Array<Record>;
891
896
  if(selectedRecords){
897
+
892
898
  this.dispatchAction(Action.RECORDS_COPIED, prepareCopiedRecord(this._stateManager, selectedRecords, this.getParentRecordId()), executionCtx);
893
899
  }
894
900
  }
@@ -1104,7 +1110,7 @@ export default class DataUnit {
1104
1110
  public setSelection(selection: Array<string> | SelectionMode.ALL_RECORDS, executionCtx?: ExecutionContext): Promise<SelectionInfo> {
1105
1111
  return new Promise(resolve => {
1106
1112
  this.dispatchAction(Action.SELECTION_CHANGED, { type: "id", selection }, executionCtx)
1107
- .then(()=>resolve(getSelectionInfo(this._stateManager)));
1113
+ .then(()=>resolve(this.getSelectionInfo()));
1108
1114
  });
1109
1115
  }
1110
1116
 
@@ -1161,8 +1167,10 @@ export default class DataUnit {
1161
1167
  * @returns - Objeto com informações como registros selecionados e seleção por critério.
1162
1168
  *
1163
1169
  **/
1164
- public getSelectionInfo(): SelectionInfo | undefined {
1165
- return getSelectionInfo(this._stateManager)
1170
+ public getSelectionInfo(): SelectionInfo{
1171
+ const selectionInfo: SelectionInfo = getSelectionInfo(this._stateManager);
1172
+ selectionInfo.getAllRecords = () => this.allRecordsLoader?.(this);
1173
+ return selectionInfo;
1166
1174
  }
1167
1175
 
1168
1176
  /**
@@ -1728,7 +1736,7 @@ export default class DataUnit {
1728
1736
  }
1729
1737
 
1730
1738
  if (selection) {
1731
- return selection.records;
1739
+ return selection.records as Array<Record>;
1732
1740
  }
1733
1741
  }
1734
1742
 
@@ -1746,12 +1754,15 @@ export default class DataUnit {
1746
1754
  public getSelection(): Array<string> {
1747
1755
  console.warn("DataUnit: O método `getSelection` foi descontinuado. Use o método `getSelectionInfo`.");
1748
1756
  const selection = this.getSelectionInfo();
1757
+ if(selection == undefined){
1758
+ return [];
1759
+ }
1749
1760
 
1750
- if(selection != undefined && selection.isAllRecords()){
1761
+ if(selection.isAllRecords()){
1751
1762
  throw new Error("Erro interno: Impossível retornar os registros selecionados. A seleção atual é virtual. Use o método `getSelectionInfo`.");
1752
1763
  }
1753
1764
 
1754
- return selection?.recordIds || [];
1765
+ return selection?.recordIds as Array<string>;
1755
1766
  }
1756
1767
 
1757
1768
  /**
@@ -1932,12 +1943,13 @@ export enum SelectionMode{
1932
1943
 
1933
1944
  export class SelectionInfo{
1934
1945
 
1935
- private _records: Array<Record>;
1936
1946
  public mode: SelectionMode;
1937
- private _total?: number;
1938
1947
  public filters?: Array<Filter>;
1939
1948
  public sort?: Array<Sort>;
1940
-
1949
+ public getAllRecords?: () => Array<Record> | undefined;
1950
+ private _records: Array<Record>;
1951
+ private _total?: number;
1952
+
1941
1953
  constructor(records: Array<Record>, mode: SelectionMode = SelectionMode.SOME_RECORDS, total?:number, filters?: Array<Filter>, sort?: Array<Sort>){
1942
1954
  this._records = records;
1943
1955
  this._total = total;
@@ -1948,7 +1960,10 @@ export class SelectionInfo{
1948
1960
 
1949
1961
  public get records(): Array<Record> | undefined{
1950
1962
  if(this.isAllRecords()){
1951
- throw new Error("Erro interno: [ALL_RECORDS] - Impossível retornar os registros selecionados numa seleção virtual.")
1963
+ if(this.getAllRecords != undefined){
1964
+ return this.getAllRecords();
1965
+ }
1966
+ throw new Error("Erro interno: Impossível retornar os registros selecionados numa seleção virtual.");
1952
1967
  }
1953
1968
  return this._records;
1954
1969
  }
@@ -1967,7 +1982,7 @@ export class SelectionInfo{
1967
1982
  if(this.isAllRecords()){
1968
1983
  return this._total || 0;
1969
1984
  }
1970
- return this.records == undefined ? 0: this.records.length;
1985
+ return this.records == undefined ? 0 : (this.records as Array<Record>).length;
1971
1986
  }
1972
1987
 
1973
1988
  public isAllRecords(): boolean{
@@ -43,7 +43,7 @@ export const getFormattedValue = (value: any, descriptor?: FieldDescriptor) => {
43
43
  const mask = getMask(value, descriptor);
44
44
  if(mask != undefined){
45
45
  try{
46
- return new MaskFormatter(mask).format(value);
46
+ return new MaskFormatter(mask).format(value, true);
47
47
  } catch(error){
48
48
  console.warn(`Erro ao formatar valor: ${value}. Mascara: ${mask}. Erro: ${error}`);
49
49
  }
@@ -4,7 +4,7 @@ import { Filter, Sort } from "../metadata/UnitMetadata.js";
4
4
  /** Atributos enviados na requisição de carregamento dos registros */
5
5
  export interface LoadDataRequest {
6
6
  /** De onde partiu o refresh. Por padrão a fonte não é identificada */
7
- source?: String;
7
+ source?: string;
8
8
 
9
9
  /** Indice inicial dos registros que será retornado */
10
10
  offset?: number;
@@ -79,4 +79,11 @@ export interface IRepository<T>{
79
79
  * @returns Promessa de quantidade
80
80
  */
81
81
  count(): Promise<number>;
82
+
83
+ /**
84
+ * Retorna todos os registros que estão em cache no momento
85
+ *
86
+ * @returns Todos registros que estão em cache no momento
87
+ */
88
+ getFromCache(): Array<T> | undefined
82
89
  }
@@ -320,6 +320,10 @@ export class IDBRepository<T> implements IRepository<T>{
320
320
  const tx = db.transaction(this._addedStoreName);
321
321
  return tx.objectStore(this._addedStoreName).getAll();
322
322
  }
323
+
324
+ public getFromCache(): Array<T> | undefined{
325
+ return undefined;
326
+ }
323
327
  }
324
328
 
325
329
  /**
@@ -96,9 +96,13 @@ export class MaskFormatter {
96
96
  * Formata a string passada baseada na máscara definda pelo atributo mask.
97
97
  *
98
98
  * @param value Valor a ser formatado.
99
+ * @param trimBefore Executa um trim para remover espaços em branco.
99
100
  * @return O valor processado de acordo com o padrão.
100
101
  */
101
- public format(value: string): string {
102
+ public format(value: string, trimBefore: boolean = false): string {
103
+ if(trimBefore){
104
+ value = value.trim();
105
+ }
102
106
  let result: string = '';
103
107
  const index: Array<number> = [0];
104
108