@sankhyalabs/core 5.20.0-dev.73 → 5.20.0-dev.75

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 (41) hide show
  1. package/.docs/classes/Base64Utils.md +39 -0
  2. package/.docs/classes/Change.md +11 -11
  3. package/.docs/classes/DataUnit.md +122 -100
  4. package/.docs/classes/SelectionInfo.md +12 -12
  5. package/.docs/classes/StringUtils.md +24 -0
  6. package/.docs/enumerations/ChangeOperation.md +4 -4
  7. package/.docs/enumerations/SelectionMode.md +2 -2
  8. package/.docs/enumerations/UserInterface.md +15 -5
  9. package/.docs/globals.md +1 -0
  10. package/.docs/interfaces/DUActionInterceptor.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/type-aliases/DataUnitEventOptions.md +1 -1
  17. package/dist/dataunit/DataUnit.d.ts +10 -1
  18. package/dist/dataunit/DataUnit.js +10 -4
  19. package/dist/dataunit/DataUnit.js.map +1 -1
  20. package/dist/dataunit/formatting/PrettyFormatter.js +3 -0
  21. package/dist/dataunit/formatting/PrettyFormatter.js.map +1 -1
  22. package/dist/dataunit/metadata/UnitMetadata.d.ts +1 -0
  23. package/dist/dataunit/metadata/UnitMetadata.js +1 -0
  24. package/dist/dataunit/metadata/UnitMetadata.js.map +1 -1
  25. package/dist/index.d.ts +2 -1
  26. package/dist/index.js +2 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/utils/Base64Utils.d.ts +7 -0
  29. package/dist/utils/Base64Utils.js +13 -0
  30. package/dist/utils/Base64Utils.js.map +1 -0
  31. package/dist/utils/StringUtils.d.ts +6 -0
  32. package/dist/utils/StringUtils.js +11 -0
  33. package/dist/utils/StringUtils.js.map +1 -1
  34. package/package.json +1 -1
  35. package/reports/test-report.xml +116 -116
  36. package/src/dataunit/DataUnit.ts +18 -4
  37. package/src/dataunit/formatting/PrettyFormatter.ts +4 -0
  38. package/src/dataunit/metadata/UnitMetadata.ts +1 -0
  39. package/src/index.ts +4 -1
  40. package/src/utils/Base64Utils.ts +13 -0
  41. package/src/utils/StringUtils.ts +13 -0
@@ -1,116 +1,116 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <unitTest version="1">
3
3
  <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
4
- <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="74"/>
4
+ <testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="7"/>
5
5
  <testCase name="StringUtils it should modify &quot;expressions&quot; and &quot;parameters&quot; properties through Setters methods" duration="1"/>
6
6
  <testCase name="StringUtils it should return &quot;expression&quot; and &quot;parameters&quot; setted through constructor method" duration="0"/>
7
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"/>
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="292"/>
9
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
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
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
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"/>
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="86"/>
14
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
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"/>
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"/>
17
+ <testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="1"/>
25
18
  </file>
26
19
  <file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
27
- <testCase name="Mask Formatter mask:CPF complete valid" duration="2"/>
20
+ <testCase name="Mask Formatter mask:CPF complete valid" duration="85"/>
28
21
  <testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
29
- <testCase name="Mask Formatter mask:CPF incomplete valid" duration="0"/>
30
- <testCase name="Mask Formatter mask:CPF incomplete valid placeholder" 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"/>
22
+ <testCase name="Mask Formatter mask:CPF incomplete valid" duration="1"/>
23
+ <testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="2"/>
24
+ <testCase name="Mask Formatter mask:CPF too long valid" duration="1"/>
25
+ <testCase name="Mask Formatter mask:CPF invalid for string" duration="113"/>
33
26
  <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"/>
36
- <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
37
- <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="0"/>
38
- <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="1"/>
27
+ <testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="1"/>
28
+ <testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
29
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="3"/>
30
+ <testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="1"/>
31
+ <testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="0"/>
39
32
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
40
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
33
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
41
34
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
42
35
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
43
- <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
36
+ <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
44
37
  <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"/>
38
+ <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
46
39
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
47
40
  <testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
48
41
  <testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
49
42
  </file>
50
43
  <file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
51
- <testCase name="OverflowWatcher should initialize with provided parameters" duration="10"/>
44
+ <testCase name="OverflowWatcher should initialize with provided parameters" duration="81"/>
52
45
  <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"/>
