@sankhyalabs/core-docs 2.3.6 → 2.4.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.
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Class: DateUtils
4
4
 
5
+ `DateUtils`: Utilizado para formatação, padronização e cálculos de datas.
6
+
5
7
  ## Table of contents
6
8
 
7
9
  ### Constructors
@@ -31,19 +33,23 @@
31
33
 
32
34
  ▸ `Static` `Private` **adjustDLST**(`date`): `Date`
33
35
 
36
+ Realiza correção do horário de verão.
37
+
34
38
  #### Parameters
35
39
 
36
- | Name | Type |
37
- | :------ | :------ |
38
- | `date` | `Date` |
40
+ | Name | Type | Description |
41
+ | :------ | :------ | :------ |
42
+ | `date` | `Date` | Data a ser ajustada. |
39
43
 
40
44
  #### Returns
41
45
 
42
46
  `Date`
43
47
 
48
+ - Data informada ajustada para horário de verão.
49
+
44
50
  #### Defined in
45
51
 
46
- src/utils/DateUtils.ts:60
52
+ src/utils/DateUtils.ts:101
47
53
 
48
54
  ___
49
55
 
@@ -51,20 +57,30 @@ ___
51
57
 
52
58
  ▸ `Static` **clearTime**(`date`, `adjustDayLightSavingTime?`): `Date`
53
59
 
60
+ Zerar o horário de uma data.
61
+
62
+ **`Example`**
63
+
64
+ ```ts
65
+ Informo: 2023-03-09 12:42:40 | Obtenho: 2023-03-09 00:00:00
66
+ ```
67
+
54
68
  #### Parameters
55
69
 
56
- | Name | Type | Default value |
57
- | :------ | :------ | :------ |
58
- | `date` | `Date` | `undefined` |
59
- | `adjustDayLightSavingTime` | `boolean` | `true` |
70
+ | Name | Type | Default value | Description |
71
+ | :------ | :------ | :------ | :------ |
72
+ | `date` | `Date` | `undefined` | Data a ser manipulada. |
73
+ | `adjustDayLightSavingTime` | `boolean` | `true` | Ajusta horário de verão na data recebida. |
60
74
 
61
75
  #### Returns
62
76
 
63
77
  `Date`
64
78
 
79
+ - Data sem as informações de horário.
80
+
65
81
  #### Defined in
66
82
 
67
- src/utils/DateUtils.ts:3
83
+ src/utils/DateUtils.ts:17
68
84
 
69
85
  ___
70
86
 
@@ -72,19 +88,30 @@ ___
72
88
 
73
89
  ▸ `Static` **formatRfc3339**(`date`): `string`
74
90
 
91
+ Converte a data para o formato RFC3339.
92
+
93
+ **`Example`**
94
+
95
+ ```ts
96
+ Informo: 2023-03-09 12:42:40 | Obtenho: 2023-03-09T12:42:47-03:00
97
+ ```
98
+
75
99
  #### Parameters
76
100
 
77
- | Name | Type |
78
- | :------ | :------ |
79
- | `date` | `Date` |
101
+ | Name | Type | Description |
102
+ | :------ | :------ | :------ |
103
+ | `date` | `Date` | Data a ser convertida |
80
104
 
81
105
  #### Returns
82
106
 
83
107
  `string`
84
108
 
109
+ - Data informada no formato RFC3339.
110
+ *
111
+
85
112
  #### Defined in
86
113
 
87
- src/utils/DateUtils.ts:87
114
+ src/utils/DateUtils.ts:151
88
115
 
89
116
  ___
90
117
 
@@ -92,19 +119,23 @@ ___
92
119
 
93
120
  ▸ `Static` **getToday**(`withTime?`): `Date`
94
121
 
122
+ Obtém a data atual.
123
+
95
124
  #### Parameters
96
125
 
97
- | Name | Type | Default value |
98
- | :------ | :------ | :------ |
99
- | `withTime` | `boolean` | `false` |
126
+ | Name | Type | Default value | Description |
127
+ | :------ | :------ | :------ | :------ |
128
+ | `withTime` | `boolean` | `false` | Caso true retorna a data com informações de horário. |
100
129
 
101
130
  #### Returns
102
131
 
103
132
  `Date`
104
133
 
134
+ - Data atual sem informação de horário.
135
+
105
136
  #### Defined in
106
137
 
107
- src/utils/DateUtils.ts:44
138
+ src/utils/DateUtils.ts:72
108
139
 
