@credithub/harlan-components 1.35.1 → 1.36.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credithub/harlan-components",
3
- "version": "1.35.1",
3
+ "version": "1.36.1",
4
4
  "description": "Provide a set of web components to be used in Harlan and other projects",
5
5
  "keywords": [
6
6
  "harlan",
@@ -1,9 +0,0 @@
1
- export interface ItemCalculo {
2
- quantidade?: number | null;
3
- valorTotal?: number | null;
4
- data?: string | Date;
5
- creation?: string | Date;
6
- }
7
- export declare function somarQuantidades(itens: ItemCalculo[]): number;
8
- export declare function somarValoresTotais(itens: ItemCalculo[]): number;
9
- export declare function encontrarDataMaisRecente(itens: ItemCalculo[]): string;
@@ -1,17 +0,0 @@
1
- export function somarQuantidades(itens) {
2
- return itens.reduce(function (total, item) { var _a; return total + ((_a = item.quantidade) !== null && _a !== void 0 ? _a : 0); }, 0);
3
- }
4
- export function somarValoresTotais(itens) {
5
- return itens.reduce(function (total, item) { var _a; return total + ((_a = item.valorTotal) !== null && _a !== void 0 ? _a : 0); }, 0);
6
- }
7
- export function encontrarDataMaisRecente(itens) {
8
- var maisRecente = itens.reduce(function (maisRecente, item) {
9
- var dataAtual = item.data ? new Date(item.data) : new Date(0);
10
- return dataAtual > maisRecente ? dataAtual : maisRecente;
11
- }, new Date(0));
12
- return (maisRecente.getDate().toString().padStart(2, '0') +
13
- '/' +
14
- (maisRecente.getMonth() + 1).toString().padStart(2, '0') +
15
- '/' +
16
- maisRecente.getFullYear().toString());
17
- }