46
+ <testCase name="OverflowWatcher Should call callback on forceUpdate" duration="298"/>
47
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="16"/>
48
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="105"/>
49
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="9"/>
50
+ <testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="3"/>
51
+ <testCase name="OverflowWatcher should ignore elements that can not overflow" duration="19"/>
59
52
  <testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
60
53
  </file>
54
+ <file path="/builds/dti/design-system/sankhyacore/test/dataunit/loader/utils/dataUnitLoaderUtils.spec.ts">
55
+ <testCase name="Utility Functions applyFilter should return the original records if no filters are provided" duration="7"/>
56
+ <testCase name="Utility Functions applyFilter should filter records based on provided filters" duration="1"/>
57
+ <testCase name="Utility Functions buildPaginationInfo function should return correct pagination info with default values" duration="4"/>
58
+ <testCase name="Utility Functions buildPaginationInfo function should redosLenth as same size as recordsPerPage" duration="1"/>
59
+ <testCase name="Utility Functions buildPaginationInfo function should handle case when totalRecordsLength and offset 0" duration="0"/>
60
+ <testCase name="Utility Functions buildPaginationInfo function should handle case when currentPageLength is less than totalRecordsLength and lastPage" duration="1"/>
61
+ <testCase name="Utility Functions applySorting function should return the original records if no sorting is provided" duration="2"/>
62
+ <testCase name="Utility Functions applySorting function should sort records based on provided sorting criteria" duration="1"/>
63
+ </file>
64
+ <file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
65
+ <testCase name="StringUtils stringToNumber" duration="100"/>
66
+ <testCase name="StringUtils format" duration="188"/>
67
+ <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
68
+ <testCase name="StringUtils format without formatnumber parameter" duration="1"/>
69
+ <testCase name="StringUtils format round number" duration="2"/>
70
+ </file>
71
+ <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
72
+ <testCase name="StringUtils valor vazio" duration="1"/>
73
+ <testCase name="StringUtils valor em branco" duration="0"/>
74
+ <testCase name="StringUtils valor null" duration="1"/>
75
+ <testCase name="StringUtils valor undefined" duration="0"/>
76
+ <testCase name="StringUtils valor 0" duration="1"/>
77
+ <testCase name="StringUtils com valor" duration="0"/>
78
+ <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="74"/>
79
+ <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="2"/>
80
+ <testCase name="StringUtils should return the original value when called with undefined" duration="1"/>
81
+ </file>
61
82
  <file path="/builds/dti/design-system/sankhyacore/src/utils/test/objectUtils.spec.ts">
62
83
  <testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="1"/>
63
84
  <testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="0"/>
64
85
  <testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="0"/>
65
- <testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="1"/>
86
+ <testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="0"/>
66
87
  <testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="0"/>
67
- <testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="0"/>
88
+ <testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="1"/>
68
89
  <testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="0"/>
69
90
  <testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="0"/>
70
91
  <testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="1"/>
71
92
  <testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="0"/>
72
- <testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
93
+ <testCase name="ObjectUtils should get an object value based on its path" duration="1"/>
73
94
  <testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
74
95
  <testCase name="ObjectUtils should return undefined if the path doesn&apos;t exist in the object" duration="1"/>
75
96
  </file>
76
- <file path="/builds/dti/design-system/sankhyacore/test/dataunit/loader/utils/dataUnitLoaderUtils.spec.ts">
77
- <testCase name="Utility Functions applyFilter should return the original records if no filters are provided" duration="10"/>
78
- <testCase name="Utility Functions applyFilter should filter records based on provided filters" duration="1"/>
79
- <testCase name="Utility Functions buildPaginationInfo function should return correct pagination info with default values" duration="1"/>
80
- <testCase name="Utility Functions buildPaginationInfo function should redosLenth as same size as recordsPerPage" duration="1"/>
81
- <testCase name="Utility Functions buildPaginationInfo function should handle case when totalRecordsLength and offset 0" duration="1"/>
82
- <testCase name="Utility Functions buildPaginationInfo function should handle case when currentPageLength is less than totalRecordsLength and lastPage" duration="84"/>
83
- <testCase name="Utility Functions applySorting function should return the original records if no sorting is provided" duration="2"/>
84
- <testCase name="Utility Functions applySorting function should sort records based on provided sorting criteria" duration="2"/>
85
- </file>
86
- <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
87
- <testCase name="HttpProvider Metodo GET" duration="1"/>
88
- </file>
89
97
  <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"/>
