@sankhyalabs/core 0.0.0-bugfix-dev-KB-44620.0 → 0.0.0-bugfix-dev-KB-56414.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.
- package/.docs/classes/Change.md +11 -11
- package/.docs/classes/DataUnit.md +179 -129
- package/.docs/classes/IDBRepository.md +22 -0
- package/.docs/classes/MaskFormatter.md +13 -9
- package/.docs/classes/SelectionInfo.md +25 -11
- package/.docs/enumerations/ChangeOperation.md +4 -4
- package/.docs/enumerations/SelectionMode.md +2 -2
- package/.docs/interfaces/DUActionInterceptor.md +1 -1
- package/.docs/interfaces/IRepository.md +18 -0
- package/.docs/interfaces/LoadDataRequest.md +1 -1
- package/.docs/interfaces/PageRequest.md +3 -3
- package/.docs/interfaces/QuickFilter.md +3 -3
- package/.docs/interfaces/Record.md +4 -4
- package/.docs/interfaces/SavedRecord.md +5 -5
- package/.docs/interfaces/WaitingChange.md +3 -3
- package/.docs/namespaces/MaskFormatter/type-aliases/MaskCharacter.md +1 -1
- package/.docs/namespaces/MaskFormatter/variables/MaskCharacter.md +1 -1
- package/.docs/type-aliases/DataUnitEventOptions.md +1 -1
- package/dist/dataunit/DataUnit.d.ts +16 -4
- package/dist/dataunit/DataUnit.js +35 -8
- package/dist/dataunit/DataUnit.js.map +1 -1
- package/dist/dataunit/formatting/PrettyFormatter.js +2 -2
- package/dist/dataunit/formatting/PrettyFormatter.js.map +1 -1
- package/dist/dataunit/loading/LoadDataRequest.d.ts +1 -1
- package/dist/repository/IRepository.d.ts +6 -0
- package/dist/repository/indexeddb/IDBRepository.d.ts +1 -0
- package/dist/repository/indexeddb/IDBRepository.js +3 -0
- package/dist/repository/indexeddb/IDBRepository.js.map +1 -1
- package/dist/utils/MaskFormatter.d.ts +2 -1
- package/dist/utils/MaskFormatter.js +5 -1
- package/dist/utils/MaskFormatter.js.map +1 -1
- package/package.json +1 -1
- package/reports/test-report.xml +93 -93
- package/src/dataunit/DataUnit.ts +49 -18
- package/src/dataunit/formatting/PrettyFormatter.ts +2 -2
- package/src/dataunit/loading/LoadDataRequest.ts +1 -1
- package/src/repository/IRepository.ts +7 -0
- package/src/repository/indexeddb/IDBRepository.ts +4 -0
- package/src/utils/MaskFormatter.ts +5 -1
package/reports/test-report.xml
CHANGED
|
@@ -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/util/CriteriaModel.spec.ts">
|
|
4
|
-
<testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="7"/>
|
|
5
|
-
<testCase name="StringUtils it should modify "expressions" and "parameters" properties through Setters methods" duration="1"/>
|
|
6
|
-
<testCase name="StringUtils it should return "expression" and "parameters" setted through constructor method" duration="1"/>
|
|
7
|
-
<testCase name="StringUtils it should return a Criteria class with "expression" and "parameters" as needed setted through "append" method" duration="1"/>
|
|
8
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "append" method" duration="2"/>
|
|
9
|
-
<testCase name="StringUtils it should return undefined as "expression" and "[]" as parameters as we use an empty criteria as first entry in the constructor" duration="1"/>
|
|
10
|
-
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
11
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
12
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
13
|
-
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "AND" method" duration="11"/>
|
|
14
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="0"/>
|
|
15
|
-
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="0"/>
|
|
16
|
-
<testCase name="StringUtils it should return a toJSON object with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
17
|
-
<testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
|
|
18
|
-
</file>
|
|
19
3
|
<file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
|
|
20
|
-
<testCase name="Mask Formatter mask:CPF complete valid" duration="
|
|
21
|
-
<testCase name="Mask Formatter mask:CPF complete valid literals" duration="
|
|
22
|
-
<testCase name="Mask Formatter mask:CPF incomplete valid" duration="
|
|
4
|
+
<testCase name="Mask Formatter mask:CPF complete valid" duration="98"/>
|
|
5
|
+
<testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
|
|
6
|
+
<testCase name="Mask Formatter mask:CPF incomplete valid" duration="0"/>
|
|
23
7
|
<testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="1"/>
|
|
24
8
|
<testCase name="Mask Formatter mask:CPF too long valid" duration="1"/>
|
|
25
|
-
<testCase name="Mask Formatter mask:CPF invalid for string" duration="
|
|
9
|
+
<testCase name="Mask Formatter mask:CPF invalid for string" duration="99"/>
|
|
26
10
|
<testCase name="Mask Formatter mask:CPF invalid for being too long" duration="0"/>
|
|
27
|
-
<testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="
|
|
28
|
-
<testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="
|
|
29
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
|
|
30
|
-
<testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="0"/>
|
|
31
|
-
<testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="1"/>
|
|
11
|
+
<testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="0"/>
|
|
12
|
+
<testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="0"/>
|
|
32
13
|
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
33
|
-
<testCase name="Mask Formatter mask:Licence plate
|
|
34
|
-
<testCase name="Mask Formatter mask:Licence plate
|
|
35
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="
|
|
14
|
+
<testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="1"/>
|
|
15
|
+
<testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="1"/>
|
|
16
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="3"/>
|
|
36
17
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
|
|
37
|
-
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="
|
|
18
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
|
|
38
19
|
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
39
20
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
|
|
40
21
|
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
|
|
41
|
-
<testCase name="Mask Formatter mask:Licence plate invalid" duration="
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<testCase name="
|
|
45
|
-
</file>
|
|
46
|
-
<file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
|
|
47
|
-
<testCase name="HttpProvider Metodo POST" duration="0"/>
|
|
22
|
+
<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="1"/>
|
|
25
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
48
26
|
</file>
|
|
49
|
-
<file path="/builds/dti/design-system/sankhyacore/test/util/
|
|
50
|
-
<testCase name="
|
|
51
|
-
<testCase name="
|
|
52
|
-
<testCase name="
|
|
53
|
-
<testCase name="
|
|
54
|
-
<testCase name="
|
|
55
|
-
<testCase name="
|
|
56
|
-
<testCase name="
|
|
57
|
-
<testCase name="
|
|
58
|
-
<testCase name="
|
|
27
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaModel.spec.ts">
|
|
28
|
+
<testCase name="StringUtils it should return the undefined and [] to Criteria Props through new class with empty constructor" duration="78"/>
|
|
29
|
+
<testCase name="StringUtils it should modify "expressions" and "parameters" properties through Setters methods" duration="1"/>
|
|
30
|
+
<testCase name="StringUtils it should return "expression" and "parameters" setted through constructor method" duration="1"/>
|
|
31
|
+
<testCase name="StringUtils it should return a Criteria class with "expression" and "parameters" as needed setted through "append" method" duration="1"/>
|
|
32
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "append" method" duration="1"/>
|
|
33
|
+
<testCase name="StringUtils it should return undefined as "expression" and "[]" as parameters as we use an empty criteria as first entry in the constructor" duration="0"/>
|
|
34
|
+
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
35
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
36
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "OR" method" duration="1"/>
|
|
37
|
+
<testCase name="StringUtils it should return a Criteria class with "Expression" and "parameters" concatenaded as needed setted through "AND" method" duration="3"/>
|
|
38
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
39
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
40
|
+
<testCase name="StringUtils it should return a toJSON object with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
41
|
+
<testCase name="StringUtils it should return a toJSON object with through empty constructor" duration="0"/>
|
|
59
42
|
</file>
|
|
60
43
|
<file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
|
|
61
|
-
<testCase name="StringUtils stringToNumber" duration="
|
|
62
|
-
<testCase name="StringUtils format" duration="
|
|
63
|
-
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
44
|
+
<testCase name="StringUtils stringToNumber" duration="81"/>
|
|
45
|
+
<testCase name="StringUtils format" duration="217"/>
|
|
64
46
|
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
65
|
-
<testCase name="StringUtils format
|
|
66
|
-
|
|
67
|
-
<file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
|
|
68
|
-
<testCase name="StringUtils it should return the correct values of "value" and "type" through the getters methods initial setted by the constructor" duration="1"/>
|
|
69
|
-
<testCase name="StringUtils it should return the correct values of "value" and "type" 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"/>
|
|
47
|
+
<testCase name="StringUtils format without formatnumber parameter" duration="3"/>
|
|
48
|
+
<testCase name="StringUtils format round number" duration="1"/>
|
|
71
49
|
</file>
|
|
72
50
|
<file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
|
|
73
51
|
<testCase name="StringUtils valor vazio" duration="1"/>
|
|
74
|
-
<testCase name="StringUtils valor em branco" duration="
|
|
52
|
+
<testCase name="StringUtils valor em branco" duration="1"/>
|
|
75
53
|
<testCase name="StringUtils valor null" duration="0"/>
|
|
76
54
|
<testCase name="StringUtils valor undefined" duration="1"/>
|
|
77
55
|
<testCase name="StringUtils valor 0" duration="0"/>
|
|
78
|
-
<testCase name="StringUtils com valor" duration="
|
|
79
|
-
<testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="
|
|
80
|
-
<testCase name="StringUtils should return the original value when called with an object without a toString method" duration="
|
|
81
|
-
<testCase name="StringUtils should return the original value when called with undefined" duration="
|
|
56
|
+
<testCase name="StringUtils com valor" duration="1"/>
|
|
57
|
+
<testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="1"/>
|
|
58
|
+
<testCase name="StringUtils should return the original value when called with an object without a toString method" duration="2"/>
|
|
59
|
+
<testCase name="StringUtils should return the original value when called with undefined" duration="0"/>
|
|
60
|
+
</file>
|
|
61
|
+
<file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
|
|
62
|
+
<testCase name="HttpProvider Metodo GET" duration="0"/>
|
|
63
|
+
</file>
|
|
64
|
+
<file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
|
|
65
|
+
<testCase name="HttpProvider Metodo POST" duration="1"/>
|
|
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 "value" and "type" through the getters methods initial setted by the constructor" duration="2"/>
|
|
69
|
+
<testCase name="StringUtils it should return the correct values of "value" and "type" through the getters methods initial setted by the setters methods" duration="1"/>
|
|
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/OverflowWatcher.spec.ts">
|
|
73
|
+
<testCase name="OverflowWatcher should initialize with provided parameters" duration="10"/>
|
|
74
|
+
<testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="3"/>
|
|
75
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate" duration="398"/>
|
|
76
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="88"/>
|
|
77
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="24"/>
|
|
78
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="87"/>
|
|
79
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="4"/>
|
|
80
|
+
<testCase name="OverflowWatcher should ignore elements that can not overflow" duration="87"/>
|
|
81
|
+
<testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="2"/>
|
|
82
82
|
</file>
|
|
83
83
|
<file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
|
|
84
84
|
<testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="2"/>
|
|
85
85
|
<testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="1"/>
|
|
86
|
-
<testCase name="TimeFormatter Case: validateTime" duration="
|
|
86
|
+
<testCase name="TimeFormatter Case: validateTime" duration="2"/>
|
|
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="
|
|
89
|
+
<testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="63"/>
|
|
90
90
|
<testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="1"/>
|
|
91
91
|
<testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
|
|
92
92
|
<testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="1"/>
|
|
93
|
-
<testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="
|
|
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="
|
|
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"/>
|
|
95
95
|
</file>
|
|
96
96
|
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
|
|
97
|
-
<testCase name="addIDInfo 1 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="
|
|
98
|
-
<testCase name="addIDInfo 2 - should add data-element-id with valid id "brComSankhyaFinCadMovimentacaofinanceira_snkApplication"" duration="
|
|
99
|
-
<testCase name="addIDInfo 3 - should add data-element-id with valid id "movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="
|
|
97
|
+
<testCase name="addIDInfo 1 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="72"/>
|
|
98
|
+
<testCase name="addIDInfo 2 - should add data-element-id with valid id "brComSankhyaFinCadMovimentacaofinanceira_snkApplication"" duration="1"/>
|
|
99
|
+
<testCase name="addIDInfo 3 - should add data-element-id with valid id "movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="11"/>
|
|
100
100
|
<testCase name="addIDInfo 4 - should add data-element-id with valid id "meuID2_snkApplication"" duration="1"/>
|
|
101
|
-
<testCase name="addIDInfo 5 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="
|
|
102
|
-
<testCase name="addIDInfo 6 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="
|
|
103
|
-
<testCase name="addIDInfo 7 - should add data-element-id with valid id "componenteNameTest_snkApplication"" duration="
|
|
101
|
+
<testCase name="addIDInfo 5 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="1"/>
|
|
102
|
+
<testCase name="addIDInfo 6 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="2"/>
|
|
103
|
+
<testCase name="addIDInfo 7 - should add data-element-id with valid id "componenteNameTest_snkApplication"" duration="1"/>
|
|
104
104
|
<testCase name="addIDInfo 8 - should add data-element-id with valid id "componentLabel_snkApplication"" duration="1"/>
|
|
105
105
|
<testCase name="addIDInfo 9 - should add data-element-id with valid id "dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="1"/>
|
|
106
|
-
<testCase name="addIDInfo 10 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="
|
|
107
|
-
<testCase name="addIDInfo 11 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="
|
|
108
|
-
<testCase name="addIDInfo 12 - should add data-element-id with valid id "dataunitFinanceiro_movFinanceira_movimentacaoFinanceira"" duration="
|
|
109
|
-
<testCase name="addIDInfo 13 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="
|
|
110
|
-
<testCase name="addIDInfo 14 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira"" duration="
|
|
106
|
+
<testCase name="addIDInfo 10 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="2"/>
|
|
107
|
+
<testCase name="addIDInfo 11 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="1"/>
|
|
108
|
+
<testCase name="addIDInfo 12 - should add data-element-id with valid id "dataunitFinanceiro_movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
109
|
+
<testCase name="addIDInfo 13 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="66"/>
|
|
110
|
+
<testCase name="addIDInfo 14 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira"" duration="2"/>
|
|
111
111
|
<testCase name="addIDInfo 15 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="1"/>
|
|
112
112
|
<testCase name="addIDInfo 16 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="1"/>
|
|
113
113
|
<testCase name="addIDInfo 17 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
114
|
-
<testCase name="addIDInfo 18 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="
|
|
115
|
-
<testCase name="addIDInfo 19 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="
|
|
114
|
+
<testCase name="addIDInfo 18 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
115
|
+
<testCase name="addIDInfo 19 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="0"/>
|
|
116
116
|
<testCase name="addIDInfo 20 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
117
|
-
<testCase name="addIDInfo 21 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="
|
|
117
|
+
<testCase name="addIDInfo 21 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
118
118
|
<testCase name="addIDInfo 22 - should add data-element-id with valid id "bancoObrigatorio_movimentacaoFinanceira"" duration="1"/>
|
|
119
119
|
</file>
|
|
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="15"/>
|
|
122
|
-
<testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="2"/>
|
|
123
|
-
<testCase name="calcMarginSize should threat values defined as zero" duration="2"/>
|
|
124
|
-
</file>
|
|
125
120
|
<file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
|
|
126
|
-
<testCase name="getFormattedValue should return empty string when value is null" duration="
|
|
121
|
+
<testCase name="getFormattedValue should return empty string when value is null" duration="4"/>
|
|
127
122
|
<testCase name="getFormattedValue should return empty string when value is not an array" duration="0"/>
|
|
128
123
|
<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="
|
|
130
|
-
<testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="
|
|
131
|
-
<testCase name="getFormattedValue should return empty string for undefined file" duration="
|
|
132
|
-
<testCase name="getFormattedValue should handle OBJECT type with value field" duration="
|
|
124
|
+
<testCase name="getFormattedValue should return file name when value is an array with one file object" duration="1"/>
|
|
125
|
+
<testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="0"/>
|
|
126
|
+
<testCase name="getFormattedValue should return empty string for undefined file" duration="1"/>
|
|
127
|
+
<testCase name="getFormattedValue should handle OBJECT type with value field" duration="0"/>
|
|
133
128
|
<testCase name="getFormattedValue should return empty string when value is undefined" duration="0"/>
|
|
134
129
|
<testCase name="getFormattedValue should return value as string when value is not an object" duration="0"/>
|
|
135
130
|
<testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="0"/>
|
|
136
131
|
<testCase name="getFormattedValue should handle BOOLEAN type" duration="1"/>
|
|
137
132
|
<testCase name="getFormattedValue should format numbers correctly" duration="10"/>
|
|
138
|
-
<testCase name="getFormattedValue should format dates correctly" duration="
|
|
139
|
-
<testCase name="getFormattedValue should format times correctly" duration="
|
|
140
|
-
<testCase name="getFormattedValue should format datetime correctly" duration="
|
|
133
|
+
<testCase name="getFormattedValue should format dates correctly" duration="4"/>
|
|
134
|
+
<testCase name="getFormattedValue should format times correctly" duration="1"/>
|
|
135
|
+
<testCase name="getFormattedValue should format datetime correctly" duration="20"/>
|
|
141
136
|
<testCase name="getFormattedValue should call toString with correct parameters" duration="0"/>
|
|
142
|
-
<testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="
|
|
137
|
+
<testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="1"/>
|
|
143
138
|
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="0"/>
|
|
144
139
|
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="0"/>
|
|
145
140
|
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
|
|
146
141
|
<testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
|
|
147
142
|
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
|
|
148
143
|
<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="
|
|
144
|
+
<testCase name="getFormattedValue should format masked values correctly" duration="2"/>
|
|
145
|
+
</file>
|
|
146
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
|
|
147
|
+
<testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="26"/>
|
|
148
|
+
<testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="30"/>
|
|
149
|
+
<testCase name="calcMarginSize should threat values defined as zero" duration="4"/>
|
|
150
150
|
</file>
|
|
151
151
|
</unitTest>
|
package/src/dataunit/DataUnit.ts
CHANGED
|
@@ -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()
|
|
@@ -184,6 +186,8 @@ export default class DataUnit {
|
|
|
184
186
|
case Action.NEXT_SELECTED:
|
|
185
187
|
case Action.PREVIOUS_SELECTED:
|
|
186
188
|
case Action.DATA_LOADED:
|
|
189
|
+
case Action.RECORDS_ADDED:
|
|
190
|
+
case Action.EDITION_CANCELED:
|
|
187
191
|
this.clearDataUnit();
|
|
188
192
|
const selectedRecord = this._parentDataUnit?.getSelectedRecord();
|
|
189
193
|
if(selectedRecord != undefined && !this.isNewRecord(selectedRecord.__record__id__)){
|
|
@@ -548,8 +552,8 @@ export default class DataUnit {
|
|
|
548
552
|
if(selection.isAllRecords()){
|
|
549
553
|
throw new Error("Exclusão remota não implementada.");
|
|
550
554
|
}
|
|
551
|
-
const records = selection?.records || [];
|
|
552
|
-
const recordIds = selection?.recordIds || [];
|
|
555
|
+
const records = selection?.records as Array<Record> || [];
|
|
556
|
+
const recordIds = selection?.recordIds as Array<string> || [];
|
|
553
557
|
return this.removeRecords(recordIds, records, buffered, undefined, silent);
|
|
554
558
|
}
|
|
555
559
|
return Promise.resolve([]);
|
|
@@ -651,13 +655,13 @@ export default class DataUnit {
|
|
|
651
655
|
*/
|
|
652
656
|
public getFormattedValue(fieldName: string, value?: any): string {
|
|
653
657
|
const descriptor = this.getField(fieldName);
|
|
654
|
-
if (value
|
|
658
|
+
if (value == undefined) {
|
|
655
659
|
value = this.getFieldValue(fieldName);
|
|
656
660
|
} else if (typeof value === "string" && descriptor?.dataType != DataType.TEXT){
|
|
657
661
|
value = this.valueFromString(fieldName, value);
|
|
658
662
|
}
|
|
659
663
|
|
|
660
|
-
if(value
|
|
664
|
+
if(value == undefined){
|
|
661
665
|
return "";
|
|
662
666
|
}
|
|
663
667
|
|
|
@@ -885,8 +889,12 @@ export default class DataUnit {
|
|
|
885
889
|
public copySelected(executionCtx?: ExecutionContext): void {
|
|
886
890
|
const selectionInfo = this.getSelectionInfo();
|
|
887
891
|
if (selectionInfo) {
|
|
888
|
-
|
|
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>;
|
|
889
896
|
if(selectedRecords){
|
|
897
|
+
|
|
890
898
|
this.dispatchAction(Action.RECORDS_COPIED, prepareCopiedRecord(this._stateManager, selectedRecords, this.getParentRecordId()), executionCtx);
|
|
891
899
|
}
|
|
892
900
|
}
|
|
@@ -1102,7 +1110,7 @@ export default class DataUnit {
|
|
|
1102
1110
|
public setSelection(selection: Array<string> | SelectionMode.ALL_RECORDS, executionCtx?: ExecutionContext): Promise<SelectionInfo> {
|
|
1103
1111
|
return new Promise(resolve => {
|
|
1104
1112
|
this.dispatchAction(Action.SELECTION_CHANGED, { type: "id", selection }, executionCtx)
|
|
1105
|
-
.then(()=>resolve(getSelectionInfo(
|
|
1113
|
+
.then(()=>resolve(this.getSelectionInfo()));
|
|
1106
1114
|
});
|
|
1107
1115
|
}
|
|
1108
1116
|
|
|
@@ -1159,8 +1167,10 @@ export default class DataUnit {
|
|
|
1159
1167
|
* @returns - Objeto com informações como registros selecionados e seleção por critério.
|
|
1160
1168
|
*
|
|
1161
1169
|
**/
|
|
1162
|
-
public getSelectionInfo(): SelectionInfo
|
|
1163
|
-
|
|
1170
|
+
public getSelectionInfo(): SelectionInfo{
|
|
1171
|
+
const selectionInfo: SelectionInfo = getSelectionInfo(this._stateManager);
|
|
1172
|
+
selectionInfo.getAllRecords = () => this.allRecordsLoader?.(this);
|
|
1173
|
+
return selectionInfo;
|
|
1164
1174
|
}
|
|
1165
1175
|
|
|
1166
1176
|
/**
|
|
@@ -1261,14 +1271,28 @@ export default class DataUnit {
|
|
|
1261
1271
|
/**
|
|
1262
1272
|
*
|
|
1263
1273
|
* Retorna se existe algum tipo de alteração pendente.
|
|
1264
|
-
*
|
|
1274
|
+
*
|
|
1275
|
+
* @param ignoreChildren: Define se deverá ignorar alterações pendentes no DataUnit filho.
|
|
1265
1276
|
* @returns Verdadeiro se existir alterações pendentes.
|
|
1266
1277
|
*
|
|
1267
1278
|
*/
|
|
1268
|
-
public isDirty(): boolean {
|
|
1279
|
+
public isDirty(ignoreChildren?: boolean): boolean {
|
|
1280
|
+
if(ignoreChildren) return isDirty(this._stateManager);
|
|
1281
|
+
|
|
1269
1282
|
return isDirty(this._stateManager) || this.childrenIsDirty();
|
|
1270
1283
|
}
|
|
1271
1284
|
|
|
1285
|
+
/**
|
|
1286
|
+
*
|
|
1287
|
+
* Retorna se existe alterações pendentes no DataUnit pai.
|
|
1288
|
+
*
|
|
1289
|
+
* @returns Verdadeiro se existir alterações pendentes e Falso caso não exista alterações ou não exista DataUnit pai.
|
|
1290
|
+
*
|
|
1291
|
+
*/
|
|
1292
|
+
public isParentDirty(): boolean {
|
|
1293
|
+
return this._parentDataUnit ? this._parentDataUnit.isDirty(true) : false;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1272
1296
|
/**
|
|
1273
1297
|
*
|
|
1274
1298
|
* Retorna se existe algum DataUnit detail com alterações pendentes.
|
|
@@ -1712,7 +1736,7 @@ export default class DataUnit {
|
|
|
1712
1736
|
}
|
|
1713
1737
|
|
|
1714
1738
|
if (selection) {
|
|
1715
|
-
return selection.records
|
|
1739
|
+
return selection.records as Array<Record>;
|
|
1716
1740
|
}
|
|
1717
1741
|
}
|
|
1718
1742
|
|
|
@@ -1730,12 +1754,15 @@ export default class DataUnit {
|
|
|
1730
1754
|
public getSelection(): Array<string> {
|
|
1731
1755
|
console.warn("DataUnit: O método `getSelection` foi descontinuado. Use o método `getSelectionInfo`.");
|
|
1732
1756
|
const selection = this.getSelectionInfo();
|
|
1757
|
+
if(selection == undefined){
|
|
1758
|
+
return [];
|
|
1759
|
+
}
|
|
1733
1760
|
|
|
1734
|
-
if(selection
|
|
1761
|
+
if(selection.isAllRecords()){
|
|
1735
1762
|
throw new Error("Erro interno: Impossível retornar os registros selecionados. A seleção atual é virtual. Use o método `getSelectionInfo`.");
|
|
1736
1763
|
}
|
|
1737
1764
|
|
|
1738
|
-
return selection?.recordIds
|
|
1765
|
+
return selection?.recordIds as Array<string>;
|
|
1739
1766
|
}
|
|
1740
1767
|
|
|
1741
1768
|
/**
|
|
@@ -1916,12 +1943,13 @@ export enum SelectionMode{
|
|
|
1916
1943
|
|
|
1917
1944
|
export class SelectionInfo{
|
|
1918
1945
|
|
|
1919
|
-
private _records: Array<Record>;
|
|
1920
1946
|
public mode: SelectionMode;
|
|
1921
|
-
private _total?: number;
|
|
1922
1947
|
public filters?: Array<Filter>;
|
|
1923
1948
|
public sort?: Array<Sort>;
|
|
1924
|
-
|
|
1949
|
+
public getAllRecords?: () => Array<Record> | undefined;
|
|
1950
|
+
private _records: Array<Record>;
|
|
1951
|
+
private _total?: number;
|
|
1952
|
+
|
|
1925
1953
|
constructor(records: Array<Record>, mode: SelectionMode = SelectionMode.SOME_RECORDS, total?:number, filters?: Array<Filter>, sort?: Array<Sort>){
|
|
1926
1954
|
this._records = records;
|
|
1927
1955
|
this._total = total;
|
|
@@ -1932,7 +1960,10 @@ export class SelectionInfo{
|
|
|
1932
1960
|
|
|
1933
1961
|
public get records(): Array<Record> | undefined{
|
|
1934
1962
|
if(this.isAllRecords()){
|
|
1935
|
-
|
|
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.");
|
|
1936
1967
|
}
|
|
1937
1968
|
return this._records;
|
|
1938
1969
|
}
|
|
@@ -1951,7 +1982,7 @@ export class SelectionInfo{
|
|
|
1951
1982
|
if(this.isAllRecords()){
|
|
1952
1983
|
return this._total || 0;
|
|
1953
1984
|
}
|
|
1954
|
-
return this.records == undefined ? 0: this.records.length;
|
|
1985
|
+
return this.records == undefined ? 0 : (this.records as Array<Record>).length;
|
|
1955
1986
|
}
|
|
1956
1987
|
|
|
1957
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
|
}
|
|
@@ -53,7 +53,7 @@ export const getFormattedValue = (value: any, descriptor?: FieldDescriptor) => {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const getNumberFormat = (value: any, descriptor: FieldDescriptor) => {
|
|
56
|
-
if(
|
|
56
|
+
if(value === undefined || value === null) return "";
|
|
57
57
|
if(descriptor.userInterface === UserInterface.INTEGERNUMBER){
|
|
58
58
|
return value;
|
|
59
59
|
}
|
|
@@ -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?:
|
|
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
|
|