109
140
  ___
110
141
 
@@ -112,19 +143,35 @@ ___
112
143
 
113
144
  ▸ `Static` `Private` **pad**(`n`): `string` \| `Number`
114
145
 
146
+ Adiciona uma casa decimal a esquerda de uma unidade.
147
+
148
+ **`Example`**
149
+
150
+ ```ts
151
+ Informo: 15 | Obtenho: 15
152
+ ```
153
+
154
+ **`Example`**
155
+
156
+ ```ts
157
+ Informo: 2 | Obtenho: "02"
158
+ ```
159
+
115
160
  #### Parameters
116
161
 
117
- | Name | Type |
118
- | :------ | :------ |
119
- | `n` | `Number` |
162
+ | Name | Type | Description |
163
+ | :------ | :------ | :------ |
164
+ | `n` | `Number` | Número a ser ajustado |
120
165
 
121
166
  #### Returns
122
167
 
123
168
  `string` \| `Number`
124
169
 
170
+ - O número informado, com uma casa decimal a esquerda.
171
+
125
172
  #### Defined in
126
173
 
127
- src/utils/DateUtils.ts:70
174
+ src/utils/DateUtils.ts:120
128
175
 
129
176
  ___
130
177
 
@@ -132,21 +179,25 @@ ___
132
179
 
133
180
  ▸ `Static` **strToDate**(`strValue`, `adjustDayLightSavingTime?`, `monthYearMode?`): `undefined` \| `Date`
134
181
 
182
+ Converte String para Date.
183
+
135
184
  #### Parameters
136
185
 
137
- | Name | Type | Default value |
138
- | :------ | :------ | :------ |
139
- | `strValue` | `string` | `undefined` |
140
- | `adjustDayLightSavingTime` | `boolean` | `true` |
141
- | `monthYearMode` | `boolean` | `false` |
186
+ | Name | Type | Default value | Description |
187
+ | :------ | :------ | :------ | :------ |
188
+ | `strValue` | `string` | `undefined` | Texto a ser convertido para data. |
189
+ | `adjustDayLightSavingTime` | `boolean` | `true` | Se verdadeiro, ativa regra de horário de verão. |
190
+ | `monthYearMode` | `boolean` | `false` | Quando ativado, retorna o primeiro dia do mês apenas para construir a data. |
142
191
 
143
192
  #### Returns
144
193
 
145
194
  `undefined` \| `Date`
146
195
 
196
+ - Data sem as informações de horário.
197
+
147
198
  #### Defined in
148
199
 
149
- src/utils/DateUtils.ts:8
200
+ src/utils/DateUtils.ts:30
150
201
 
151
202
  ___
152
203
 
@@ -154,19 +205,23 @@ ___
154
205
 
155
206
  ▸ `Static` `Private` **timezoneOffset**(`offset`): `string`
156
207
 
208
+ Retorna timezone da data.
209
+
157
210
  #### Parameters
158
211
 
159
- | Name | Type |
160
- | :------ | :------ |
161
- | `offset` | `number` |
212
+ | Name | Type | Description |
213
+ | :------ | :------ | :------ |
214
+ | `offset` | `number` | Valor do timezone desejado. |
162
215
 
163
216
  #### Returns
164
217
 
165
218
  `string`
166
219
 
220
+ Timezone da data.
221
+
167
222
  #### Defined in
168
223
 
169
- src/utils/DateUtils.ts:74
224
+ src/utils/DateUtils.ts:130
170
225
 
171
226
  ___
172
227
 
@@ -174,17 +229,21 @@ ___
174
229
 
175
230
  ▸ `Static` **validateDate**(`value`, `hasTime?`): `undefined` \| `Date`
176
231
 
232
+ Retorna se a data é válida.
233
+
177
234
  #### Parameters
178
235
 
179
- | Name | Type | Default value |
180
- | :------ | :------ | :------ |
181
- | `value` | `Date` | `undefined` |
182
- | `hasTime` | `boolean` | `false` |
236
+ | Name | Type | Default value | Description |
237
+ | :------ | :------ | :------ | :------ |
238
+ | `value` | `Date` | `undefined` | Data a ser validada. |
239
+ | `hasTime` | `boolean` | `false` | Determina se a data retornada deve conter informação de horário ou não. Por padrão não retorna a hora. |
183
240
 
184
241
  #### Returns
185
242
 
186
243
  `undefined` \| `Date`
187
244
 