98
+ <testCase name="ColumnFilterManager getColumnFilters should return an empty map if filters are undefined or empty" duration="2"/>
91
99
  <testCase name="ColumnFilterManager getColumnFilters should return a map of filters matching the pattern and not the provided fieldName" duration="1"/>
92
100
  <testCase name="ColumnFilterManager getFilterFunction should return undefined if no filters are provided" duration="1"/>
93
101
  <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"/>
102
+ <testCase name="ColumnFilterManager getFilterFunction should return a function that evaluates records and return false" duration="7"/>
95
103
  <testCase name="ColumnFilterManager compileDistinct should return an array of distinct field values formatted correctly" duration="1"/>
96
104
  <testCase name="ColumnFilterManager compileDistinct should filter records if a load request is present" duration="1"/>
97
105
  </file>
98
- <file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
99
- <testCase name="StringUtils valor vazio" duration="1"/>
100
- <testCase name="StringUtils valor em branco" duration="1"/>
101
- <testCase name="StringUtils valor null" duration="0"/>
102
- <testCase name="StringUtils valor undefined" duration="7"/>
103
- <testCase name="StringUtils valor 0" duration="1"/>
104
- <testCase name="StringUtils com valor" duration="0"/>
105
- <testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="2"/>
106
- <testCase name="StringUtils should return the original value when called with an object without a toString method" duration="1"/>
107
- <testCase name="StringUtils should return the original value when called with undefined" duration="0"/>
106
+ <file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
107
+ <testCase name="HttpProvider Metodo GET" duration="0"/>
108
108
  </file>
109
109
  <file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
110
110
  <testCase name="HttpProvider Metodo POST" duration="1"/>
111
111
  </file>
112
112
  <file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
113
- <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"/>
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="1"/>
114
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"/>
115
115
  <testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="1"/>
116
116
  </file>
@@ -118,98 +118,98 @@
118
118
  <testCase name="RecordsSlice should return newlines at the end" duration="2"/>
119
119
  </file>
120
120
  <file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
121
- <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="1"/>
122
- <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="0"/>
121
+ <testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="2"/>
122
+ <testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="78"/>
123
123
  <testCase name="TimeFormatter Case: validateTime" duration="1"/>
124
124
  </file>
125
- <file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
126
- <testCase name="DataUnit should return false when not waiting to reload" duration="2"/>
127
- <testCase name="DataUnit should set waitingToReload to true" duration="0"/>
128
- <testCase name="DataUnit should set waitingToReload to false" duration="1"/>
129
- <testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="0"/>
130
- </file>
131
125
  <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="2"/>
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="1"/>
135
- <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="0"/>
126
+ <testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="4"/>
127
+ <testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="0"/>
128
+ <testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="0"/>
129
+ <testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
136
130
  <testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
137
131
  <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
132
  </file>
139
133
  <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="9"/>
141
- <testCase name="addIDInfo 2 - should add data-element-id with valid id &quot;brComSankhyaFinCadMovimentacaofinanceira_snkApplication&quot;" duration="1"/>
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
- <testCase name="addIDInfo 4 - should add data-element-id with valid id &quot;meuID2_snkApplication&quot;" duration="1"/>
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="1"/>
134
+ <testCase name="addIDInfo 1 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="90"/>
135
+ <testCase name="addIDInfo 2 - should add data-element-id with valid id &quot;brComSankhyaFinCadMovimentacaofinanceira_snkApplication&quot;" duration="2"/>
136
+ <testCase name="addIDInfo 3 - should add data-element-id with valid id &quot;movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
137
+ <testCase name="addIDInfo 4 - should add data-element-id with valid id &quot;meuID2_snkApplication&quot;" duration="2"/>
138
+ <testCase name="addIDInfo 5 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="2"/>
139
+ <testCase name="addIDInfo 6 - should add data-element-id with valid id &quot;movFinanceira_snkApplication&quot;" duration="2"/>
146
140
  <testCase name="addIDInfo 7 - should add data-element-id with valid id &quot;componenteNameTest_snkApplication&quot;" duration="1"/>
147
141
  <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="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"/>
142
+ <testCase name="addIDInfo 9 - should add data-element-id with valid id &quot;dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
143
+ <testCase name="addIDInfo 10 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira&quot;" duration="2"/>
144
+ <testCase name="addIDInfo 11 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira&quot;" duration="2"/>
151
145
  <testCase name="addIDInfo 12 - should add data-element-id with valid id &quot;dataunitFinanceiro_movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
