@sankhyalabs/core-docs 0.0.0-bugfix-rc-KB-2229.1 → 0.0.0-bugfix-dev-32613.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.
Files changed (39) hide show
  1. package/classes/ApplicationContext.md +3 -3
  2. package/classes/ArrayUtils.md +133 -3
  3. package/classes/Change.md +11 -11
  4. package/classes/DataUnit.md +251 -122
  5. package/classes/DateUtils.md +11 -11
  6. package/classes/FieldComparator.md +87 -0
  7. package/classes/FloatingManager.md +21 -4
  8. package/classes/IDBRepository.md +518 -0
  9. package/classes/JSUtils.md +77 -4
  10. package/classes/KeyboardManager.md +233 -0
  11. package/classes/ObjectUtils.md +26 -0
  12. package/classes/SearchUtils.md +43 -0
  13. package/classes/SelectionInfo.md +11 -11
  14. package/classes/SkwHttpProvider.md +7 -7
  15. package/classes/StringUtils.md +272 -20
  16. package/enums/Action.md +33 -22
  17. package/enums/ChangeOperation.md +4 -4
  18. package/enums/DataType.md +5 -5
  19. package/enums/DependencyType.md +3 -3
  20. package/enums/SelectionMode.md +2 -2
  21. package/enums/SortMode.md +2 -2
  22. package/enums/UserInterface.md +17 -17
  23. package/interfaces/DUActionInterceptor.md +1 -1
  24. package/interfaces/FieldDescriptor.md +15 -4
  25. package/interfaces/Filter.md +3 -3
  26. package/interfaces/ILoadResult.md +36 -0
  27. package/interfaces/IRepository.md +245 -0
  28. package/interfaces/IRepositoryIndex.md +66 -0
  29. package/interfaces/LoadDataRequest.md +20 -7
  30. package/interfaces/PageRequest.md +3 -3
  31. package/interfaces/PaginationInfo.md +16 -3
  32. package/interfaces/QuickFilter.md +3 -3
  33. package/interfaces/Record.md +4 -4
  34. package/interfaces/SavedRecord.md +5 -5
  35. package/interfaces/Sort.md +3 -3
  36. package/interfaces/SortingProvider.md +3 -2
  37. package/interfaces/WaitingChange.md +3 -3
  38. package/modules.md +7 -0
  39. package/package.json +1 -1