245
+ - Caso válida, retorna a própria data.
246
+
188
247
  #### Defined in
189
248
 
190
- src/utils/DateUtils.ts:54
249
+ src/utils/DateUtils.ts:89
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Class: ElementIDUtils
4
4
 
5
+ `ElementIDUtils`: O ElementIDUtils é um utilitário responsável por criar e adicionar identificadores únicos aos componentes através do atributo data-element-id. A finalidade dele é otimizar a automação dos testes e melhorar a eficiência na manipulação dos componentes do Design System, garantindo seleções precisas e seguras.
6
+
5
7
  ## Table of contents
6
8
 
7
9
  ### Constructors
@@ -39,7 +41,7 @@
39
41
 
40
42
  #### Defined in
41
43
 
42
- src/utils/ElementIDUtils.ts:12
44
+ src/utils/ElementIDUtils.ts:13
43
45
 
44
46
  ___
45
47
 
@@ -49,7 +51,7 @@ ___
49
51
 
50
52
  #### Defined in
51
53
 
52
- src/utils/ElementIDUtils.ts:13
54
+ src/utils/ElementIDUtils.ts:14
53
55
 
54
56
  ## Methods
55
57
 
@@ -57,21 +59,25 @@ src/utils/ElementIDUtils.ts:13
57
59
 
58
60
  ▸ `Static` **addIDInfo**(`element`, `suffix?`, `iDInfo?`): `string`
59
61
 
62
+ Cria e adiciona a propriedade `data-element-id` em um elemento.
63
+
60
64
  #### Parameters
61
65
 
62
- | Name | Type |
63
- | :------ | :------ |
64
- | `element` | `HTMLElement` |
65
- | `suffix?` | `string` |
66
- | `iDInfo?` | [`IElementIDInfo`](../interfaces/IElementIDInfo.md) |
66
+ | Name | Type | Description |
67
+ | :------ | :------ | :------ |
68
+ | `element` | `HTMLElement` | Elemento HTML a ser modificado (HTMLElement). |
69
+ | `suffix?` | `string` | Sufixo/Texto para ser adicionado. |
70
+ | `iDInfo?` | [`IElementIDInfo`](../interfaces/IElementIDInfo.md) | ID para ser adicionado. |
67
71
 
68
72
  #### Returns
69
73
 
70
74
  `string`
71
75
 
76
+ - O data-element-id gerado.
77
+
72
78
  #### Defined in
73
79
 
74
- src/utils/ElementIDUtils.ts:15
80
+ src/utils/ElementIDUtils.ts:24
75
81
 
76
82
  ___
77
83
 
@@ -93,7 +99,7 @@ ___
93
99
 
94
100
  #### Defined in
95
101
 
96
- src/utils/ElementIDUtils.ts:24
102
+ src/utils/ElementIDUtils.ts:33
97
103
 
98
104
  ___
99
105
 
@@ -101,20 +107,24 @@ ___
101
107
 
102
108
  ▸ `Static` `Private` **addPrefix**(`iDInfo`, `dataElementID`): `string`
103
109
 
110
+ Adiciona a propriedade name do DataUnit como prefixo do data-element-id do elemento.
111
+
104
112
  #### Parameters
105
113
 
106
- | Name | Type |
107
- | :------ | :------ |
108
- | `iDInfo` | `undefined` \| [`IElementIDInfo`](../interfaces/IElementIDInfo.md) |
109
- | `dataElementID` | `string` |
114
+ | Name | Type | Description |
115
+ | :------ | :------ | :------ |
116
+ | `iDInfo` | `undefined` \| [`IElementIDInfo`](../interfaces/IElementIDInfo.md) | ID para ser adicionado ao `data-element-id`. |
117
+ | `dataElementID` | `string` | Sufixo/Texto para ser adicionado ao `data-element-id`. |
110
118
 
111
119
  #### Returns
112
120
 
113
121
  `string`
114
122
 
123
+ - String contendo informação para ser usada no `data-element-id` do elemento.
124
+
115
125
  #### Defined in
116
126
 
117
- src/utils/ElementIDUtils.ts:94
127
+ src/utils/ElementIDUtils.ts:136
118
128
 
119
129
  ___
120
130
 
@@ -122,21 +132,32 @@ ___
122
132
 
123
133
  ▸ `Static` `Private` **addSuffix**(`dataElementID`, `suffix`, `element`): `string`
124
134
 