152
146
  <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="1"/>
147
+ <testCase name="addIDInfo 14 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira&quot;" duration="3"/>
154
148
  <testCase name="addIDInfo 15 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
155
149
  <testCase name="addIDInfo 16 - should add data-element-id with valid id &quot;dataunitFinanceiro_meuIdTeste_snkApplication&quot;" duration="1"/>
156
150
  <testCase name="addIDInfo 17 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
157
- <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="0"/>
151
+ <testCase name="addIDInfo 18 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="3"/>
158
152
  <testCase name="addIDInfo 19 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
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="0"/>
153
+ <testCase name="addIDInfo 20 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="3"/>
154
+ <testCase name="addIDInfo 21 - should add data-element-id with valid id &quot;movFinanceira_movimentacaoFinanceira&quot;" duration="1"/>
161
155
  <testCase name="addIDInfo 22 - should add data-element-id with valid id &quot;bancoObrigatorio_movimentacaoFinanceira&quot;" duration="1"/>
162
156
  </file>
157
+ <file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
158
+ <testCase name="DataUnit should return false when not waiting to reload" duration="3"/>
159
+ <testCase name="DataUnit should set waitingToReload to true" duration="0"/>
160
+ <testCase name="DataUnit should set waitingToReload to false" duration="1"/>
161
+ <testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="1"/>
162
+ </file>
163
163
  <file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
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"/>
164
+ <testCase name="getFormattedValue should return empty string when value is null" duration="57"/>
165
+ <testCase name="getFormattedValue should return empty string when value is not an array" duration="1"/>
166
166
  <testCase name="getFormattedValue should return empty string when value is an empty array" duration="0"/>
167
- <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="1"/>
168
- <testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="1"/>
167
+ <testCase name="getFormattedValue should return file name when value is an array with one file object" duration="0"/>
168
+ <testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="0"/>
169
169
  <testCase name="getFormattedValue should return empty string for undefined file" duration="0"/>
170
- <testCase name="getFormattedValue should handle OBJECT type with value field" duration="1"/>
170
+ <testCase name="getFormattedValue should handle OBJECT type with value field" duration="0"/>
171
171
  <testCase name="getFormattedValue should return empty string when value is undefined" duration="0"/>
172
172
  <testCase name="getFormattedValue should return value as string when value is not an object" duration="1"/>
173
173
  <testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="0"/>
174
- <testCase name="getFormattedValue should handle BOOLEAN type" duration="0"/>
175
- <testCase name="getFormattedValue should format numbers correctly" duration="13"/>
176
- <testCase name="getFormattedValue should format dates correctly" duration="45"/>
177
- <testCase name="getFormattedValue should format times correctly" duration="1"/>
178
- <testCase name="getFormattedValue should format datetime correctly" duration="1"/>
179
- <testCase name="getFormattedValue should call toString with correct parameters" duration="0"/>
174
+ <testCase name="getFormattedValue should handle BOOLEAN type" duration="3"/>
175
+ <testCase name="getFormattedValue should format numbers correctly" duration="10"/>
176
+ <testCase name="getFormattedValue should format dates correctly" duration="5"/>
177
+ <testCase name="getFormattedValue should format times correctly" duration="0"/>
178
+ <testCase name="getFormattedValue should format datetime correctly" duration="0"/>
179
+ <testCase name="getFormattedValue should call toString with correct parameters" duration="1"/>
180
180
  <testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="0"/>
181
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"/>
182
+ <testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="0"/>
183
+ <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="1"/>
184
184
  <testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
185
185
  <testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
186
- <testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="1"/>
187
- <testCase name="getFormattedValue should format masked values correctly" duration="2"/>
186
+ <testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="0"/>
187
+ <testCase name="getFormattedValue should format masked values correctly" duration="1"/>
188
188
  </file>
189
189
  <file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
190
- <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="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"/>
190
+ <testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="78"/>
191
+ <testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="2"/>
192
+ <testCase name="calcMarginSize should threat values defined as zero" duration="4"/>
193
193
  </file>
194
194
  <file path="/builds/dti/design-system/sankhyacore/test/dataunit/loader/dataUnitInMemoryLoader.spec.ts">
