@sankhyalabs/core 4.4.0 → 4.4.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.
Files changed (49) hide show
  1. package/.docs/classes/Change.md +11 -11
  2. package/.docs/classes/DataUnit.md +179 -133
  3. package/.docs/classes/SelectionInfo.md +168 -0
  4. package/.docs/enums/Action.md +3 -14
  5. package/.docs/enums/ChangeOperation.md +4 -4
  6. package/.docs/enums/SelectionMode.md +30 -0
  7. package/.docs/interfaces/DUActionInterceptor.md +1 -1
  8. package/.docs/interfaces/LoadDataRequest.md +13 -0
  9. package/.docs/interfaces/PageRequest.md +3 -3
  10. package/.docs/interfaces/QuickFilter.md +3 -3
  11. package/.docs/interfaces/Record.md +4 -6
  12. package/.docs/interfaces/SavedRecord.md +5 -5
  13. package/.docs/interfaces/WaitingChange.md +3 -3
  14. package/.docs/modules.md +2 -1
  15. package/README.md +3 -1
  16. package/dist/dataunit/DataUnit.d.ts +69 -44
  17. package/dist/dataunit/DataUnit.js +184 -101
  18. package/dist/dataunit/DataUnit.js.map +1 -1
  19. package/dist/dataunit/loading/LoadDataRequest.d.ts +2 -0
  20. package/dist/dataunit/state/action/DataUnitAction.d.ts +0 -1
  21. package/dist/dataunit/state/action/DataUnitAction.js +0 -1
  22. package/dist/dataunit/state/action/DataUnitAction.js.map +1 -1
  23. package/dist/dataunit/state/slice/ChangesSlice.js +1 -2
  24. package/dist/dataunit/state/slice/ChangesSlice.js.map +1 -1
  25. package/dist/dataunit/state/slice/LoadingControlSlice.d.ts +2 -2
  26. package/dist/dataunit/state/slice/LoadingControlSlice.js.map +1 -1
  27. package/dist/dataunit/state/slice/SelectionSlice.d.ts +7 -4
  28. package/dist/dataunit/state/slice/SelectionSlice.js +40 -32
  29. package/dist/dataunit/state/slice/SelectionSlice.js.map +1 -1
  30. package/dist/dataunit/state/slice/SnapshotSlice.d.ts +18 -0
  31. package/dist/dataunit/state/slice/SnapshotSlice.js +85 -0
  32. package/dist/dataunit/state/slice/SnapshotSlice.js.map +1 -0
  33. package/dist/index.d.ts +2 -2
  34. package/dist/index.js +2 -2
  35. package/dist/index.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/dataunit/DataUnit.ts +212 -108
  38. package/src/dataunit/loading/LoadDataRequest.ts +3 -0
  39. package/src/dataunit/state/action/DataUnitAction.ts +0 -2
  40. package/src/dataunit/state/slice/ChangesSlice.ts +1 -1
  41. package/src/dataunit/state/slice/LoadingControlSlice.ts +2 -2
  42. package/src/dataunit/state/slice/SelectionSlice.ts +61 -45
  43. package/src/dataunit/state/slice/SnapshotSlice.ts +113 -0
  44. package/src/index.ts +4 -3
  45. package/.docs/interfaces/AllRecord.md +0 -96
  46. package/dist/dataunit/state/slice/CurrentRecordsSlice.d.ts +0 -12
  47. package/dist/dataunit/state/slice/CurrentRecordsSlice.js +0 -62
  48. package/dist/dataunit/state/slice/CurrentRecordsSlice.js.map +0 -1
  49. package/src/dataunit/state/slice/CurrentRecordsSlice.ts +0 -76