135
+ Adiciona sufixo ao atributo `data-element-id` de um elemento, utilizado para montar a hierarquia dos ids dos componentes em tela.
136
+
137
+ **`Example`**
138
+
139
+ ```ts
140
+ Um ez-combo-box tem data-element-id = codparc_input_internal_combo.
141
+ Dentro desse ez-combo-box existe um ez-text-input. O data-element-id teria como sufixo o id 'codparc_input_internal_combo' referente ao seu pai.
142
+ ```
143
+
125
144
  #### Parameters
126
145
 
127
- | Name | Type |
128
- | :------ | :------ |
129
- | `dataElementID` | ``null`` \| `string` |
130
- | `suffix` | `undefined` \| `string` |
131
- | `element` | `HTMLElement` |
146
+ | Name | Type | Description |
147
+ | :------ | :------ | :------ |
148
+ | `dataElementID` | ``null`` \| `string` | ID para ser adicionado ao `data-element-id`. |
149
+ | `suffix` | `undefined` \| `string` | Sufixo/Texto para ser adicionado ao `data-element-id`. |
150
+ | `element` | `HTMLElement` | Elemento HTML a ser modificado (HTMLElement). |
132
151
 
133
152
  #### Returns
134
153
 
135
154
  `string`
136
155
 
156
+ - `data-element-id` com sufixo.
157
+
137
158
  #### Defined in
138
159
 
139
- src/utils/ElementIDUtils.ts:84
160
+ src/utils/ElementIDUtils.ts:119
140
161
 
141
162
  ___
142
163
 
@@ -144,19 +165,23 @@ ___
144
165
 
145
166
  ▸ `Static` `Private` **formatDescription**(`value`): `string`
146
167
 
168
+ Remove caracteres especiais.
169
+
147
170
  #### Parameters
148
171
 
149
- | Name | Type |
150
- | :------ | :------ |
151
- | `value` | ``null`` \| `string` |
172
+ | Name | Type | Description |
173
+ | :------ | :------ | :------ |
174
+ | `value` | ``null`` \| `string` | Texto que terá os caracteres especiais removidos. |
152
175
 
153
176
  #### Returns
154
177
 
155
178
  `string`
156
179
 
180
+ - Retorna a string sem caracteres especiais e em camelCase.
181
+
157
182
  #### Defined in
158
183
 
159
- src/utils/ElementIDUtils.ts:102
184
+ src/utils/ElementIDUtils.ts:150
160
185
 
161
186
  ___
162
187
 
@@ -164,20 +189,24 @@ ___
164
189
 
165
190
  ▸ `Static` `Private` **getAttributeValid**(`element`, `iDInfo?`): ``null`` \| `string`
166
191
 
192
+ Obtém ID válido para o elemento.
193
+
167
194
  #### Parameters
168
195
 
169
- | Name | Type |
170
- | :------ | :------ |
171
- | `element` | `HTMLElement` |
172
- | `iDInfo?` | [`IElementIDInfo`](../interfaces/IElementIDInfo.md) |
196
+ | Name | Type | Description |
197
+ | :------ | :------ | :------ |
198
+ | `element` | `HTMLElement` | Elemento HTML a ser modificado (HTMLElement). |
199
+ | `iDInfo?` | [`IElementIDInfo`](../interfaces/IElementIDInfo.md) | ID para ser adicionado. |
173
200
 
174
201
  #### Returns
175
202
 
176
203
  ``null`` \| `string`
177
204
 
205
+ - ID para ser adicionado ao elemento conforme ordem de prioridade.
206
+
178
207
  #### Defined in
179
208
 
180
- src/utils/ElementIDUtils.ts:56
209
+ src/utils/ElementIDUtils.ts:79
181
210
 
182
211
  ___
183
212
 
@@ -185,21 +214,25 @@ ___
185
214
 
186
215
  ▸ `Static` `Private` **getDataElementID**(`element`, `suffix?`, `iDInfo?`): `string`
187
216
 
217
+ Obtém o `data-element-id` do elemento com adição do sufixo e ID.
218
+
188
219
  #### Parameters
189
220
 
190
- | Name | Type |
191
- | :------ | :------ |
192
- | `element` | `HTMLElement` |
193
- | `suffix?` | `string` |
194
- | `iDInfo?` | [`IElementIDInfo`](../interfaces/IElementIDInfo.md) |
221
+ | Name | Type | Description |
222
+ | :------ | :------ | :------ |
223
+ | `element` | `HTMLElement` | Elemento HTML a ser modificado (HTMLElement). |
224
+ | `suffix?` | `string` | Sufixo/Texto para ser adicionado. |
225
+ | `iDInfo?` | [`IElementIDInfo`](../interfaces/IElementIDInfo.md) | ID para ser adicionado. |
195
226
 