195
- <testCase name="DataUnitInMemoryLoader - loadData should be called load data when auto load is true" duration="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"/>
195
+ <testCase name="DataUnitInMemoryLoader - loadData should be called load data when auto load is true" duration="63"/>
196
+ <testCase name="DataUnitInMemoryLoader - loadData should be called load data when auto load is undefined" duration="2"/>
197
+ <testCase name="DataUnitInMemoryLoader - loadData should not be called load data when auto load is false" duration="1"/>
198
+ <testCase name="DataUnitInMemoryLoader - loadData should be called load data when config is undefined" duration="1"/>
199
199
  <testCase name="DataUnitInMemoryLoader - getConvertedValue should return the original string if descriptor is undefined" duration="1"/>
200
200
  <testCase name="DataUnitInMemoryLoader - getConvertedValue should return the original string if dataType is TEXT" duration="1"/>
201
- <testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to boolean when dataType is BOOLEAN" duration="0"/>
202
- <testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to number when dataType is NUMBER" duration="1"/>
201
+ <testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to boolean when dataType is BOOLEAN" duration="1"/>
202
+ <testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to number when dataType is NUMBER" duration="0"/>
203
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"/>
204
+ <testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to date when dataType is DATE and format is ISO" duration="0"/>
205
+ <testCase name="DataUnitInMemoryLoader - getConvertedValue should convert to date when dataType is DATE and format is not ISO" duration="0"/>
206
206
  <testCase name="DataUnitInMemoryLoader - getConvertedValue should return the original string if no dataType matches" duration="1"/>
207
- <testCase name="DataUnitInMemoryLoader - removeLoader should resolve with the provided record IDs" duration="2"/>
207
+ <testCase name="DataUnitInMemoryLoader - removeLoader should resolve with the provided record IDs" duration="1"/>
208
208
  <testCase name="DataUnitInMemoryLoader - removeLoader should handle empty record ID array" duration="1"/>
209
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"/>
210
+ <testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should build initial records and convert field values based on metadata" duration="3"/>
211
+ <testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should generate unique IDs for records without &quot;__record__id__&quot;" duration="2"/>
212
+ <testCase name="DataUnitInMemoryLoader - buildInitialRecords (indiretamente via set records) should leave fields untouched if no matching metadata exists" duration="2"/>
213
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>
@@ -345,6 +345,10 @@ export default class DataUnit {
345
345
  }
346
346
  }
347
347
 
348
+ public async loadDataWithParams({source, keepSelection, selectFirstRecord, executionCtx, checkLastFilter, quickFilter}: LoadDataParams): Promise<LoadDataResponse> {
349
+ return await this.loadData(quickFilter, executionCtx, checkLastFilter, source, selectFirstRecord, keepSelection);
350
+ }
351
+
348
352
  /**
349
353
  *
350
354
  * Carrega os registros do DataUnit.
@@ -356,7 +360,7 @@ export default class DataUnit {
356
360
  * @returns - Registros requisitados.
357
361
  *
358
362
  */
359
- public async loadData(quickFilter?: QuickFilter, executionCtx?: ExecutionContext, checkLastFilter?: boolean, source?: string, selectFirstRecord?: boolean): Promise<LoadDataResponse> {
363
+ public async loadData(quickFilter?: QuickFilter, executionCtx?: ExecutionContext, checkLastFilter?: boolean, source?: string, selectFirstRecord?: boolean, keepSelection?: boolean): Promise<LoadDataResponse> {
360
364
 
361
365
  await this.processLoadingLockers();
362
366
 
@@ -372,7 +376,7 @@ export default class DataUnit {
372
376
  }
373
377
  }
374
378
 
375
- const loadDataRequest = this.getLoadDataRequest(quickFilter, source);
379
+ const loadDataRequest = this.getLoadDataRequest(quickFilter, source, keepSelection);
376
380
  return this.executeLoadData(loadDataRequest, executionCtx, checkLastFilter, selectFirstRecord);
377
381
  }
378
382
 
@@ -437,12 +441,13 @@ export default class DataUnit {
437
441
  return this.gotoPage(getCurrentPage(this._stateManager) - 1, executionCtx);
438
442
  }
439
443
 
