@ngrdt/table 0.0.80 → 0.0.81
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/fesm2022/ngrdt-table.mjs +13 -15
- package/fesm2022/ngrdt-table.mjs.map +1 -1
- package/index.d.ts +2 -1
- package/package.json +5 -5
package/fesm2022/ngrdt-table.mjs
CHANGED
|
@@ -13,22 +13,19 @@ import * as i4 from '@ngrdt/forms';
|
|
|
13
13
|
import { RdtCheckboxOutletDirective } from '@ngrdt/forms';
|
|
14
14
|
import * as i2 from '@ngrdt/icon';
|
|
15
15
|
import { RdtIconRegistryService, RdtIcon, RdtIconOutletDirective } from '@ngrdt/icon';
|
|
16
|
+
import { RdtTranslateService } from '@ngrdt/core';
|
|
16
17
|
import { RdtDateUtils, RdtObjectUtils } from '@ngrdt/utils';
|
|
17
18
|
import { of, delay, combineLatest, map } from 'rxjs';
|
|
18
19
|
import { toObservable } from '@angular/core/rxjs-interop';
|
|
19
20
|
import { GovDesignSystemModule } from '@gov-design-system-ce/angular';
|
|
20
21
|
|
|
21
|
-
const RDT_TABLE_PAGE_SIZE_OPTIONS = [20, 50, 100];
|
|
22
|
-
const RDT_TABLE_DEFAULT_PAGE_SIZE = RDT_TABLE_PAGE_SIZE_OPTIONS[0];
|
|
23
|
-
const RDT_TABLE_DEFAULT_NOT_FOUND_HEADER = 'Nic nenalezeno';
|
|
24
|
-
const RDT_TABLE_DEFAULT_NOT_FOUND_MESSAGE = 'Nepodařilo se dohledat žádné výsledky, zkuste prosím hledaný výraz upravit.';
|
|
25
|
-
const RDT_TABLE_DEFAULT_ERROR_MESSAGE = 'Při načítání dat došlo k chybě.';
|
|
26
|
-
const RDT_TABLE_DEFAULT_ERROR_HEADER = 'Chyba';
|
|
27
|
-
|
|
28
22
|
function isRdtTableMessage(obj) {
|
|
29
23
|
return (obj && typeof obj.header === 'string' && typeof obj.message === 'string');
|
|
30
24
|
}
|
|
31
25
|
|
|
26
|
+
const RDT_TABLE_PAGE_SIZE_OPTIONS = [20, 50, 100];
|
|
27
|
+
const RDT_TABLE_DEFAULT_PAGE_SIZE = RDT_TABLE_PAGE_SIZE_OPTIONS[0];
|
|
28
|
+
|
|
32
29
|
const rdtTableInitialState = {
|
|
33
30
|
ready: false,
|
|
34
31
|
pageIndex: 0,
|
|
@@ -310,14 +307,14 @@ function getRdtTableError(error) {
|
|
|
310
307
|
return error;
|
|
311
308
|
}
|
|
312
309
|
if (typeof error === 'string') {
|
|
313
|
-
return { message: error, header:
|
|
310
|
+
return { message: error, header: 'RDT_TABLE_ERROR_HEADER' };
|
|
314
311
|
}
|
|
315
312
|
if (error && typeof error === 'object' && 'message' in error) {
|
|
316
|
-
return { message: error.message, header:
|
|
313
|
+
return { message: error.message, header: 'RDT_TABLE_ERROR_HEADER' };
|
|
317
314
|
}
|
|
318
315
|
return {
|
|
319
|
-
header:
|
|
320
|
-
message:
|
|
316
|
+
header: 'RDT_TABLE_ERROR_HEADER',
|
|
317
|
+
message: 'RDT_TABLE_ERROR_MESSAGE',
|
|
321
318
|
};
|
|
322
319
|
}
|
|
323
320
|
|
|
@@ -453,6 +450,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
|
|
|
453
450
|
}] });
|
|
454
451
|
|
|
455
452
|
class RdtStaticColumnBuilder extends RdtBaseColumnBuilder {
|
|
453
|
+
translateService = inject(RdtTranslateService);
|
|
456
454
|
_dataType = 'string';
|
|
457
455
|
_valueFormatter;
|
|
458
456
|
_tooltipFormatter;
|
|
@@ -539,12 +537,12 @@ class RdtStaticColumnBuilder extends RdtBaseColumnBuilder {
|
|
|
539
537
|
case 'true':
|
|
540
538
|
case 1:
|
|
541
539
|
case '1':
|
|
542
|
-
return '
|
|
540
|
+
return this.translateService.instant('RDT_YES');
|
|
543
541
|
case false:
|
|
544
542
|
case 'false':
|
|
545
543
|
case 0:
|
|
546
544
|
case '0':
|
|
547
|
-
return '
|
|
545
|
+
return this.translateService.instant('RDT_NO');
|
|
548
546
|
default:
|
|
549
547
|
return '';
|
|
550
548
|
}
|
|
@@ -682,8 +680,8 @@ class RdtTableComponent {
|
|
|
682
680
|
autoSize = input(true, { transform: booleanAttribute });
|
|
683
681
|
displayedColumns = input(undefined);
|
|
684
682
|
notFoundConfig = input({
|
|
685
|
-
header:
|
|
686
|
-
message:
|
|
683
|
+
header: 'RDT_TABLE_NOT_FOUND_HEADER',
|
|
684
|
+
message: 'RDT_TABLE_NOT_FOUND_MESSAGE',
|
|
687
685
|
});
|
|
688
686
|
usesDoubleClickInput = input(false, {
|
|
689
687
|
transform: booleanAttribute,
|