@@ -0,0 +1,518 @@
1
+ [@sankhyalabs/core](../README.md) / [Exports](../modules.md) / IDBRepository
2
+
3
+ # Class: IDBRepository<T\>
4
+
5
+ Abstração para simplificar o uso do indexed DB
6
+
7
+ Além de facilitar os comandos de incluir, remover alterar e obter
8
+ objetos, esse repositório preserva a ordem de inserção na lista,
9
+ além de permitir filtros e ordenações compostas
10
+ (impossíveis com uso de índices).
11
+
12
+ ## Type parameters
13
+
14
+ | Name |
15
+ | :------ |
16
+ | `T` |
17
+
18
+ ## Implements
19
+
20
+ - [`IRepository`](../interfaces/IRepository.md)<`T`\>
21
+
22
+ ## Table of contents
23
+
24
+ ### Constructors
25
+
26
+ - [constructor](IDBRepository.md#constructor)
27
+
28
+ ### Properties
29
+
30
+ - [\_addedStoreName](IDBRepository.md#_addedstorename)
31
+ - [\_db](IDBRepository.md#_db)
32
+ - [\_dbName](IDBRepository.md#_dbname)
33
+ - [\_dbVersion](IDBRepository.md#_dbversion)
34
+ - [\_indexKeyPath](IDBRepository.md#_indexkeypath)
35
+ - [\_indexes](IDBRepository.md#_indexes)
36
+ - [\_operating](IDBRepository.md#_operating)
37
+ - [\_storeName](IDBRepository.md#_storename)
38
+
39
+ ### Methods
40
+
41
+ - [clear](IDBRepository.md#clear)
42
+ - [count](IDBRepository.md#count)
43
+ - [createStore](IDBRepository.md#createstore)
44
+ - [delete](IDBRepository.md#delete)
45
+ - [distict](IDBRepository.md#distict)
46
+ - [getAddedItems](IDBRepository.md#getaddeditems)
47
+ - [getItemPosition](IDBRepository.md#getitemposition)
48
+ - [getItemPositionByAdded](IDBRepository.md#getitempositionbyadded)
49
+ - [insert](IDBRepository.md#insert)
50
+ - [isEmpty](IDBRepository.md#isempty)
51
+ - [isOperating](IDBRepository.md#isoperating)
52
+ - [load](IDBRepository.md#load)
53
+ - [openDB](IDBRepository.md#opendb)
54
+ - [push](IDBRepository.md#push)
55
+ - [update](IDBRepository.md#update)
56
+
57
+ ## Constructors
58
+
59
+ ### constructor
60
+
61
+ • **new IDBRepository**<`T`\>(`dbName`, `dbVersion`, `storeName`, `indexKeyPath`, `indexes?`)
62
+
63
+ Construtor padrão
64
+
65
+ #### Type parameters
66
+
67
+ | Name |
68
+ | :------ |
69
+ | `T` |
70
+
71
+ #### Parameters
72
+
73
+ | Name | Type | Description |
74
+ | :------ | :------ | :------ |
75
+ | `dbName` | `string` | Nome do DB |
76
+ | `dbVersion` | `number` | Versão do DB |
77
+ | `storeName` | `string` | Nome da store |
78
+ | `indexKeyPath` | `string` | Um atributo que identifique os objetos guardados |
79
+ | `indexes?` | [`IRepositoryIndex`](../interfaces/IRepositoryIndex.md)[] | - |
80
+
81
+ #### Defined in
82
+
83
+ src/repository/indexeddb/IDBRepository.ts:35
84
+
85
+ ## Properties
86
+
87
+ ### \_addedStoreName
88
+
89
+ • `Private` **\_addedStoreName**: `string`
90
+
91
+ #### Defined in
92
+
93
+ src/repository/indexeddb/IDBRepository.ts:21
94
+
95
+ ___
96
+
97
+ ### \_db
98
+
99
+ • `Private` `Optional` **\_db**: `IDBPDatabase`<`unknown`\>
100
+
101
+ #### Defined in
102
+
103
+ src/repository/indexeddb/IDBRepository.ts:24
104
+
105
+ ___
106
+
107
+ ### \_dbName
108
+
109
+ • `Private` **\_dbName**: `string`
110
+
111
+ #### Defined in
112
+
113
+ src/repository/indexeddb/IDBRepository.ts:18
114
+
115
+ ___
116
+
117
+ ### \_dbVersion
118
+
119
+ • `Private` **\_dbVersion**: `number`
120
+
121
+ #### Defined in
122
+
123
+ src/repository/indexeddb/IDBRepository.ts:19
124
+
125
+ ___
126
+
127
+ ### \_indexKeyPath
128
+
129
+ • `Private` **\_indexKeyPath**: `string`
130
+
131
+ #### Defined in
132
+
133
+ src/repository/indexeddb/IDBRepository.ts:22
134
+
135
+ ___
136
+
137
+ ### \_indexes
138
+
139
+ • `Private` `Optional` **\_indexes**: [`IRepositoryIndex`](../interfaces/IRepositoryIndex.md)[]
140
+
141
+ #### Defined in
142
+
143
+ src/repository/indexeddb/IDBRepository.ts:23
144
+
145
+ ___
146
+
147
+ ### \_operating
148
+
149
+ • `Private` **\_operating**: `boolean` = `true`
150
+
151
+ #### Defined in
152
+
153
+ src/repository/indexeddb/IDBRepository.ts:25
154
+
155
+ ___
156
+
157
+ ### \_storeName
158
+
159
+ • `Private` **\_storeName**: `string`
160
+
161
+ #### Defined in
162
+
163
+ src/repository/indexeddb/IDBRepository.ts:20
164
+
165
+ ## Methods
166
+
167
+ ### clear
168
+
169
+ ▸ **clear**(): `Promise`<`void`\>
170
+
171
+ Limpa todo o repositório
172
+
173
+ #### Returns
174
+
175
+ `Promise`<`void`\>
176
+
177
+ Promessa de execução
178
+
179
+ #### Implementation of
180
+
181
+ [IRepository](../interfaces/IRepository.md).[clear](../interfaces/IRepository.md#clear)
182
+
183
+ #### Defined in
184
+
185
+ src/repository/indexeddb/IDBRepository.ts:123
186
+
187
+ ___
188
+
189
+ ### count
190
+
191
+ ▸ **count**(): `Promise`<`number`\>
192
+
193
+ Conta os itens do repositório
194
+
195
+ #### Returns
196
+
197
+ `Promise`<`number`\>
198
+
199
+ Promessa de quantidade
200
+
201
+ #### Implementation of
202
+
203
+ [IRepository](../interfaces/IRepository.md).[count](../interfaces/IRepository.md#count)
204
+
205
+ #### Defined in
206
+
207
+ src/repository/indexeddb/IDBRepository.ts:236
208
+
209
+ ___
210
+
211
+ ### createStore
212
+
213
+ ▸ `Private` **createStore**(`db`, `name`, `indexPrefix?`): `void`
214
+
215
+ #### Parameters
216
+
217
+ | Name | Type | Default value |
218
+ | :------ | :------ | :------ |
219
+ | `db` | `IDBPDatabase`<`unknown`\> | `undefined` |
220
+ | `name` | `string` | `undefined` |
221
+ | `indexPrefix` | `string` | `""` |
222
+
223
+ #### Returns
224
+
225
+ `void`
226
+
227
+ #### Defined in
228
+
229
+ src/repository/indexeddb/IDBRepository.ts:271
230
+
231
+ ___
232
+
233
+ ### delete
234
+
235
+ ▸ **delete**(`items`): `Promise`<`void`\>
236
+
237
+ Remove itens do repositório
238
+
239
+ #### Parameters
240
+
241
+ | Name | Type | Description |
242
+ | :------ | :------ | :------ |
243
+ | `items` | `T`[] | Os itens a serem removidos |
244
+
245
+ #### Returns
246
+
247
+ `Promise`<`void`\>
248
+
249
+ Promessa de execução
250
+
251
+ #### Implementation of
252
+
253
+ [IRepository](../interfaces/IRepository.md).[delete](../interfaces/IRepository.md#delete)
254
+
255
+ #### Defined in
256
+
257
+ src/repository/indexeddb/IDBRepository.ts:138
258
+
259
+ ___
260
+
261
+ ### distict
262
+
263
+ ▸ **distict**(`itemProcessor`): `Promise`<`Map`<`string`, `any`\>\>
264
+
265
+ Itera todos os items colecionando os valores distintos.
266
+
267
+ #### Parameters
268
+
269
+ | Name | Type | Description |
270
+ | :------ | :------ | :------ |
271
+ | `itemProcessor` | (`item`: `T`) => { `key`: `string` ; `value`: `any` } | Uma função que processa um item e gera a chave e valor |
272
+
273
+ #### Returns
274
+
275
+ `Promise`<`Map`<`string`, `any`\>\>
276
+
277
+ Promessa de array com os valores distintos.
278
+
279
+ #### Implementation of
280
+
281
+ [IRepository](../interfaces/IRepository.md).[distict](../interfaces/IRepository.md#distict)
282
+
283
+ #### Defined in
284
+
285
+ src/repository/indexeddb/IDBRepository.ts:78
286
+
287
+ ___
288
+
289
+ ### getAddedItems
290
+
291
+ ▸ `Private` **getAddedItems**(`db`): `Promise`<`IAddedItem`<`T`\>[]\>
292
+
293
+ #### Parameters
294
+
295
+ | Name | Type |
296
+ | :------ | :------ |
297
+ | `db` | `IDBPDatabase`<`unknown`\> |
298
+
299
+ #### Returns
300
+
301
+ `Promise`<`IAddedItem`<`T`\>[]\>
302
+
303
+ #### Defined in
304
+
305
+ src/repository/indexeddb/IDBRepository.ts:319
306
+
307
+ ___
308
+
309
+ ### getItemPosition
310
+
311
+ ▸ `Private` **getItemPosition**(`db`, `itemTest`): `Promise`<`number`\>
312
+
313
+ #### Parameters
314
+
315
+ | Name | Type |
316
+ | :------ | :------ |
317
+ | `db` | `IDBPDatabase`<`unknown`\> |
318
+ | `itemTest` | (`item`: `any`) => `boolean` |
319
+
320
+ #### Returns
321
+
322
+ `Promise`<`number`\>
323
+
324
+ #### Defined in
325
+
326
+ src/repository/indexeddb/IDBRepository.ts:284
327
+
328
+ ___
329
+
330
+ ### getItemPositionByAdded
331
+
332
+ ▸ `Private` **getItemPositionByAdded**(`db`, `itemTest`): `Promise`<`number`\>
333
+
334
+ #### Parameters
335
+
336
+ | Name | Type |
337
+ | :------ | :------ |
338
+ | `db` | `IDBPDatabase`<`unknown`\> |
339
+ | `itemTest` | (`item`: `any`) => `boolean` |
340
+
341
+ #### Returns
342
+
343
+ `Promise`<`number`\>
344
+
345
+ #### Defined in
346
+
347
+ src/repository/indexeddb/IDBRepository.ts:307
348
+
349
+ ___
350
+
351
+ ### insert
352
+
353
+ ▸ **insert**(`itemReference`, `items`): `Promise`<`void`\>
354
+
355
+ Insere itens em uma posição de referência
356
+
357
+ #### Parameters
358
+
359
+ | Name | Type | Description |
360
+ | :------ | :------ | :------ |
361
+ | `itemReference` | `T` | O item posterior aos inseridos |
362
+ | `items` | `T`[] | Os itens a serem inseridos |
363
+
364
+ #### Returns
365
+
366
+ `Promise`<`void`\>
367
+
368
+ Promessa de execução
369
+
370
+ #### Implementation of
371
+
372
+ [IRepository](../interfaces/IRepository.md).[insert](../interfaces/IRepository.md#insert)
373
+
374
+ #### Defined in
375
+
376
+ src/repository/indexeddb/IDBRepository.ts:194
377
+
378
+ ___
379
+
380
+ ### isEmpty
381
+
382
+ ▸ **isEmpty**(): `Promise`<`boolean`\>
383
+
384
+ Determina se o repositório está vazio ou ainda não foi criado.
385
+
386
+ #### Returns
387
+
388
+ `Promise`<`boolean`\>
389
+
390
+ #### Implementation of
391
+
392
+ [IRepository](../interfaces/IRepository.md).[isEmpty](../interfaces/IRepository.md#isempty)
393
+
394
+ #### Defined in
395
+
396
+ src/repository/indexeddb/IDBRepository.ts:218
397
+
398
+ ___
399
+
400
+ ### isOperating
401
+
402
+ ▸ **isOperating**(): `boolean`
403
+
404
+ Determina se o repositório está em condições normais de funcionamento.
405
+ Caso o banco tenha sido excluido, retorna false.
406
+
407
+ #### Returns
408
+
409
+ `boolean`
410
+
411
+ #### Implementation of
412
+
413
+ [IRepository](../interfaces/IRepository.md).[isOperating](../interfaces/IRepository.md#isoperating)
414
+
415
+ #### Defined in
416
+
417
+ src/repository/indexeddb/IDBRepository.ts:214
418
+
419
+ ___
420
+
421
+ ### load
422
+
423
+ ▸ **load**(`filterFunction?`, `sortingFunction?`, `offset?`, `limit?`): `Promise`<[`ILoadResult`](../interfaces/ILoadResult.md)<`T`\>\>
424
+
425
+ Recupera registros do repositório
426
+
427
+ #### Parameters
428
+
429
+ | Name | Type | Description |
430
+ | :------ | :------ | :------ |
431
+ | `filterFunction?` | (`value`: `T`) => `boolean` | Teste para determinar se um registro está no universo desejado |
432
+ | `sortingFunction?` | (`itemA`: `T`, `itemB`: `T`) => `number` | Critério comparação para ordenação |
433
+ | `offset?` | `number` | Determina que o resultado descarta os registros iniciais |
434
+ | `limit?` | `number` | Descarta o resultado a partir de uma quantidade de registros |
435
+
436
+ #### Returns
437
+
438
+ `Promise`<[`ILoadResult`](../interfaces/ILoadResult.md)<`T`\>\>
439
+
440
+ Promessa de um array que satisfaça aos critérios informados
441
+
442
+ #### Implementation of
443
+
444
+ [IRepository](../interfaces/IRepository.md).[load](../interfaces/IRepository.md#load)
445
+
446
+ #### Defined in
447
+
448
+ src/repository/indexeddb/IDBRepository.ts:44
449
+
450
+ ___
451
+
452
+ ### openDB
453
+
454
+ ▸ `Private` **openDB**(): `Promise`<`IDBPDatabase`<`unknown`\>\>
455
+
456
+ #### Returns
457
+
458
+ `Promise`<`IDBPDatabase`<`unknown`\>\>
459
+
460
+ #### Defined in
461
+
462
+ src/repository/indexeddb/IDBRepository.ts:250
463
+
464
+ ___
465
+
466
+ ### push
467
+
468
+ ▸ **push**(`items`): `Promise`<`void`\>
469
+
470
+ Adiciona registros no final do repositório
471
+
472
+ #### Parameters
473
+
474
+ | Name | Type | Description |
475
+ | :------ | :------ | :------ |
476
+ | `items` | `T`[] | Os items a serem adicionados |
477
+
478
+ #### Returns
479
+
480
+ `Promise`<`void`\>
481
+
482
+ Promessa de execução
483
+
484
+ #### Implementation of
485
+
486
+ [IRepository](../interfaces/IRepository.md).[push](../interfaces/IRepository.md#push)
487
+
488
+ #### Defined in
489
+
490
+ src/repository/indexeddb/IDBRepository.ts:103
491
+
492
+ ___
493
+
494
+ ### update
495
+
496
+ ▸ **update**(`items`): `Promise`<`void`\>
497
+
498
+ Altera itens já persistido no repositório
499
+
500
+ #### Parameters
501
+
502
+ | Name | Type | Description |
503
+ | :------ | :------ | :------ |
504
+ | `items` | `T`[] | Os itens a serem alterados |
505
+
506
+ #### Returns
507
+
508
+ `Promise`<`void`\>
509
+
510
+ Promessa de execução
511
+
512
+ #### Implementation of
513
+
514
+ [IRepository](../interfaces/IRepository.md).[update](../interfaces/IRepository.md#update)
515
+
516
+ #### Defined in
517
+
518
+ src/repository/indexeddb/IDBRepository.ts:165
@@ -13,9 +13,12 @@ Classe com utiliários comuns para funções genéricas em JavaScript.
13
13
  ### Methods
14
14
 
15
15
  - [debounce](JSUtils.md#debounce)
16
+ - [debounceLeading](JSUtils.md#debounceleading)
16
17
  - [generateUUID](JSUtils.md#generateuuid)
17
18
  - [isBase64](JSUtils.md#isbase64)
18
19
  - [isEllipsisActive](JSUtils.md#isellipsisactive)
20
+ - [isHiddenElement](JSUtils.md#ishiddenelement)
21
+ - [replaceHtmlEntities](JSUtils.md#replacehtmlentities)
19
22
 
20
23
  ## Constructors
21
24
 
@@ -46,7 +49,33 @@ Método responsável em criar um timer para processar uma determinada função.
46
49
 
47
50
  #### Defined in
48
51
 
49
- src/utils/JSUtils.ts:16
52
+ src/utils/JSUtils.ts:21
53
+
54
+ ___
55
+
56
+ ### debounceLeading
57
+
58
+ ▸ `Static` **debounceLeading**(`callback`, `timeout?`, `context?`): `VoidFunction`
59
+
60
+ Método responsável por executar uma função e ignorar as outras posteriores até o tempo especificado.
61
+
62
+ #### Parameters
63
+
64
+ | Name | Type | Default value | Description |
65
+ | :------ | :------ | :------ | :------ |
66
+ | `callback` | `Function` | `undefined` | Função a ser invocada |
67
+ | `timeout` | `number` | `300` | Quantidade de tempo para aguardar antes de invocar novamente |
68
+ | `context?` | `any` | `undefined` | O contexto atual |
69
+
70
+ #### Returns
71
+
72
+ `VoidFunction`
73
+
74
+ A função com o debounce
75
+
76
+ #### Defined in
77
+
78
+ src/utils/JSUtils.ts:37
50
79
 
51
80
  ___
52
81
 
@@ -64,7 +93,7 @@ Método responsável em gerar um UUID.
64
93
 
65
94
  #### Defined in
66
95
 
67
- src/utils/JSUtils.ts:66
96
+ src/utils/JSUtils.ts:95
68
97
 
69
98
  ___
70
99
 
@@ -88,7 +117,7 @@ Método que verifica se uma string está encodada com base64.
88
117
 
89
118
  #### Defined in
90
119
 
91
- src/utils/JSUtils.ts:51
120
+ src/utils/JSUtils.ts:80
92
121
 
93
122
  ___
94
123
 
@@ -112,4 +141,48 @@ Método responsável em validar se um elemento HTML está com o ellipsis ativo.
112
141
 
113
142
  #### Defined in
114
143
 
115
- src/utils/JSUtils.ts:31
144
+ src/utils/JSUtils.ts:60
145
+
146
+ ___
147
+
148
+ ### isHiddenElement
149
+
150
+ ▸ `Static` **isHiddenElement**(`element`): `boolean`
151
+
152
+ #### Parameters
153
+
154
+ | Name | Type |
155
+ | :------ | :------ |
156
+ | `element` | `HTMLElement` |
157
+
158
+ #### Returns
159
+
160
+ `boolean`
161
+
162
+ #### Defined in
163
+
164
+ src/utils/JSUtils.ts:8
165
+
166
+ ___
167
+
168
+ ### replaceHtmlEntities
169
+
170
+ ▸ `Static` **replaceHtmlEntities**(`source`): `string`
171
+
172
+ Substitui caracteres para suas entidades HTML.
173
+
174
+ #### Parameters
175
+
176
+ | Name | Type | Description |
177
+ | :------ | :------ | :------ |
178
+ | `source` | `string` | String a ter os caracteres substituidos. |
179
+
180
+ #### Returns
181
+
182
+ `string`
183
+
184
+ - Retorna um UUID.
185
+
186
+ #### Defined in
187
+
188
+ src/utils/JSUtils.ts:105