196
227
  #### Returns
197
228
 
198
229
  `string`
199
230
 
231
+ - Atributo `data-element-id` do elemento modificado com sufixo e/ou ID.
232
+
200
233
  #### Defined in
201
234
 
202
- src/utils/ElementIDUtils.ts:39
235
+ src/utils/ElementIDUtils.ts:55
203
236
 
204
237
  ___
205
238
 
@@ -219,7 +252,7 @@ ___
219
252
 
220
253
  #### Defined in
221
254
 
222
- src/utils/ElementIDUtils.ts:107
255
+ src/utils/ElementIDUtils.ts:155
223
256
 
224
257
  ___
225
258
 
@@ -240,4 +273,4 @@ ___
240
273
 
241
274
  #### Defined in
242
275
 
243
- src/utils/ElementIDUtils.ts:35
276
+ src/utils/ElementIDUtils.ts:43
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Class: ErrorException
4
4
 
5
+ `ErrorException`: Exceção lançada quando ocorre um erro.
6
+
5
7
  ## Hierarchy
6
8
 
7
9
  - `Error`
@@ -49,7 +51,7 @@ Error.constructor
49
51
 
50
52
  #### Defined in
51
53
 
52
- src/exceptions/ErrorException.ts:7
54
+ src/exceptions/ErrorException.ts:15
53
55
 
54
56
  ## Properties
55
57
 
@@ -71,9 +73,11 @@ ___
71
73
 
72
74
  • **errorCode**: `string`
73
75
 
76
+ Código do erro, indica o erro disparado pelo backend.
77
+
74
78
  #### Defined in
75
79
 
76
- src/exceptions/ErrorException.ts:5
80
+ src/exceptions/ErrorException.ts:13
77
81
 
78
82
  ___
79
83
 
@@ -81,13 +85,15 @@ ___
81
85
 
82
86
  • **message**: `string`
83
87
 
88
+ Descrição do erro.
89
+
84
90
  #### Overrides
85
91
 
86
92
  Error.message
87
93
 
88
94
  #### Defined in
89
95
 
90
- src/exceptions/ErrorException.ts:4
96
+ src/exceptions/ErrorException.ts:10
91
97
 
92
98
  ___
93
99
 
@@ -123,9 +129,11 @@ ___
123
129
 
124
130
  • **title**: `string`
125
131
 
132
+ Titulo do erro.
133
+
126
134
  #### Defined in
127
135
 
128
- src/exceptions/ErrorException.ts:3
136
+ src/exceptions/ErrorException.ts:7
129
137
 
130
138
  ___
131
139
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  # Class: ErrorTracking
4
4
 
5
+ `ErrorTracking`: Handler para processar exceptions lançadas.
6
+
5
7
  ## Table of contents
6
8
 
7
9
  ### Constructors
@@ -25,13 +27,15 @@
25
27
 
26
28
  ▸ `Static` **init**(): `void`
27
29
 
30
+ Inicializa o Rollbar, utilizado para rastreio de erros e análise de logs.
31
+
28
32
  #### Returns
29
33
 
30
34
  `void`
31
35
 
32
36
  #### Defined in
33
37
 
34
- src/traking/ErrorTraking.ts:6
38
+ src/traking/ErrorTraking.ts:16
35
39
 
36
40
  ___
37
41
 
@@ -39,16 +43,20 @@ ___
39
43
 
40
44
  ▸ `Static` `Private` **isInternalException**(`error`): `boolean`
41
45
 
46
+ Retorna se o erro é uma exceção interna na aplicação.
47
+
42
48
  #### Parameters
43
49
 
44
- | Name | Type |
45
- | :------ | :------ |
46
- | `error` | `any` |
50
+ | Name | Type | Description |
51
+ | :------ | :------ | :------ |
52
+ | `error` | `any` | Erro que será identificado como exceção interna ou não. |
47
53
 
48
54
  #### Returns
49
55
 
50
56
  `boolean`
51
57
 
58
+ - Verdadeiro caso seja uma exceção interna.
59
+
52
60
  #### Defined in
53
61
 
54
- src/traking/ErrorTraking.ts:17
62
+ src/traking/ErrorTraking.ts:34