@sankhyalabs/core 5.20.0-dev.5 → 5.20.0-dev.50
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/README.md +3 -1
- package/.docs/classes/ApplicationContext.md +31 -32
- package/.docs/classes/ArrayUtils.md +95 -83
- package/.docs/classes/AuthorizedServiceCaller.md +25 -34
- package/.docs/classes/Change.md +59 -74
- package/.docs/classes/DataUnit.md +1180 -1086
- package/.docs/classes/DataUnitAction.md +25 -42
- package/.docs/classes/DataUnitStorage.md +40 -43
- package/.docs/classes/DateUtils.md +140 -133
- package/.docs/classes/ElementIDUtils.md +123 -122
- package/.docs/classes/ErrorException.md +67 -88
- package/.docs/classes/ErrorTracking.md +20 -23
- package/.docs/classes/FieldComparator.md +35 -39
- package/.docs/classes/FloatingManager.md +195 -198
- package/.docs/classes/HTMLBuilder.md +14 -20
- package/.docs/classes/HttpProvider.md +45 -41
- package/.docs/classes/IDBRepository.md +201 -196
- package/.docs/classes/JSUtils.md +65 -66
- package/.docs/classes/KeyboardManager.md +95 -87
- package/.docs/classes/{MaskFormatter-1.md → MaskFormatter.md} +93 -128
- package/.docs/classes/NumberUtils.md +163 -152
- package/.docs/classes/ObjectUtils.md +206 -70
- package/.docs/classes/OnboardingUtils.md +36 -51
- package/.docs/classes/OverflowWatcher.md +533 -0
- package/.docs/classes/PromiseSync.md +25 -42
- package/.docs/classes/ReadyUtil.md +31 -41
- package/.docs/classes/RequestMetadata.md +29 -30
- package/.docs/classes/SearchUtils.md +18 -20
- package/.docs/classes/SelectionInfo.md +73 -74
- package/.docs/classes/ServiceCanceledException.md +193 -0
- package/.docs/classes/SkwHttpProvider.md +33 -45
- package/.docs/classes/StringUtils.md +297 -322
- package/.docs/classes/TimeFormatter.md +43 -44
- package/.docs/classes/UserAgentUtils.md +17 -20
- package/.docs/classes/VersionUtils.md +15 -18
- package/.docs/classes/WaitingChangeException.md +63 -84
- package/.docs/classes/WarningException.md +67 -88
- package/.docs/enumerations/Action.md +317 -0
- package/.docs/enumerations/ChangeOperation.md +47 -0
- package/.docs/enumerations/DataType.md +57 -0
- package/.docs/enumerations/DependencyType.md +37 -0
- package/.docs/enumerations/OverflowDirection.md +29 -0
- package/.docs/enumerations/SelectionMode.md +27 -0
- package/.docs/enumerations/SortMode.md +27 -0
- package/.docs/enumerations/UserInterface.md +177 -0
- package/.docs/functions/defaultDataLoader.md +25 -0
- package/.docs/{modules.md → globals.md} +27 -36
- package/.docs/interfaces/ChildDescriptor.md +12 -16
- package/.docs/interfaces/ChildLink.md +9 -12
- package/.docs/interfaces/DUActionInterceptor.md +10 -14
- package/.docs/interfaces/ExecutionContext.md +17 -32
- package/.docs/interfaces/FieldDescriptor.md +52 -66
- package/.docs/interfaces/Filter.md +13 -17
- package/.docs/interfaces/IElementIDInfo.md +11 -14
- package/.docs/interfaces/ILoadResult.md +11 -16
- package/.docs/interfaces/IRepository.md +106 -93
- package/.docs/interfaces/IRepositoryIndex.md +23 -30
- package/.docs/interfaces/LoadDataRequest.md +36 -45
- package/.docs/interfaces/LoadDataResponse.md +11 -14
- package/.docs/interfaces/OverFlowWatcherParams.md +67 -0
- package/.docs/interfaces/PageRequest.md +16 -20
- package/.docs/interfaces/PaginationInfo.md +24 -31
- package/.docs/interfaces/PromiseSyncCallback.md +13 -17
- package/.docs/interfaces/QuickFilter.md +17 -21
- package/.docs/interfaces/Record.md +26 -33
- package/.docs/interfaces/SavedRecord.md +33 -41
- package/.docs/interfaces/Sort.md +12 -16
- package/.docs/interfaces/SortingProvider.md +10 -13
- package/.docs/interfaces/UnitMetadata.md +16 -21
- package/.docs/interfaces/WaitingChange.md +16 -20
- package/.docs/namespaces/MaskFormatter/README.md +17 -0
- package/.docs/namespaces/MaskFormatter/type-aliases/MaskCharacter.md +13 -0
- package/.docs/namespaces/MaskFormatter/variables/MaskCharacter.md +13 -0
- package/.docs/type-aliases/DataUnitEventOptions.md +17 -0
- package/.docs/type-aliases/OnOverflowCallBack.md +25 -0
- package/.docs/variables/OVERFLOWED_CLASS_NAME.md +13 -0
- package/dist/dataunit/DataUnit.d.ts +67 -6
- package/dist/dataunit/DataUnit.js +151 -32
- package/dist/dataunit/DataUnit.js.map +1 -1
- package/dist/dataunit/DataUnitHelper.js +6 -5
- package/dist/dataunit/DataUnitHelper.js.map +1 -1
- package/dist/dataunit/formatting/PrettyFormatter.js +8 -6
- package/dist/dataunit/formatting/PrettyFormatter.js.map +1 -1
- package/dist/dataunit/loading/LoadDataRequest.d.ts +1 -1
- package/dist/dataunit/metadata/DataType.js +13 -1
- package/dist/dataunit/metadata/DataType.js.map +1 -1
- package/dist/dataunit/state/action/DataUnitAction.d.ts +5 -1
- package/dist/dataunit/state/action/DataUnitAction.js +4 -0
- package/dist/dataunit/state/action/DataUnitAction.js.map +1 -1
- package/dist/dataunit/state/slice/ChangesSlice.js +12 -11
- package/dist/dataunit/state/slice/ChangesSlice.js.map +1 -1
- package/dist/dataunit/state/slice/InvalidFieldsSlice.js +2 -0
- package/dist/dataunit/state/slice/InvalidFieldsSlice.js.map +1 -1
- package/dist/dataunit/state/slice/LoadingProperties.d.ts +9 -0
- package/dist/dataunit/state/slice/LoadingProperties.js +31 -0
- package/dist/dataunit/state/slice/LoadingProperties.js.map +1 -0
- package/dist/dataunit/state/slice/RecordsSlice.js +1 -1
- package/dist/dataunit/state/slice/RecordsSlice.js.map +1 -1
- package/dist/dataunit/state/slice/SelectionSlice.js +4 -4
- package/dist/dataunit/state/slice/SelectionSlice.js.map +1 -1
- package/dist/exceptions/ServiceCanceledException.d.ts +14 -0
- package/dist/exceptions/ServiceCanceledException.js +13 -0
- package/dist/exceptions/ServiceCanceledException.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +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/DateUtils.js +3 -0
- package/dist/utils/DateUtils.js.map +1 -1
- package/dist/utils/ElementUtils.d.ts +2 -0
- package/dist/utils/ElementUtils.js +9 -0
- package/dist/utils/ElementUtils.js.map +1 -0
- package/dist/utils/MaskFormatter.d.ts +2 -1
- package/dist/utils/MaskFormatter.js +5 -1
- package/dist/utils/MaskFormatter.js.map +1 -1
- package/dist/utils/ObjectUtils.d.ts +38 -0
- package/dist/utils/ObjectUtils.js +51 -0
- package/dist/utils/ObjectUtils.js.map +1 -1
- package/dist/utils/OnboardingUtils.js +1 -1
- package/dist/utils/OnboardingUtils.js.map +1 -1
- package/dist/utils/OverflowWatcher/index.d.ts +59 -0
- package/dist/utils/OverflowWatcher/index.js +188 -0
- package/dist/utils/OverflowWatcher/index.js.map +1 -0
- package/dist/utils/OverflowWatcher/types/overflow-callback.d.ts +6 -0
- package/dist/utils/OverflowWatcher/types/overflow-callback.js +2 -0
- package/dist/utils/OverflowWatcher/types/overflow-callback.js.map +1 -0
- package/dist/utils/OverflowWatcher/types/overflow-direction.d.ts +7 -0
- package/dist/utils/OverflowWatcher/types/overflow-direction.js +9 -0
- package/dist/utils/OverflowWatcher/types/overflow-direction.js.map +1 -0
- package/dist/utils/SortingUtils.d.ts +9 -0
- package/dist/utils/SortingUtils.js +24 -0
- package/dist/utils/SortingUtils.js.map +1 -0
- package/jest.config.ts +3 -1
- package/package.json +12 -4
- package/reports/test-report.xml +175 -0
- package/setupTests.js +7 -0
- package/sonar-project.properties +10 -0
- package/src/dataunit/DataUnit.ts +179 -46
- package/src/dataunit/DataUnitHelper.ts +6 -5
- package/src/dataunit/formatting/PrettyFormatter.ts +7 -6
- package/src/dataunit/loading/LoadDataRequest.ts +1 -1
- package/src/dataunit/metadata/DataType.ts +13 -1
- package/src/dataunit/state/action/DataUnitAction.ts +5 -1
- package/src/dataunit/state/slice/ChangesSlice.ts +15 -14
- package/src/dataunit/state/slice/InvalidFieldsSlice.ts +2 -0
- package/src/dataunit/state/slice/LoadingProperties.ts +37 -0
- package/src/dataunit/state/slice/RecordsSlice.ts +1 -1
- package/src/dataunit/state/slice/SelectionSlice.ts +4 -4
- package/src/dataunit/state/slice/test/RecordsSlice.spec.ts +45 -0
- package/src/dataunit/test/DataUnit.spec.ts +44 -0
- package/src/exceptions/ServiceCanceledException.ts +25 -0
- package/src/index.ts +10 -1
- package/src/repository/IRepository.ts +7 -0
- package/src/repository/indexeddb/IDBRepository.ts +4 -0
- package/src/utils/DateUtils.ts +3 -0
- package/src/utils/ElementUtils.ts +10 -0
- package/src/utils/MaskFormatter.ts +5 -1
- package/src/utils/ObjectUtils.ts +56 -0
- package/src/utils/OnboardingUtils.ts +1 -1
- package/src/utils/OverflowWatcher/index.ts +243 -0
- package/src/utils/OverflowWatcher/types/overflow-callback.ts +6 -0
- package/src/utils/OverflowWatcher/types/overflow-direction.ts +7 -0
- package/src/utils/SortingUtils.ts +30 -0
- package/src/utils/test/objectUtils.spec.ts +109 -0
- package/test/dataunit/formatting/PrettyFormatter.spec.ts +177 -0
- package/test/util/ElementUtils.spec.ts +34 -0
- package/test/util/OverflowWatcher.spec.ts +152 -0
- package/.docs/.nojekyll +0 -1
- package/.docs/enums/Action.md +0 -305
- package/.docs/enums/ChangeOperation.md +0 -52
- package/.docs/enums/DataType.md +0 -63
- package/.docs/enums/DependencyType.md +0 -41
- package/.docs/enums/SelectionMode.md +0 -30
- package/.docs/enums/SortMode.md +0 -30
- package/.docs/enums/UserInterface.md +0 -195
- package/.docs/modules/MaskFormatter.md +0 -37
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { JSUtils } from "../JSUtils.js";
|
|
2
|
+
import { OverflowDirection } from "./types/overflow-direction.js";
|
|
3
|
+
import { calcMarginSize } from '../ElementUtils.js';
|
|
4
|
+
export * from "./types/overflow-direction.js";
|
|
5
|
+
export * from "./types/overflow-callback.js";
|
|
6
|
+
export const OVERFLOWED_CLASS_NAME = 'overflowed';
|
|
7
|
+
export default class OverflowWatcher {
|
|
8
|
+
/**
|
|
9
|
+
* Cria uma instancia do OverflowWatcher
|
|
10
|
+
*
|
|
11
|
+
* @param element - Elemento HTML que o overflow será observado.
|
|
12
|
+
* @param callback - Função que sera chamada quando ocorrer overflow no elemento.
|
|
13
|
+
* @param overFlowDirection - Indica direção que o overflow será monitorado.
|
|
14
|
+
* @param deltaSize - Variação de tamanho que será considerada como overflow.
|
|
15
|
+
* @param debounce - Tempo até execução do callback em milissegundos.
|
|
16
|
+
* @param notOverFlow - Lista de ids ou data-element-ids dos elementos que não devem sofrer overFlow.
|
|
17
|
+
*/
|
|
18
|
+
constructor({ element, callback, overFlowDirection = OverflowDirection.HORIZONTAL, debounce = 200, deltaSize = 0, notOverFlow = [] }) {
|
|
19
|
+
this._lastContainerSize = undefined;
|
|
20
|
+
this._lastContainerInstance = undefined;
|
|
21
|
+
this._scrollDirection = OverflowDirection.HORIZONTAL;
|
|
22
|
+
this._hiddenItemsProps = new Map();
|
|
23
|
+
this._notOverFlowPros = new Map();
|
|
24
|
+
this._notOverFlow = [];
|
|
25
|
+
this.DATA_ELEMENT_ID = 'data-element-id';
|
|
26
|
+
this._onResize = callback;
|
|
27
|
+
this._scrollDirection = overFlowDirection;
|
|
28
|
+
this._propSize = (OverflowDirection.HORIZONTAL === overFlowDirection) ? "width" : "height";
|
|
29
|
+
this._resizeObserver = new ResizeObserver(JSUtils.debounce((entries) => this.handleResize(entries), debounce));
|
|
30
|
+
this._resizeObserver.observe(element);
|
|
31
|
+
this._deltaSize = deltaSize;
|
|
32
|
+
this._notOverFlow = notOverFlow;
|
|
33
|
+
}
|
|
34
|
+
addNotOverFlowElement(elementId) {
|
|
35
|
+
if (!this._notOverFlow.includes(elementId)) {
|
|
36
|
+
this._notOverFlow.push(elementId);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
destroy() {
|
|
40
|
+
this._resizeObserver.disconnect();
|
|
41
|
+
}
|
|
42
|
+
forceUpdate() {
|
|
43
|
+
if (this._lastContainerSize && this._lastContainerInstance) {
|
|
44
|
+
this.updateOverFlowedItems(this._lastContainerInstance, this._lastContainerSize);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
handleResize(entries) {
|
|
48
|
+
if (!entries || entries.length === 0)
|
|
49
|
+
return;
|
|
50
|
+
const container = entries[0];
|
|
51
|
+
const containerSize = container.contentRect[this._propSize];
|
|
52
|
+
if (!containerSize)
|
|
53
|
+
return;
|
|
54
|
+
if (this.hasChangedSize(containerSize)) {
|
|
55
|
+
this.updateOverFlowedItems(container.target, containerSize);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
updateOverFlowedItems(container, containerSize) {
|
|
59
|
+
const children = Array.from(container.children);
|
|
60
|
+
this.registerNotOverflowProps(children);
|
|
61
|
+
this.proccessElements(containerSize, children);
|
|
62
|
+
this._lastContainerSize = containerSize;
|
|
63
|
+
this._lastContainerInstance = container;
|
|
64
|
+
}
|
|
65
|
+
registerNotOverflowProps(children) {
|
|
66
|
+
children.forEach(childElement => {
|
|
67
|
+
const id = childElement.id || this.getDataElementId(childElement);
|
|
68
|
+
if (this.canNotRegisterNotOverFlow(id))
|
|
69
|
+
return;
|
|
70
|
+
this._notOverFlowPros.set(id, this.getElementSizeProps(childElement));
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
canNotRegisterNotOverFlow(id) {
|
|
74
|
+
return !id || !this._notOverFlow.includes(id) || this._notOverFlowPros.has(id);
|
|
75
|
+
}
|
|
76
|
+
hasChangedSize(elementSize) {
|
|
77
|
+
if (!this._lastContainerSize)
|
|
78
|
+
return true;
|
|
79
|
+
const variation = elementSize - this._lastContainerSize;
|
|
80
|
+
if (variation < 0) {
|
|
81
|
+
const absoluteVariation = Math.abs(variation);
|
|
82
|
+
return (absoluteVariation > this._deltaSize);
|
|
83
|
+
}
|
|
84
|
+
return variation > 0;
|
|
85
|
+
}
|
|
86
|
+
proccessElements(elementSize, children) {
|
|
87
|
+
if (children.length === 0)
|
|
88
|
+
return;
|
|
89
|
+
const childrenSize = this.calcChildrenSize(children);
|
|
90
|
+
let diff = Number((elementSize - childrenSize).toFixed(4));
|
|
91
|
+
if (diff > 0) {
|
|
92
|
+
this.clearOverFlow();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this.proccessElementsOverFlow(children, elementSize);
|
|
96
|
+
}
|
|
97
|
+
clearOverFlow() {
|
|
98
|
+
this._hiddenItemsProps = new Map();
|
|
99
|
+
this._onResize([]);
|
|
100
|
+
}
|
|
101
|
+
proccessElementsOverFlow(allElements, avaliableSize) {
|
|
102
|
+
const elementsThatFit = [];
|
|
103
|
+
const avaliableSizeConsideringDelta = (avaliableSize - this._deltaSize);
|
|
104
|
+
let sumElementsSize = 0;
|
|
105
|
+
for (const element of allElements) {
|
|
106
|
+
sumElementsSize += this.calcElementSize(element);
|
|
107
|
+
if (this.exceedsAvaliableSize(sumElementsSize, elementsThatFit, avaliableSizeConsideringDelta))
|
|
108
|
+
break;
|
|
109
|
+
elementsThatFit.push(element);
|
|
110
|
+
}
|
|
111
|
+
const overFlowedElements = allElements.filter(element => this.isElementOverFlowing(elementsThatFit, element));
|
|
112
|
+
overFlowedElements.forEach(overFlowed => {
|
|
113
|
+
if (!this._hiddenItemsProps.has(overFlowed)) {
|
|
114
|
+
this.registerElementSize(overFlowed);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
this._onResize(overFlowedElements);
|
|
118
|
+
}
|
|
119
|
+
isElementOverFlowing(elementsThatFit, element) {
|
|
120
|
+
return !elementsThatFit.includes(element) && this.canOverFlowElement(element);
|
|
121
|
+
}
|
|
122
|
+
canOverFlowElement(element) {
|
|
123
|
+
return !this._notOverFlow.includes(element.id)
|
|
124
|
+
&& !this._notOverFlow.includes(this.getDataElementId(element));
|
|
125
|
+
}
|
|
126
|
+
getDataElementId(element) {
|
|
127
|
+
var _a;
|
|
128
|
+
return (_a = element.getAttribute('data-element-id')) !== null && _a !== void 0 ? _a : "";
|
|
129
|
+
}
|
|
130
|
+
exceedsAvaliableSize(sumElementsSize, elements, avaliableSize) {
|
|
131
|
+
if (!this._notOverFlow.length)
|
|
132
|
+
return sumElementsSize > avaliableSize;
|
|
133
|
+
const elementIdsToCalculate = this.canNotOverFlowNotIncludedIds(elements);
|
|
134
|
+
if (!elementIdsToCalculate.length)
|
|
135
|
+
return sumElementsSize > avaliableSize;
|
|
136
|
+
const variation = this.calculateVariation(elementIdsToCalculate);
|
|
137
|
+
const occupiedSize = sumElementsSize + variation;
|
|
138
|
+
return occupiedSize > avaliableSize;
|
|
139
|
+
}
|
|
140
|
+
calculateVariation(elementIdsToCalculate) {
|
|
141
|
+
let variation = 0;
|
|
142
|
+
elementIdsToCalculate.forEach(id => {
|
|
143
|
+
var _a, _b;
|
|
144
|
+
const sizeProps = this._notOverFlowPros.get(id);
|
|
145
|
+
variation += (_a = sizeProps === null || sizeProps === void 0 ? void 0 : sizeProps.size) !== null && _a !== void 0 ? _a : 0;
|
|
146
|
+
variation += (_b = sizeProps === null || sizeProps === void 0 ? void 0 : sizeProps.margin) !== null && _b !== void 0 ? _b : 0;
|
|
147
|
+
});
|
|
148
|
+
return variation;
|
|
149
|
+
}
|
|
150
|
+
canNotOverFlowNotIncludedIds(elements) {
|
|
151
|
+
const elementsIdList = elements.map(el => el.id || this.getDataElementId(el)).filter(id => !!id);
|
|
152
|
+
return this._notOverFlow.filter(id => !elementsIdList.includes(id));
|
|
153
|
+
}
|
|
154
|
+
registerElementSize(element) {
|
|
155
|
+
const sizeProps = this.getElementSizeProps(element);
|
|
156
|
+
this._hiddenItemsProps.set(element, sizeProps);
|
|
157
|
+
}
|
|
158
|
+
getElementSizeProps(element) {
|
|
159
|
+
const sizeProps = {
|
|
160
|
+
size: element.getBoundingClientRect()[this._propSize],
|
|
161
|
+
margin: calcMarginSize(element, this._scrollDirection),
|
|
162
|
+
};
|
|
163
|
+
return sizeProps;
|
|
164
|
+
}
|
|
165
|
+
calcChildrenSize(children) {
|
|
166
|
+
let sumChildren = 0;
|
|
167
|
+
sumChildren += this._deltaSize;
|
|
168
|
+
Array.from(children).forEach(el => sumChildren += this.calcElementSize(el));
|
|
169
|
+
return sumChildren;
|
|
170
|
+
}
|
|
171
|
+
calcElementSize(el) {
|
|
172
|
+
var _a, _b;
|
|
173
|
+
let size = 0;
|
|
174
|
+
if (this.isOverFlowed(el)) {
|
|
175
|
+
const sizeProps = this._hiddenItemsProps.get(el);
|
|
176
|
+
size += (_a = sizeProps === null || sizeProps === void 0 ? void 0 : sizeProps.size) !== null && _a !== void 0 ? _a : 0;
|
|
177
|
+
size += (_b = sizeProps === null || sizeProps === void 0 ? void 0 : sizeProps.margin) !== null && _b !== void 0 ? _b : 0;
|
|
178
|
+
return size;
|
|
179
|
+
}
|
|
180
|
+
size += el.getBoundingClientRect()[this._propSize];
|
|
181
|
+
size += calcMarginSize(el, this._scrollDirection);
|
|
182
|
+
return size;
|
|
183
|
+
}
|
|
184
|
+
isOverFlowed(el) {
|
|
185
|
+
return el.classList.contains(OVERFLOWED_CLASS_NAME);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/OverflowWatcher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAE7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAElD,MAAM,CAAC,OAAO,OAAO,eAAe;IAchC;;;;;;;;;OASG;IACH,YAAY,EACI,OAAO,EACP,QAAQ,EACR,iBAAiB,GAAG,iBAAiB,CAAC,UAAU,EAChD,QAAQ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,CAAC,CAAC;QAC5D,IAAI,IAAI,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEO,YAAY,CAAC,EAAW;QAC5B,OAAO,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IACxD,CAAC;CACJ"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Callback que será chamado quando o overflow de um elemento for alterado.
|
|
3
|
+
*
|
|
4
|
+
* @param elementsOverFlow - Conjunto de elementos filhos que estão causando overflow no elemento pai.
|
|
5
|
+
*/
|
|
6
|
+
export type OnOverflowCallBack = (elementsOverFlow: Array<Element>) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overflow-callback.js","sourceRoot":"","sources":["../../../../src/utils/OverflowWatcher/types/overflow-callback.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Define em qual direção o overflow será observado
|
|
3
|
+
*/
|
|
4
|
+
export var OverflowDirection;
|
|
5
|
+
(function (OverflowDirection) {
|
|
6
|
+
OverflowDirection[OverflowDirection["VERTICAL"] = 0] = "VERTICAL";
|
|
7
|
+
OverflowDirection[OverflowDirection["HORIZONTAL"] = 1] = "HORIZONTAL";
|
|
8
|
+
})(OverflowDirection || (OverflowDirection = {}));
|
|
9
|
+
//# sourceMappingURL=overflow-direction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overflow-direction.js","sourceRoot":"","sources":["../../../../src/utils/OverflowWatcher/types/overflow-direction.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IACzB,iEAAU,CAAA;IACV,qEAAY,CAAA;AAChB,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import DataUnit from "../dataunit/DataUnit.js";
|
|
2
|
+
import { Sort } from "../dataunit/metadata/UnitMetadata.js";
|
|
3
|
+
import { Record } from '../dataunit/DataUnit.js';
|
|
4
|
+
/**
|
|
5
|
+
* `SortingUtils`: Utilizado para auxiliar na ordenacao de registros.
|
|
6
|
+
*/
|
|
7
|
+
export default class SortingUtils {
|
|
8
|
+
static getSortingFunction(dataUnit: DataUnit, sorting?: Array<Sort>): ((recordA: Record, recordB: Record) => number) | undefined;
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SortMode } from "../dataunit/metadata/UnitMetadata.js";
|
|
2
|
+
import { FieldComparator } from "../dataunit/sorting/FieldComparator.js";
|
|
3
|
+
/**
|
|
4
|
+
* `SortingUtils`: Utilizado para auxiliar na ordenacao de registros.
|
|
5
|
+
*/
|
|
6
|
+
export default class SortingUtils {
|
|
7
|
+
static getSortingFunction(dataUnit, sorting) {
|
|
8
|
+
if (sorting == undefined || sorting.length == 0) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return (recordA, recordB) => {
|
|
12
|
+
for (const sort of sorting) {
|
|
13
|
+
if (sort.field) {
|
|
14
|
+
const result = FieldComparator.compare(dataUnit.getField(sort.field), recordA, recordB, sort.mode === SortMode.ASC);
|
|
15
|
+
if (result != 0) {
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return 0;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=SortingUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SortingUtils.js","sourceRoot":"","sources":["../../src/utils/SortingUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAGzE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAEtB,MAAM,CAAC,kBAAkB,CAAC,QAAkB,EAAE,OAAqB;QAEtE,IAAI,OAAO,IAAI,SAAS,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE;YAC7C,OAAO,SAAS,CAAC;SACpB;QAED,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;YACxB,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;gBACxB,IAAI,IAAI,CAAC,KAAK,EAAC;oBACX,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAoB,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,GAAG,CAAC,CAAC;oBACvI,IAAI,MAAM,IAAI,CAAC,EAAE;wBACb,OAAO,MAAM,CAAC;qBACjB;iBACJ;aACJ;YACD,OAAO,CAAC,CAAC;QACb,CAAC,CAAC;IACN,CAAC;CAEJ"}
|
package/jest.config.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
preset: 'ts-jest',
|
|
3
|
+
setupFiles: ['./setupTests.js'],
|
|
2
4
|
transform: {'^.+\\.ts?$': 'ts-jest'},
|
|
3
5
|
testEnvironment: 'jsdom',
|
|
4
6
|
testRegex: '\\.(test|spec)?\\.(ts|tsx)$',
|
|
5
|
-
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
7
|
+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
6
8
|
coverageThreshold: {
|
|
7
9
|
"global": {
|
|
8
10
|
"branches": 10,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sankhyalabs/core",
|
|
3
|
-
"version": "5.20.0-dev.
|
|
3
|
+
"version": "5.20.0-dev.50",
|
|
4
4
|
"description": "Modulo core JavaScript da Sankhya.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build": "tsc",
|
|
11
11
|
"build:watch": "tsc --watch",
|
|
12
12
|
"compile": "tsc",
|
|
13
|
-
"test": "jest",
|
|
13
|
+
"test": "jest --coverage --silent --testResultsProcessor jest-sonar-reporter",
|
|
14
14
|
"coverage": "jest --coverage",
|
|
15
15
|
"serve": "es-dev-server --node-resolve --watch",
|
|
16
16
|
"eslint": "eslint src/**",
|
|
@@ -44,10 +44,18 @@
|
|
|
44
44
|
"husky": "^8.0.3",
|
|
45
45
|
"jest": "^29.4.1",
|
|
46
46
|
"jest-environment-jsdom": "^29.4.1",
|
|
47
|
+
"jest-sonar-reporter": "^2.0.0",
|
|
48
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
47
49
|
"ts-jest": "^29.0.5",
|
|
48
50
|
"ts-node": "^10.9.1",
|
|
49
|
-
"typedoc": "^0.
|
|
50
|
-
"typedoc-plugin-markdown": "^
|
|
51
|
+
"typedoc": "^0.25.13",
|
|
52
|
+
"typedoc-plugin-markdown": "^4.0.1",
|
|
51
53
|
"typescript": "^4.9.5"
|
|
54
|
+
},
|
|
55
|
+
"jestSonar": {
|
|
56
|
+
"sonar56x": true,
|
|
57
|
+
"reportPath": "reports",
|
|
58
|
+
"reportFile": "test-report.xml",
|
|
59
|
+
"indent": 4
|
|
52
60
|
}
|
|
53
61
|
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
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="84"/>
|
|
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="0"/>
|
|
7
|
+
<testCase name="StringUtils it should return a Criteria class with "expression" and "parameters" as needed setted through "append" method" duration="2"/>
|
|
8
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "append" method" duration="1"/>
|
|
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="2"/>
|
|
14
|
+
<testCase name="StringUtils it should return a Criteria class with "Criteria class" and "parameters" concatenaded as needed setted through "AND" method" duration="1"/>
|
|
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="0"/>
|
|
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/src/utils/test/objectUtils.spec.ts">
|
|
20
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects have the same property value" duration="6"/>
|
|
21
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects have different property values" duration="1"/>
|
|
22
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true if both objects are equivalent with custom property to compare" duration="1"/>
|
|
23
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if both objects are not equivalent with custom property to compare" duration="0"/>
|
|
24
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if one object does not have the property" duration="0"/>
|
|
25
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true if comparing primitive values directly" duration="0"/>
|
|
26
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false if comparing different primitive values" duration="1"/>
|
|
27
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing object with a null value" duration="1"/>
|
|
28
|
+
<testCase name="ObjectUtils hasEquivalentValues should return false when comparing object with null and non-null value" duration="1"/>
|
|
29
|
+
<testCase name="ObjectUtils hasEquivalentValues should return true when comparing non-object values that are equal" duration="0"/>
|
|
30
|
+
<testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
|
|
31
|
+
<testCase name="ObjectUtils should get an object value based on its path" duration="0"/>
|
|
32
|
+
<testCase name="ObjectUtils should return undefined if the path doesn't exist in the object" duration="0"/>
|
|
33
|
+
</file>
|
|
34
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/MaskFormatter.spec.ts">
|
|
35
|
+
<testCase name="Mask Formatter mask:CPF complete valid" duration="8"/>
|
|
36
|
+
<testCase name="Mask Formatter mask:CPF complete valid literals" duration="1"/>
|
|
37
|
+
<testCase name="Mask Formatter mask:CPF incomplete valid" duration="0"/>
|
|
38
|
+
<testCase name="Mask Formatter mask:CPF incomplete valid placeholder" duration="0"/>
|
|
39
|
+
<testCase name="Mask Formatter mask:CPF too long valid" duration="1"/>
|
|
40
|
+
<testCase name="Mask Formatter mask:CPF invalid for string" duration="196"/>
|
|
41
|
+
<testCase name="Mask Formatter mask:CPF invalid for being too long" duration="1"/>
|
|
42
|
+
<testCase name="Mask Formatter mask:Licence plate valid uppercase" duration="1"/>
|
|
43
|
+
<testCase name="Mask Formatter mask:Licence plate valid lowercase" duration="1"/>
|
|
44
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
|
|
45
|
+
<testCase name="Mask Formatter mask:Licence plate invalid for being too short" duration="0"/>
|
|
46
|
+
<testCase name="Mask Formatter mask:Licence plate invalid for being too short with placeholder" duration="1"/>
|
|
47
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
48
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
|
|
49
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
|
|
50
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="2"/>
|
|
51
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="1"/>
|
|
52
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="1"/>
|
|
53
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
54
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask" duration="0"/>
|
|
55
|
+
<testCase name="Mask Formatter mask:Licence plate with AlphaNumerical Mask with placeholder" duration="0"/>
|
|
56
|
+
<testCase name="Mask Formatter mask:Licence plate invalid" duration="1"/>
|
|
57
|
+
</file>
|
|
58
|
+
<file path="/builds/dti/design-system/sankhyacore/test/http/HttpProvider.spec.ts">
|
|
59
|
+
<testCase name="HttpProvider Metodo GET" duration="1"/>
|
|
60
|
+
</file>
|
|
61
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/StringUtils.spec.ts">
|
|
62
|
+
<testCase name="StringUtils valor vazio" duration="1"/>
|
|
63
|
+
<testCase name="StringUtils valor em branco" duration="1"/>
|
|
64
|
+
<testCase name="StringUtils valor null" duration="0"/>
|
|
65
|
+
<testCase name="StringUtils valor undefined" duration="0"/>
|
|
66
|
+
<testCase name="StringUtils valor 0" duration="0"/>
|
|
67
|
+
<testCase name="StringUtils com valor" duration="0"/>
|
|
68
|
+
<testCase name="StringUtils substitui vogais com acento por vogais sem acento" duration="2"/>
|
|
69
|
+
<testCase name="StringUtils should return the original value when called with an object without a toString method" duration="8"/>
|
|
70
|
+
<testCase name="StringUtils should return the original value when called with undefined" duration="1"/>
|
|
71
|
+
</file>
|
|
72
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/NumberUtils.spec.ts">
|
|
73
|
+
<testCase name="StringUtils stringToNumber" duration="193"/>
|
|
74
|
+
<testCase name="StringUtils format" duration="102"/>
|
|
75
|
+
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
76
|
+
<testCase name="StringUtils format without formatnumber parameter" duration="1"/>
|
|
77
|
+
<testCase name="StringUtils format round number" duration="2"/>
|
|
78
|
+
</file>
|
|
79
|
+
<file path="/builds/dti/design-system/sankhyacore/test/http/SkwHttpProvider.ts.spec.ts">
|
|
80
|
+
<testCase name="HttpProvider Metodo POST" duration="0"/>
|
|
81
|
+
</file>
|
|
82
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/CriteriaParameter.spec.ts">
|
|
83
|
+
<testCase name="StringUtils it should return the correct values of "value" and "type" through the getters methods initial setted by the constructor" duration="1"/>
|
|
84
|
+
<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"/>
|
|
85
|
+
<testCase name="StringUtils it should return the correct JSON/Object value through the buildParam method" duration="0"/>
|
|
86
|
+
</file>
|
|
87
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/OverflowWatcher.spec.ts">
|
|
88
|
+
<testCase name="OverflowWatcher should initialize with provided parameters" duration="84"/>
|
|
89
|
+
<testCase name="OverflowWatcher should disconect ResizeObserver when destroy is called" duration="3"/>
|
|
90
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate" duration="211"/>
|
|
91
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan" duration="97"/>
|
|
92
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan when notOverFlow is empty" duration="89"/>
|
|
93
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with childSpan considering overflowed elements" duration="9"/>
|
|
94
|
+
<testCase name="OverflowWatcher Should call callback on forceUpdate with empty list" duration="4"/>
|
|
95
|
+
<testCase name="OverflowWatcher should ignore elements that can not overflow" duration="187"/>
|
|
96
|
+
<testCase name="OverflowWatcher Should not call callback on forceUpdate" duration="1"/>
|
|
97
|
+
</file>
|
|
98
|
+
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/state/slice/test/RecordsSlice.spec.ts">
|
|
99
|
+
<testCase name="RecordsSlice should return newlines at the end" duration="2"/>
|
|
100
|
+
</file>
|
|
101
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/TimeFormatter.spec.ts">
|
|
102
|
+
<testCase name="TimeFormatter Case: input string unformated with showSeconds" duration="2"/>
|
|
103
|
+
<testCase name="TimeFormatter Case: input string unformated without showSeconds" duration="0"/>
|
|
104
|
+
<testCase name="TimeFormatter Case: validateTime" duration="1"/>
|
|
105
|
+
</file>
|
|
106
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/DataUnitStorage.spec.ts">
|
|
107
|
+
<testCase name="DataUnitStorage put should store a DataUnit instance in the DataUnitStorage" duration="2"/>
|
|
108
|
+
<testCase name="DataUnitStorage get should return the stored DataUnit instance from the DataUnitStorage" duration="0"/>
|
|
109
|
+
<testCase name="DataUnitStorage get should return undefined if the DataUnit instance is not found in the DataUnitStorage" duration="1"/>
|
|
110
|
+
<testCase name="DataUnitStorage remove should remove the specified DataUnit instance from the DataUnitStorage" duration="0"/>
|
|
111
|
+
<testCase name="DataUnitStorage remove should remove the DataUnit instance with the specified name from the DataUnitStorage" duration="1"/>
|
|
112
|
+
<testCase name="DataUnitStorage remove should not remove any DataUnit instance if the specified DataUnit instance or name is not found in the DataUnitStorage" duration="0"/>
|
|
113
|
+
</file>
|
|
114
|
+
<file path="/builds/dti/design-system/sankhyacore/src/dataunit/test/DataUnit.spec.ts">
|
|
115
|
+
<testCase name="DataUnit should return false when not waiting to reload" duration="3"/>
|
|
116
|
+
<testCase name="DataUnit should set waitingToReload to true" duration="1"/>
|
|
117
|
+
<testCase name="DataUnit should set waitingToReload to false" duration="0"/>
|
|
118
|
+
<testCase name="DataUnit should dispatch SAVING_CANCELED action with correct fields and recordId" duration="2"/>
|
|
119
|
+
</file>
|
|
120
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementIDUtils.spec.ts">
|
|
121
|
+
<testCase name="addIDInfo 1 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="11"/>
|
|
122
|
+
<testCase name="addIDInfo 2 - should add data-element-id with valid id "brComSankhyaFinCadMovimentacaofinanceira_snkApplication"" duration="2"/>
|
|
123
|
+
<testCase name="addIDInfo 3 - should add data-element-id with valid id "movFinanceira_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="1"/>
|
|
124
|
+
<testCase name="addIDInfo 4 - should add data-element-id with valid id "meuID2_snkApplication"" duration="74"/>
|
|
125
|
+
<testCase name="addIDInfo 5 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="2"/>
|
|
126
|
+
<testCase name="addIDInfo 6 - should add data-element-id with valid id "movFinanceira_snkApplication"" duration="1"/>
|
|
127
|
+
<testCase name="addIDInfo 7 - should add data-element-id with valid id "componenteNameTest_snkApplication"" duration="1"/>
|
|
128
|
+
<testCase name="addIDInfo 8 - should add data-element-id with valid id "componentLabel_snkApplication"" duration="1"/>
|
|
129
|
+
<testCase name="addIDInfo 9 - should add data-element-id with valid id "dataunitFinanceiro_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="2"/>
|
|
130
|
+
<testCase name="addIDInfo 10 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_br.com.sankhya.fin.cad.movimentacaoFinanceira"" duration="1"/>
|
|
131
|
+
<testCase name="addIDInfo 11 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="1"/>
|
|
132
|
+
<testCase name="addIDInfo 12 - should add data-element-id with valid id "dataunitFinanceiro_movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
133
|
+
<testCase name="addIDInfo 13 - should add data-element-id with valid id "dataunitFinanceiro_meuIDTeste_movimentacaoFinanceira"" duration="5"/>
|
|
134
|
+
<testCase name="addIDInfo 14 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_movimentacaoFinanceira"" duration="2"/>
|
|
135
|
+
<testCase name="addIDInfo 15 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="1"/>
|
|
136
|
+
<testCase name="addIDInfo 16 - should add data-element-id with valid id "dataunitFinanceiro_meuIdTeste_snkApplication"" duration="1"/>
|
|
137
|
+
<testCase name="addIDInfo 17 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
138
|
+
<testCase name="addIDInfo 18 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
139
|
+
<testCase name="addIDInfo 19 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="3"/>
|
|
140
|
+
<testCase name="addIDInfo 20 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
141
|
+
<testCase name="addIDInfo 21 - should add data-element-id with valid id "movFinanceira_movimentacaoFinanceira"" duration="1"/>
|
|
142
|
+
<testCase name="addIDInfo 22 - should add data-element-id with valid id "bancoObrigatorio_movimentacaoFinanceira"" duration="1"/>
|
|
143
|
+
</file>
|
|
144
|
+
<file path="/builds/dti/design-system/sankhyacore/test/dataunit/formatting/PrettyFormatter.spec.ts">
|
|
145
|
+
<testCase name="getFormattedValue should return empty string when value is null" duration="5"/>
|
|
146
|
+
<testCase name="getFormattedValue should return empty string when value is not an array" duration="0"/>
|
|
147
|
+
<testCase name="getFormattedValue should return empty string when value is an empty array" duration="0"/>
|
|
148
|
+
<testCase name="getFormattedValue should return file name when value is an array with one file object" duration="1"/>
|
|
149
|
+
<testCase name="getFormattedValue should return file count when value is an array with multiple file objects" duration="0"/>
|
|
150
|
+
<testCase name="getFormattedValue should return empty string for undefined file" duration="0"/>
|
|
151
|
+
<testCase name="getFormattedValue should handle OBJECT type with value field" duration="1"/>
|
|
152
|
+
<testCase name="getFormattedValue should return empty string when value is undefined" duration="0"/>
|
|
153
|
+
<testCase name="getFormattedValue should return value as string when value is not an object" duration="0"/>
|
|
154
|
+
<testCase name="getFormattedValue should return value.toString() when value is an object without value property" duration="0"/>
|
|
155
|
+
<testCase name="getFormattedValue should handle BOOLEAN type" duration="0"/>
|
|
156
|
+
<testCase name="getFormattedValue should format numbers correctly" duration="10"/>
|
|
157
|
+
<testCase name="getFormattedValue should format dates correctly" duration="5"/>
|
|
158
|
+
<testCase name="getFormattedValue should format times correctly" duration="0"/>
|
|
159
|
+
<testCase name="getFormattedValue should format datetime correctly" duration="1"/>
|
|
160
|
+
<testCase name="getFormattedValue should call toString with correct parameters" duration="1"/>
|
|
161
|
+
<testCase name="getFormattedValue should handle undefined descriptor gracefully" duration="0"/>
|
|
162
|
+
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and matching option" duration="0"/>
|
|
163
|
+
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and no matching option" duration="1"/>
|
|
164
|
+
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and value as object" duration="0"/>
|
|
165
|
+
<testCase name="getFormattedValue should return empty string with OPTIONSELECTOR and value as null" duration="0"/>
|
|
166
|
+
<testCase name="getFormattedValue should format value correctly with OPTIONSELECTOR and options as JSON string" duration="0"/>
|
|
167
|
+
<testCase name="getFormattedValue should return value with OPTIONSELECTOR and options as empty array" duration="0"/>
|
|
168
|
+
<testCase name="getFormattedValue should format masked values correctly" duration="1"/>
|
|
169
|
+
</file>
|
|
170
|
+
<file path="/builds/dti/design-system/sankhyacore/test/util/ElementUtils.spec.ts">
|
|
171
|
+
<testCase name="calcMarginSize should calculate correctly the size of horizontal margin" duration="65"/>
|
|
172
|
+
<testCase name="calcMarginSize should calculate correctly the size of vertical margin" duration="2"/>
|
|
173
|
+
<testCase name="calcMarginSize should threat values defined as zero" duration="3"/>
|
|
174
|
+
</file>
|
|
175
|
+
</unitTest>
|
package/setupTests.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
sonar.testExecutionReportPaths=./reports/test-report.xml
|
|
2
|
+
sonar.typescript.lcov.reportPaths=./coverage/lcov.info
|
|
3
|
+
sonar.test.inclusions=coverage/**,**/test/*.e2e.ts,**/test/*.spec.ts,**/test/*.spec.tsx,**/utils/*.spec.ts,**/test/**/*.ts
|
|
4
|
+
sonar.tests=test
|
|
5
|
+
sonar.sourceEncoding=UTF-8
|
|
6
|
+
sonar.c.file.suffixes=-
|
|
7
|
+
sonar.cpp.file.suffixes=-
|
|
8
|
+
sonar.objc.file.suffixes=-
|
|
9
|
+
sonar.qualitygate.wait=true
|
|
10
|
+
sonar.host.url=http://sonarqube.sankhya.com.br
|