sim-node-lib 0.0.95 → 0.0.96

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.
@@ -1,9 +1,9 @@
1
- export default class AtributoEntradaUtil {
2
- static getTextoByProduto(operacao: string, produtos: any[]): Promise<string>;
3
- static getTextoByAgrupadorEmpresa(operacao: string, agrupadores: any[]): Promise<string>;
4
- static getTextoByEmpresa(operacao: string, empresas: any[]): Promise<string>;
5
- static getTextoByTag(operacao: string, tags: any[]): Promise<string>;
6
- static getTextoByFormaPagamento(operacao: string, formasPagamento: any[]): Promise<string>;
7
- static getTextoOperacao(operacao: string): Promise<string>;
8
- static getHTMLPill(color: string, texto: string): Promise<string>;
1
+ export default class HtmlBadgerHelper {
2
+ static getTextoByProduto(operacao: string, produtos: any[]): string;
3
+ static getTextoByAgrupadorEmpresa(operacao: string, agrupadores: any[]): string;
4
+ static getTextoByEmpresa(operacao: string, empresas: any[]): string;
5
+ static getTextoByTag(operacao: string, tags: any[]): string;
6
+ static getTextoByFormaPagamento(operacao: string, formasPagamento: any[]): string;
7
+ static getTextoOperacao(operacao: string): string;
8
+ static getHTMLPill(color: string, texto: string): string;
9
9
  }
@@ -1,100 +1,77 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
- class AtributoEntradaUtil {
3
+ class HtmlBadgerHelper {
13
4
  static getTextoByProduto(operacao, produtos) {
14
- return __awaiter(this, void 0, void 0, function* () {
15
- operacao = yield this.getTextoOperacao(operacao);
16
- let descriptionList = [];
17
- if (produtos.length > 0) {
18
- for (let produto of produtos) {
19
- descriptionList.push(produto.descricao);
20
- }
5
+ operacao = this.getTextoOperacao(operacao);
6
+ let descriptionList = [];
7
+ if (produtos.length > 0) {
8
+ for (let produto of produtos) {
9
+ descriptionList.push(produto.descricao);
21
10
  }
22
- else
23
- descriptionList.push('TODOS');
24
- return this.getHTMLPill('badge-primary', `Produto ${operacao} ${descriptionList.join(', ')}`);
25
- });
11
+ }
12
+ else
13
+ descriptionList.push('TODOS');
14
+ return this.getHTMLPill('badge-primary', `Produto ${operacao} ${descriptionList.join(', ')}`);
26
15
  }
27
16
  static getTextoByAgrupadorEmpresa(operacao, agrupadores) {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- operacao = yield this.getTextoOperacao(operacao);
30
- let descriptionList = [];
31
- for (let agrupador of agrupadores) {
32
- descriptionList.push(agrupador.descricao);
33
- }
34
- return this.getHTMLPill('badge-warning', `Agrupador de Empresa ${operacao} ${descriptionList.join(', ')}`);
35
- });
17
+ operacao = this.getTextoOperacao(operacao);
18
+ let descriptionList = [];
19
+ for (let agrupador of agrupadores) {
20
+ descriptionList.push(agrupador.descricao);
21
+ }
22
+ return this.getHTMLPill('badge-warning', `Agrupador de Empresa ${operacao} ${descriptionList.join(', ')}`);
36
23
  }
37
24
  static getTextoByEmpresa(operacao, empresas) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- operacao = yield this.getTextoOperacao(operacao);
40
- let descriptionList = [];
41
- if (empresas.length > 0) {
42
- for (let empresa of empresas) {
43
- descriptionList.push(empresa.nom_empresa);
44
- }
25
+ operacao = this.getTextoOperacao(operacao);
26
+ let descriptionList = [];
27
+ if (empresas.length > 0) {
28
+ for (let empresa of empresas) {
29
+ descriptionList.push(empresa.nom_empresa);
45
30
  }
46
- else
47
- descriptionList.push('TODOS');
48
- return this.getHTMLPill('badge-secondary', `Empresa ${operacao} ${descriptionList.join(', ')}`);
49
- });
31
+ }
32
+ else
33
+ descriptionList.push('TODOS');
34
+ return this.getHTMLPill('badge-secondary', `Empresa ${operacao} ${descriptionList.join(', ')}`);
50
35
  }
51
36
  static getTextoByTag(operacao, tags) {
52
- return __awaiter(this, void 0, void 0, function* () {
53
- operacao = yield this.getTextoOperacao(operacao);
54
- let descriptionList = [];
55
- for (let tag of tags) {
56
- descriptionList.push(tag.nome);
57
- }
58
- return this.getHTMLPill('badge-light', `Tag ${operacao} ${descriptionList.join(', ')}`);
59
- });
37
+ operacao = this.getTextoOperacao(operacao);
38
+ let descriptionList = [];
39
+ for (let tag of tags) {
40
+ descriptionList.push(tag.nome);
41
+ }
42
+ return this.getHTMLPill('badge-light', `Tag ${operacao} ${descriptionList.join(', ')}`);
60
43
  }
61
44
  static getTextoByFormaPagamento(operacao, formasPagamento) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- operacao = yield this.getTextoOperacao(operacao);
64
- let descriptionList = [];
65
- if (formasPagamento.length > 0) {
66
- for (let formaPagamento of formasPagamento) {
67
- descriptionList.push(formaPagamento.descricao);
68
- }
45
+ operacao = this.getTextoOperacao(operacao);
46
+ let descriptionList = [];
47
+ if (formasPagamento.length > 0) {
48
+ for (let formaPagamento of formasPagamento) {
49
+ descriptionList.push(formaPagamento.descricao);
69
50
  }
70
- else
71
- descriptionList.push('TODOS');
72
- return this.getHTMLPill('badge-info', `Forma Pagamento ${operacao} ${descriptionList.join(', ')}`);
73
- });
51
+ }
52
+ else
53
+ descriptionList.push('TODOS');
54
+ return this.getHTMLPill('badge-info', `Forma Pagamento ${operacao} ${descriptionList.join(', ')}`);
74
55
  }
75
56
  static getTextoOperacao(operacao) {
76
- return __awaiter(this, void 0, void 0, function* () {
77
- let resultado = operacao;
78
- switch (operacao) {
79
- case '=':
80
- operacao = 'igual';
81
- break;
82
- case '<>':
83
- operacao = 'diferente';
84
- break;
85
- case 'contem':
86
- operacao = 'contem';
87
- break;
88
- default:
89
- operacao = 'ERROR';
90
- }
91
- return resultado;
92
- });
57
+ let resultado = operacao;
58
+ switch (operacao) {
59
+ case '=':
60
+ operacao = 'igual';
61
+ break;
62
+ case '<>':
63
+ operacao = 'diferente';
64
+ break;
65
+ case 'contem':
66
+ operacao = 'contem';
67
+ break;
68
+ default:
69
+ operacao = 'ERROR';
70
+ }
71
+ return resultado;
93
72
  }
94
73
  static getHTMLPill(color, texto) {
95
- return __awaiter(this, void 0, void 0, function* () {
96
- return `<span class="badge ${color}">${texto}</span>`;
97
- });
74
+ return `<span class="badge ${color}">${texto}</span>`;
98
75
  }
99
76
  }
100
- exports.default = AtributoEntradaUtil;
77
+ exports.default = HtmlBadgerHelper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sim-node-lib",
3
- "version": "0.0.95",
3
+ "version": "0.0.96",
4
4
  "description": "Library from SIMLabs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",