@@ -0,0 +1,168 @@
1
+ [@sankhyalabs/core](../README.md) / [Exports](../modules.md) / SelectionInfo
2
+
3
+ # Class: SelectionInfo
4
+
5
+ ## Table of contents
6
+
7
+ ### Constructors
8
+
9
+ - [constructor](SelectionInfo.md#constructor)
10
+
11
+ ### Properties
12
+
13
+ - [\_records](SelectionInfo.md#_records)
14
+ - [\_total](SelectionInfo.md#_total)
15
+ - [filters](SelectionInfo.md#filters)
16
+ - [mode](SelectionInfo.md#mode)
17
+ - [sort](SelectionInfo.md#sort)
18
+
19
+ ### Accessors
20
+
21
+ - [length](SelectionInfo.md#length)
22
+ - [recordIds](SelectionInfo.md#recordids)
23
+ - [records](SelectionInfo.md#records)
24
+
25
+ ### Methods
26
+
27
+ - [isAllRecords](SelectionInfo.md#isallrecords)
28
+ - [isEmpty](SelectionInfo.md#isempty)
29
+
30
+ ## Constructors
31
+
32
+ ### constructor
33
+
34
+ • **new SelectionInfo**(`records`, `mode?`, `total?`, `filters?`, `sort?`)
35
+
36
+ #### Parameters
37
+
38
+ | Name | Type | Default value |
39
+ | :------ | :------ | :------ |
40
+ | `records` | [`Record`](../interfaces/Record.md)[] | `undefined` |
41
+ | `mode` | [`SelectionMode`](../enums/SelectionMode.md) | `SelectionMode.SOME_RECORDS` |
42
+ | `total?` | `number` | `undefined` |
43
+ | `filters?` | [`Filter`](../interfaces/Filter.md)[] | `undefined` |
44
+ | `sort?` | [`Sort`](../interfaces/Sort.md)[] | `undefined` |
45
+
46
+ #### Defined in
47
+
48
+ src/dataunit/DataUnit.ts:1704
49
+
50
+ ## Properties
51
+
52
+ ### \_records
53
+
54
+ • `Private` **\_records**: [`Record`](../interfaces/Record.md)[]
55
+
56
+ #### Defined in
57
+
58
+ src/dataunit/DataUnit.ts:1698
59
+
60
+ ___
61
+
62
+ ### \_total
63
+
64
+ • `Private` `Optional` **\_total**: `number`
65
+
66
+ #### Defined in
67
+
68
+ src/dataunit/DataUnit.ts:1700
69
+
70
+ ___
71
+
72
+ ### filters
73
+
74
+ • `Optional` **filters**: [`Filter`](../interfaces/Filter.md)[]
75
+
76
+ #### Defined in
77
+
78
+ src/dataunit/DataUnit.ts:1701
79
+
80
+ ___
81
+
82
+ ### mode
83
+
84
+ • **mode**: [`SelectionMode`](../enums/SelectionMode.md)
85
+
86
+ #### Defined in
87
+
88
+ src/dataunit/DataUnit.ts:1699
89
+
90
+ ___
91
+
92
+ ### sort
93
+
94
+ • `Optional` **sort**: [`Sort`](../interfaces/Sort.md)[]
95
+
96
+ #### Defined in
97
+
98
+ src/dataunit/DataUnit.ts:1702
99
+
100
+ ## Accessors
101
+
102
+ ### length
103
+
104
+ • `get` **length**(): `number`
105
+
106
+ #### Returns
107
+
108
+ `number`
109
+
110
+ #### Defined in
111
+
112
+ src/dataunit/DataUnit.ts:1729
113
+
114
+ ___
115
+
116
+ ### recordIds
117
+
118
+ • `get` **recordIds**(): `undefined` \| `string`[]
119
+
120
+ #### Returns
121
+
122
+ `undefined` \| `string`[]
123
+
124
+ #### Defined in
125
+
126
+ src/dataunit/DataUnit.ts:1719
127
+
128
+ ___
129
+
130
+ ### records
131
+
132
+ • `get` **records**(): `undefined` \| [`Record`](../interfaces/Record.md)[]
133
+
134
+ #### Returns
135
+
136
+ `undefined` \| [`Record`](../interfaces/Record.md)[]
137
+
138
+ #### Defined in
139
+
140
+ src/dataunit/DataUnit.ts:1712
141
+
142
+ ## Methods
143
+
144
+ ### isAllRecords
145
+
146
+ ▸ **isAllRecords**(): `boolean`
147
+
148
+ #### Returns
149
+
150
+ `boolean`
151
+
152
+ #### Defined in
153
+
154
+ src/dataunit/DataUnit.ts:1736
155
+
156
+ ___
157
+
158
+ ### isEmpty
159
+
160
+ ▸ **isEmpty**(): `boolean`
161
+
162
+ #### Returns
163
+
164
+ `boolean`
165
+
166
+ #### Defined in
167
+
168
+ src/dataunit/DataUnit.ts:1740
@@ -29,7 +29,6 @@
29
29
  - [REMOVING\_RECORDS](Action.md#removing_records)
30
30
  - [SAVING\_DATA](Action.md#saving_data)
31
31
  - [SELECTION\_CHANGED](Action.md#selection_changed)
32
- - [SELECTION\_REMOVED](Action.md#selection_removed)
33
32
  - [STATE\_CHANGED](Action.md#state_changed)
34
33
  - [WAITING\_CHANGE\_CANCELED](Action.md#waiting_change_canceled)
35
34
 
@@ -71,7 +70,7 @@ ___
71
70
 
72
71
  #### Defined in
73
72
 
74
- src/dataunit/state/action/DataUnitAction.ts:63
73
+ src/dataunit/state/action/DataUnitAction.ts:61
75
74
 
76
75
  ___
77
76
 
@@ -121,7 +120,7 @@ ___
121
120
 
122
121
  #### Defined in
123
122
 
124
- src/dataunit/state/action/DataUnitAction.ts:65
123
+ src/dataunit/state/action/DataUnitAction.ts:63
125
124
 
126
125
  ___
127
126
 
@@ -131,7 +130,7 @@ ___
131
130
 
132
131
  #### Defined in
133
132
 
134
- src/dataunit/state/action/DataUnitAction.ts:66
133
+ src/dataunit/state/action/DataUnitAction.ts:64
135
134
 
136
135
  ___
137
136
 
@@ -265,16 +264,6 @@ src/dataunit/state/action/DataUnitAction.ts:52
265
264
 
266
265
  ___
267
266
 
268
- ### SELECTION\_REMOVED
269
-
270
- • **SELECTION\_REMOVED** = ``"selectionRemoved"``
271
-
272
- #### Defined in
273
-
274
- src/dataunit/state/action/DataUnitAction.ts:61
275
-
276
- ___
277
-
278
267
  ### STATE\_CHANGED
279
268
 
280
269
  • **STATE\_CHANGED** = ``"stateChanged"``
@@ -19,7 +19,7 @@
19
19
 
20
20
  #### Defined in
21
21
 
22
- src/dataunit/DataUnit.ts:1533
22
+ src/dataunit/DataUnit.ts:1583
23
23
 
24
24
  ___
25
25
 
@@ -29,7 +29,7 @@ ___
29
29
 
30
30
  #### Defined in
31
31
 
32
- src/dataunit/DataUnit.ts:1535
32
+ src/dataunit/DataUnit.ts:1585
33
33
 
34
34
  ___
35
35
 
@@ -39,7 +39,7 @@ ___
39
39
 
40
40
  #### Defined in
41
41
 
42
- src/dataunit/DataUnit.ts:1532
42
+ src/dataunit/DataUnit.ts:1582
43
43
 
44
44
  ___
45
45
 
@@ -49,4 +49,4 @@ ___
49
49
 
50
50
  #### Defined in
51
51
 
52
- src/dataunit/DataUnit.ts:1534
52
+ src/dataunit/DataUnit.ts:1584
@@ -0,0 +1,30 @@
1
+ [@sankhyalabs/core](../README.md) / [Exports](../modules.md) / SelectionMode
2
+
3
+ # Enumeration: SelectionMode
4
+
5
+ ## Table of contents
6
+
7
+ ### Enumeration Members
8
+
9
+ - [ALL\_RECORDS](SelectionMode.md#all_records)
10
+ - [SOME\_RECORDS](SelectionMode.md#some_records)
11
+
12
+ ## Enumeration Members
13
+
14
+ ### ALL\_RECORDS
15
+
16
+ • **ALL\_RECORDS** = ``"ALL_RECORDS"``
17
+
18
+ #### Defined in
19
+
20
+ src/dataunit/DataUnit.ts:1692
21
+
22
+ ___
23
+
24
+ ### SOME\_RECORDS
25
+
26
+ • **SOME\_RECORDS** = ``"SOME_RECORDS"``
27
+
28
+ #### Defined in
29
+
30
+ src/dataunit/DataUnit.ts:1693
@@ -26,4 +26,4 @@
26
26
 
27
27
  #### Defined in
28
28
 
29
- src/dataunit/DataUnit.ts:1511
29
+ src/dataunit/DataUnit.ts:1566
@@ -9,6 +9,7 @@ Atributos enviados na requisição de carregamento dos registros
9
9
  ### Properties
10
10
 
11
11
  - [filters](LoadDataRequest.md#filters)
12
+ - [keepSelection](LoadDataRequest.md#keepselection)
12
13
  - [limit](LoadDataRequest.md#limit)
13
14
  - [offset](LoadDataRequest.md#offset)
14
15
  - [parentRecordId](LoadDataRequest.md#parentrecordid)
@@ -29,6 +30,18 @@ src/dataunit/loading/LoadDataRequest.ts:16
29
30
 
30
31
  ___
31
32
 
33
+ ### keepSelection
34
+
35
+ • `Optional` **keepSelection**: `boolean`
36
+
37
+ Na navegação de páginas devemos manter a seleção
38
+
39
+ #### Defined in
40
+
41
+ src/dataunit/loading/LoadDataRequest.ts:25
42
+
43
+ ___
44
+
32
45
  ### limit
33
46
 
34
47
  • `Optional` **limit**: `number`
@@ -18,7 +18,7 @@
18
18
 
19
19
  #### Defined in
20
20
 
21
- src/dataunit/DataUnit.ts:1622
21
+ src/dataunit/DataUnit.ts:1672
22
22
 
23
23
  ___
24
24
 
@@ -28,7 +28,7 @@ ___
28
28
 
29
29
  #### Defined in
30
30
 
31
- src/dataunit/DataUnit.ts:1623
31
+ src/dataunit/DataUnit.ts:1673
32
32
 
33
33
  ___
34
34
 
@@ -38,4 +38,4 @@ ___
38
38
 
39
39
  #### Defined in
40
40
 
41
- src/dataunit/DataUnit.ts:1624
41
+ src/dataunit/DataUnit.ts:1674
@@ -18,7 +18,7 @@
18
18
 
19
19
  #### Defined in
20
20
 
21
- src/dataunit/DataUnit.ts:1629
21
+ src/dataunit/DataUnit.ts:1679
22
22
 
23
23
  ___
24
24
 
@@ -28,7 +28,7 @@ ___
28
28
 
29
29
  #### Defined in
30
30
 
31
- src/dataunit/DataUnit.ts:1630
31
+ src/dataunit/DataUnit.ts:1680
32
32
 
33
33
  ___
34
34
 
@@ -38,4 +38,4 @@ ___
38
38
 
39
39
  #### Defined in
40
40
 
41
- src/dataunit/DataUnit.ts:1628
41
+ src/dataunit/DataUnit.ts:1678
@@ -8,8 +8,6 @@
8
8
 
9
9
  ↳ [`SavedRecord`](SavedRecord.md)
10
10
 
11
- ↳ [`AllRecord`](AllRecord.md)
12
-
13
11
  ## Indexable
14
12
 
15
13
  ▪ [key: `string`]: `any`
@@ -31,7 +29,7 @@
31
29
 
32
30
  #### Defined in
33
31
 
34
- src/dataunit/DataUnit.ts:1518
32
+ src/dataunit/DataUnit.ts:1573
35
33
 
36
34
  ___
37
35
 
@@ -41,7 +39,7 @@ ___
41
39
 
42
40
  #### Defined in
43
41
 
44
- src/dataunit/DataUnit.ts:1517
42
+ src/dataunit/DataUnit.ts:1572
45
43
 
46
44
  ___
47
45
 
@@ -51,7 +49,7 @@ ___
51
49
 
52
50
  #### Defined in
53
51
 
54
- src/dataunit/DataUnit.ts:1515
52
+ src/dataunit/DataUnit.ts:1570
55
53
 
56
54
  ___
57
55
 
@@ -61,4 +59,4 @@ ___
61
59
 
62
60
  #### Defined in
63
61
 
64
- src/dataunit/DataUnit.ts:1516
62
+ src/dataunit/DataUnit.ts:1571
@@ -26,7 +26,7 @@
26
26
 
27
27
  #### Defined in
28
28
 
29
- src/dataunit/DataUnit.ts:1523
29
+ src/dataunit/DataUnit.ts:1578
30
30
 
31
31
  ___
32
32
 
@@ -40,7 +40,7 @@ ___
40
40
 
41
41
  #### Defined in
42
42
 
43
- src/dataunit/DataUnit.ts:1518
43
+ src/dataunit/DataUnit.ts:1573
44
44
 
45
45
  ___
46
46
 
@@ -54,7 +54,7 @@ ___
54
54
 
55
55
  #### Defined in
56
56
 
57
- src/dataunit/DataUnit.ts:1517
57
+ src/dataunit/DataUnit.ts:1572
58
58
 
59
59
  ___
60
60
 
@@ -68,7 +68,7 @@ ___
68
68
 
69
69
  #### Defined in
70
70
 
71
- src/dataunit/DataUnit.ts:1515
71
+ src/dataunit/DataUnit.ts:1570
72
72
 
73
73
  ___
74
74
 
@@ -82,4 +82,4 @@ ___
82
82
 
83
83
  #### Defined in
84
84
 
85
- src/dataunit/DataUnit.ts:1516
85
+ src/dataunit/DataUnit.ts:1571
@@ -18,7 +18,7 @@
18
18
 
19
19
  #### Defined in
20
20
 
21
- src/dataunit/DataUnit.ts:1617
21
+ src/dataunit/DataUnit.ts:1667
22
22
 
23
23
  ___
24
24
 
@@ -28,7 +28,7 @@ ___
28
28
 
29
29
  #### Defined in
30
30
 
31
- src/dataunit/DataUnit.ts:1618
31
+ src/dataunit/DataUnit.ts:1668
32
32
 
33
33
  ___
34
34
 
@@ -38,4 +38,4 @@ ___
38
38
 
39
39
  #### Defined in
40
40
 
41
- src/dataunit/DataUnit.ts:1616
41
+ src/dataunit/DataUnit.ts:1666
package/.docs/modules.md CHANGED
@@ -14,6 +14,7 @@
14
14
  - [ChangeOperation](enums/ChangeOperation.md)
15
15
  - [DataType](enums/DataType.md)
16
16
  - [DependencyType](enums/DependencyType.md)
17
+ - [SelectionMode](enums/SelectionMode.md)
17
18
  - [SortMode](enums/SortMode.md)
18
19
  - [UserInterface](enums/UserInterface.md)
19
20
 
@@ -38,6 +39,7 @@
38
39
  - [ObjectUtils](classes/ObjectUtils.md)
39
40
  - [ReadyUtil](classes/ReadyUtil.md)
40
41
  - [RequestMetadata](classes/RequestMetadata.md)
42
+ - [SelectionInfo](classes/SelectionInfo.md)
41
43
  - [SkwHttpProvider](classes/SkwHttpProvider.md)
42
44
  - [StringUtils](classes/StringUtils.md)
43
45
  - [TimeFormatter](classes/TimeFormatter.md)
@@ -47,7 +49,6 @@
47
49
 
48
50
  ### Interfaces
49
51
 
50
- - [AllRecord](interfaces/AllRecord.md)
51
52
  - [ChildDescriptor](interfaces/ChildDescriptor.md)
52
53
  - [ChildLink](interfaces/ChildLink.md)
53
54
  - [DUActionInterceptor](interfaces/DUActionInterceptor.md)
package/README.md CHANGED
@@ -52,4 +52,6 @@ $ npm t
52
52
  $ npm run build --watch
53
53
  ```
54
54
 
55
- Veja mais informações em nossa [Wiki](https://git.sankhya.com.br/sankhyalabs/sankhyacore/-/wikis/Diretrizes-de-Codifica%C3%A7%C3%A3o)
55
+ Veja mais informações em nossa [Wiki](https://git.sankhya.com.br/sankhyalabs/sankhyacore/-/wikis/Diretrizes-de-Codifica%C3%A7%C3%A3o)
56
+
57
+
@@ -130,6 +130,7 @@ export default class DataUnit {
130
130
  *
131
131
  */
132
132
  previousPage(executionCtx?: ExecutionContext): Promise<LoadDataResponse | void>;
133
+ private getLoadDataRequest;
133
134
  private notifySavingData;
134
135
  /**
135
136
  *
@@ -429,79 +430,67 @@ export default class DataUnit {
429
430
  *
430
431
  */
431
432
  cancelWaitingChange(fieldName: string): void;
432
- /**
433
- * Obtém todos os registros selecionados.
434
- *
435
- * @returns - Lista de todos os registros selecionados.
436
- */
437
- getSelection(): Array<Record>;
438
433
  /**
439
434
  *
440
- * Seleciona múltiplos registros.
441
- *
442
- * @param selection - Registros para selecionar.
443
- * @param executionCtx - Contexto de execução da seleção dos registros do DataUnit.
435
+ * Seleciona o primeiro registro.
444
436
  *
445
- * @returns - Verdadeiro se ação executada.
437
+ * @param executionCtx - Contexto de execução da seleção do registro do DataUnit.
446
438
  *
447
439
  */
448
- setSelection(selection: Array<Record>, executionCtx?: ExecutionContext): Promise<boolean>;
440
+ selectFirst(executionCtx?: ExecutionContext): void;
449
441
  /**
450
442
  *
451
- * Remove a seleção de múltiplos registros.
452
- *
453
- * @param unselection - Registros para remover a seleção.
454
- * @param executionCtx - Contexto de execução da remoção da seleção dos registros do DataUnit.
443
+ * Seleciona o último registro.
455
444
  *
456
- * @returns - Verdadeiro se ação executada.
445
+ * @param executionCtx - Contexto de execução da seleção do registro do DataUnit.
457
446
  *
458
447
  */
459
- setUnselection(unselection: Array<Record>, executionCtx?: ExecutionContext): Promise<boolean>;
448
+ selectLast(executionCtx?: ExecutionContext): void;
460
449
  /**
461
450
  *
462
- * Remove a seleção de todos os registros.
463
- *
464
- * @param executionCtx - Contexto de execução da remoção da seleção dos registros do DataUnit.
451
+ * Seleciona múltiplos registros por índice.
465
452
  *
466
- * @returns - Verdadeiro se ação executada.
453
+ * @param selection - Índices desejados para a seleção.
454
+ * @param executionCtx - Contexto de execução da seleção do registro do DataUnit.
467
455
  *
468
456
  */
469
- clearSelection(executionCtx?: ExecutionContext): Promise<boolean>;
457
+ setSelectionByIndex(selection: Array<number>, executionCtx?: ExecutionContext): void;
470
458
  /**
471
459
  *
472
- * Seleciona o primeiro registro.
460
+ * Seleciona múltiplos registros por ID ou todos os registros (multipágina) .
461
+ *
462
+ * @param selection - IDs para selecionar ou o modo de seleção completo.
463
+ * @param executionCtx - Contexto de execução da seleção dos registros do DataUnit.
473
464
  *
474
- * @param executionCtx - Contexto de execução da seleção do registro do DataUnit.
475
465
  *
476
466
  */
477
- selectFirst(executionCtx?: ExecutionContext): void;
467
+ setSelection(selection: Array<string> | SelectionMode.ALL_RECORDS, executionCtx?: ExecutionContext): Promise<SelectionInfo>;
478
468
  /**
479
469
  *
480
- * Seleciona o último registro.
470
+ * Limpa a seleção.
481
471
  *
482
- * @param executionCtx - Contexto de execução da seleção do registro do DataUnit.
472
+ * @param executionCtx - Contexto de execução da seleção dos registros do DataUnit.
483
473
  *
484
474
  */
485
- selectLast(executionCtx?: ExecutionContext): void;
475
+ clearSelection(executionCtx?: ExecutionContext): void;
486
476
  /**
487
477
  *
488
- * Seleciona múltiplos registros por índice.
489
- *
490
- * @param selection - Índices desejados para a seleção.
491
- * @param executionCtx - Contexto de execução da seleção do registro do DataUnit.
478
+ * Atualiza a seleção dos registros atuais.
492
479
  *
493
- * @returns - Verdadeiro se ação executada.
480
+ * @param selection - IDs dos registros selecionados no snapshot atual
481
+ * @param executionCtx - Contexto de execução da seleção dos registros do DataUnit.
494
482
  *
483
+ * @returns - Informações sobre a seleção.
495
484
  */
496
- setSelectionByIndex(selection: Array<number>, executionCtx?: ExecutionContext): Promise<boolean>;
485
+ updatePageSelection(selection: Array<string>, executionCtx?: ExecutionContext): Promise<SelectionInfo | undefined>;
497
486
  /**
498
487
  *
499
- * Obtém os registros selecionados da página atual.
488
+ * Obtém informações sobre a seleção atual.
500
489
  *
501
- * @returns - Lista de registros selecionados da página atual.
490
+ * @returns - Objeto com informações como registros selecionados e seleção por critério.
502
491
  *
503
- */
504
- getSelectedRecords(): Array<Record> | undefined;
492
+ **/
493
+ getSelectionInfo(): SelectionInfo | undefined;
505
494
  /**
506
495
  *
507
496
  * Retorna apenas um registro selecionado no Dataunit
@@ -515,7 +504,6 @@ export default class DataUnit {
515
504
  * Limpa todos os registros do DataUnit
516
505
  *
517
506
  *
518
- *
519
507
  */
520
508
  clearDataUnit(): void;
521
509
  /**
@@ -773,6 +761,30 @@ export default class DataUnit {
773
761
  *
774
762
  */
775
763
  showField(fieldName: string): void;
764
+ /**
765
+ *
766
+ * Obtém todos os registros selecionados.
767
+ *
768
+ * @returns - Lista de registros selecionados.
769
+ *
770
+ * @deprecated - Utilize o método `getSelectionInfo()` para obter os registros selecionados.
771
+ * Devido a seleção virtual baseada em critérios e ordenação (ALL_RECORDS), esse
772
+ * método foi descontinuado e pode retornar erros no caso da seleção virtual.
773
+ *
774
+ */
775
+ getSelectedRecords(): Array<Record> | undefined;
776
+ /**
777
+ *
778
+ * Obtém ids dos registros selecionados.
779
+ *
780
+ * @returns - Lista com id de todos os registros selecionados.
781
+ *
782
+ * @deprecated - Utilize o método `getSelectionInfo()` para obter os registros selecionados.
783
+ * Devido a seleção virtual baseada em critérios e ordenação (ALL_RECORDS), esse
784
+ * método foi descontinuado e pode retornar erros no caso da seleção virtual.
785
+ *
786
+ */
787
+ getSelection(): Array<string>;
776
788
  }
777
789
  export interface DUActionInterceptor {
778
790
  interceptAction(action: DataUnitAction): DataUnitAction | Promise<DataUnitAction>;
@@ -787,10 +799,6 @@ export interface Record {
787
799
  export interface SavedRecord extends Record {
788
800
  __old__id__?: string;
789
801
  }
790
- export interface AllRecord extends Record {
791
- filter: Array<Filter>;
792
- sort: Array<Sort>;
793
- }
794
802
  export declare enum ChangeOperation {
795
803
  INSERT = "INSERT",
796
804
  COPY = "COPY",
@@ -870,3 +878,20 @@ export interface PageResponse {
870
878
  hasMore: boolean;
871
879
  records: Array<Record>;
872
880
  }
881
+ export declare enum SelectionMode {
882
+ ALL_RECORDS = "ALL_RECORDS",
883
+ SOME_RECORDS = "SOME_RECORDS"
884
+ }
885
+ export declare class SelectionInfo {
886
+ private _records;
887
+ mode: SelectionMode;
888
+ private _total?;
889
+ filters?: Array<Filter>;
890
+ sort?: Array<Sort>;
891
+ constructor(records: Array<Record>, mode?: SelectionMode, total?: number, filters?: Array<Filter>, sort?: Array<Sort>);
892
+ get records(): Array<Record> | undefined;
893
+ get recordIds(): Array<string> | undefined;
894
+ get length(): number;
895
+ isAllRecords(): boolean;
896
+ isEmpty(): boolean;
897
+ }