440
- private getLoadDataRequest(quickFilter?: QuickFilter, source?: string): LoadDataRequest {
444
+ private getLoadDataRequest(quickFilter?: QuickFilter, source?: string, keepSelection?: boolean): LoadDataRequest {
441
445
  const request: LoadDataRequest = {
442
446
  filters: quickFilter?.filter ? [quickFilter.filter] : this.getFilters(),
443
447
  sort: this.getSort(),
444
448
  parentRecordId: this.getParentRecordId(),
445
- source
449
+ source,
450
+ keepSelection
446
451
  };
447
452
 
448
453
  if (quickFilter) {
@@ -1932,6 +1937,15 @@ export default class DataUnit {
1932
1937
 
1933
1938
  }
1934
1939
 
1940
+ export interface LoadDataParams {
1941
+ quickFilter?: QuickFilter;
1942
+ executionCtx?: ExecutionContext;
1943
+ checkLastFilter?: boolean;
1944
+ source?: string;
1945
+ selectFirstRecord?: boolean;
1946
+ keepSelection?: boolean
1947
+ }
1948
+
1935
1949
  export interface DUActionInterceptor {
1936
1950
  interceptAction(action: DataUnitAction): DataUnitAction | Promise<DataUnitAction>;
1937
1951
  }
@@ -77,6 +77,10 @@ const getSearchFormat = (value: any, descriptor: FieldDescriptor) => {
77
77
  return label ? `${codeValue} - ${label}` : codeValue;
78
78
  }
79
79
 
80
+ if(descriptor.userInterface === UserInterface.SEARCHPLUS){
81
+ return codeValue;
82
+ }
83
+
80
84
  return label ? label : codeValue;
81
85
  }
82
86
 
@@ -91,6 +91,7 @@ export enum UserInterface {
91
91
  DECIMALNUMBER = "DECIMALNUMBER",
92
92
  INTEGERNUMBER = "INTEGERNUMBER",
93
93
  SEARCH = "SEARCH",
94
+ SEARCHPLUS = "SEARCHPLUS",
94
95
  SHORTTEXT = "SHORTTEXT",
95
96
  PASSWORD = "PASSWORD",
96
97
  MASKEDTEXT = "MASKEDTEXT",
package/src/index.ts CHANGED
@@ -49,6 +49,7 @@ import { DataUnitInMemoryLoader } from "./dataunit/loader/dataUnitInMemoryLoader
49
49
  import { DataUnitLoaderUtils, PaginationInfoBuilderParams } from "./dataunit/loader/utils/dataUnitLoaderUtils.js";
50
50
  import { ColumnFilterManager } from "./utils/ColumnFilterManager.js";
51
51
  import { DataUnitInMemoryLoaderConfig, RECORD_DATE_FORMAT } from "./dataunit/loader/DataUnitInMemoryLoaderConfig.js";
52
+ import Base64Utils from "./utils/Base64Utils.js";
52
53
 
53
54
  /*Classes públicas no pacote*/
54
55
  export {
@@ -133,5 +134,7 @@ export {
133
134
  PaginationInfoBuilderParams,
134
135
  ColumnFilterManager,
135
136
  DataUnitInMemoryLoaderConfig,
136
- RECORD_DATE_FORMAT
137
+ RECORD_DATE_FORMAT,
138
+ Base64Utils,
139
+
137
140
  };
@@ -0,0 +1,13 @@
1
+ export default class Base64Utils{
2
+ /**
3
+ * Adiciona caracteres de quebra de linha ao hash64 que representa o recordId do registro.
4
+ * @param base64String - id do registro
5
+ */
6
+ public static addBreakLineCharacters(base64String: string) {
7
+ const lineBreakPattern = /.{1,76}/g;
8
+ const result = base64String.match(lineBreakPattern)?.join('\n') ?? base64String;
9
+ return result.slice(0, 247) + '\n' + result.slice(247);
10
+ }
11
+
12
+
13
+ }
@@ -538,4 +538,17 @@ export class StringUtils {
538
538
 
539
539
  return valueAux;
540
540
  }
541
+
542
+
543
+ /**
544
+ * Escapa caracteres especiais em uma string, usando sequencias de escape Unicode.
545
+ * @param str A string que deve sofrer alteração.
546
+ * @returns String com valores alterados.
547
+ */
548
+ public static escapeString(str: string): string {
549
+ // eslint-disable-next-line no-control-regex
550
+ return str.replace(/[\u0000-\u001F\u007F-\uFFFF<>=&"']/g, (char) => {
551
+ return "\\u" + char.charCodeAt(0).toString(16).padStart(4, "0");
552
+ });
553
+ }
541
554
  }