@sd-angular/core 19.0.0-beta.50 → 19.0.0-beta.51
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/components/table/src/components/column-filter/column-filter.component.d.ts +3 -3
- package/components/table/src/components/external-filter/external-filter.component.d.ts +1 -1
- package/components/table/src/models/table-column.model.d.ts +6 -7
- package/components/table/src/services/index.d.ts +3 -0
- package/components/table/src/services/table-export/table-export.service.d.ts +26 -0
- package/components/table/src/services/table-filter/table-filter.model.d.ts +3 -2
- package/components/table/src/services/table-format/table-format.service.d.ts +16 -0
- package/components/table/src/table.component.d.ts +9 -21
- package/fesm2022/sd-angular-core-components-table.mjs +911 -939
- package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs +19 -17
- package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-api.mjs +5 -10
- package/fesm2022/sd-angular-core-services-api.mjs.map +1 -1
- package/fesm2022/sd-angular-core-utilities-extensions.mjs +11 -39
- package/fesm2022/sd-angular-core-utilities-extensions.mjs.map +1 -1
- package/forms/select/src/select.component.d.ts +16 -14
- package/package.json +67 -67
- package/sd-angular-core-19.0.0-beta.51.tgz +0 -0
- package/services/api/src/api.model.d.ts +6 -1
- package/utilities/extensions/src/utility.extension.d.ts +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ChangeDetectorRef, EventEmitter, OnInit,
|
|
1
|
+
import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit, Signal } from '@angular/core';
|
|
2
2
|
import { SdSearch } from '@sd-angular/core/forms';
|
|
3
|
-
import { SdTableColumn } from '../../models/table-column.model';
|
|
4
3
|
import { SdOperator } from '@sd-angular/core/utilities';
|
|
4
|
+
import { SdTableColumn } from '../../models/table-column.model';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export declare class ColumnFilterComponent implements OnInit, OnDestroy {
|
|
7
7
|
#private;
|
|
@@ -22,7 +22,7 @@ export declare class ColumnFilterComponent implements OnInit, OnDestroy {
|
|
|
22
22
|
display: string;
|
|
23
23
|
}[];
|
|
24
24
|
column: SdTableColumn;
|
|
25
|
-
items: any[] | SdSearch;
|
|
25
|
+
items: any[] | Signal<any[]> | SdSearch;
|
|
26
26
|
cacheValues?: Record<string, any[]>;
|
|
27
27
|
set _column(column: SdTableColumn);
|
|
28
28
|
filterChange: EventEmitter<any>;
|
|
@@ -26,7 +26,7 @@ export declare class ExternalFilterComponent implements AfterViewInit, OnDestroy
|
|
|
26
26
|
ngAfterViewInit(): void;
|
|
27
27
|
ngOnDestroy(): void;
|
|
28
28
|
onKeyupEnter: () => void;
|
|
29
|
-
onFilter: () => void;
|
|
29
|
+
onFilter: (externalFilter: SdTableExternalFilter) => void;
|
|
30
30
|
onSubmit: () => void;
|
|
31
31
|
updateFilter: () => void;
|
|
32
32
|
clearFilter: (event?: Event) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
|
1
|
+
import { Signal, TemplateRef } from '@angular/core';
|
|
2
2
|
import { SdBadge } from '@sd-angular/core/components/badge';
|
|
3
3
|
import { SdSearch } from '@sd-angular/core/forms';
|
|
4
4
|
import { SdNestedKeyOf, SdOperator } from '@sd-angular/core/utilities';
|
|
@@ -82,9 +82,9 @@ export interface SdTableColumnValues<T = any, K = Record<string, any>> extends S
|
|
|
82
82
|
type: 'values';
|
|
83
83
|
useBadge?: UseBadgeValuesFunc<T, K>;
|
|
84
84
|
option: {
|
|
85
|
-
items: K[] | (() => Promise<K[]>);
|
|
86
|
-
valueField:
|
|
87
|
-
displayField:
|
|
85
|
+
items: K[] | Signal<K[]> | (() => Promise<K[]>);
|
|
86
|
+
valueField: SdNestedKeyOf<K>;
|
|
87
|
+
displayField: SdNestedKeyOf<K>;
|
|
88
88
|
selection?: 'MULTIPLE';
|
|
89
89
|
};
|
|
90
90
|
}
|
|
@@ -94,10 +94,9 @@ export interface SdTableColumnLazyValues<T = any, K = Record<string, any>> exten
|
|
|
94
94
|
useBadge?: UseBadgeFunc<T>;
|
|
95
95
|
option: {
|
|
96
96
|
items: SdSearch<K>;
|
|
97
|
-
valueField:
|
|
98
|
-
displayField:
|
|
97
|
+
valueField: SdNestedKeyOf<K>;
|
|
98
|
+
displayField: SdNestedKeyOf<K>;
|
|
99
99
|
views?: (values: string[]) => Promise<K[]>;
|
|
100
|
-
mapValue?: (value: any, rowData?: T) => string | string[];
|
|
101
100
|
selection?: 'MULTIPLE';
|
|
102
101
|
};
|
|
103
102
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SdExcelColumn } from '@sd-angular/core/services';
|
|
2
|
+
import { ConfiguredTableResult } from '../../models/table-option-config.model';
|
|
3
|
+
import { SdTableOption } from '../../models/table-option.model';
|
|
4
|
+
import { SdTableFilterRequest } from '../table-filter/table-filter.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export interface SdTableExportContext<T = any> {
|
|
7
|
+
option: SdTableOption<T>;
|
|
8
|
+
configuration?: ConfiguredTableResult;
|
|
9
|
+
total: number;
|
|
10
|
+
cacheObjValues: Record<string, Record<string, string>>;
|
|
11
|
+
fetchChunk: (pageNumber: number, pageSize: number) => Promise<T[] | {
|
|
12
|
+
items: any[];
|
|
13
|
+
total: number;
|
|
14
|
+
}>;
|
|
15
|
+
getFilterInfo: () => SdTableFilterRequest;
|
|
16
|
+
}
|
|
17
|
+
export declare class TableExportService {
|
|
18
|
+
#private;
|
|
19
|
+
exporting: import("@angular/core").WritableSignal<boolean>;
|
|
20
|
+
exportTitle: import("@angular/core").WritableSignal<string>;
|
|
21
|
+
exportExcel: (context: SdTableExportContext, columns?: SdExcelColumn[]) => Promise<void>;
|
|
22
|
+
exportCSV: (context: SdTableExportContext, columns?: SdExcelColumn[]) => Promise<void>;
|
|
23
|
+
exportCustom: (context: SdTableExportContext) => void;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableExportService, never>;
|
|
25
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TableExportService>;
|
|
26
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { SdTableColumn } from '../../models/table-column.model';
|
|
3
1
|
import { TemplateRef } from '@angular/core';
|
|
4
2
|
import { SdSearch } from '@sd-angular/core/forms';
|
|
5
3
|
import { SdNestedKeyOf, SdOperator, SdOrder, SdPagingReq } from '@sd-angular/core/utilities';
|
|
4
|
+
import { Observable } from 'rxjs';
|
|
5
|
+
import { SdTableColumn } from '../../models/table-column.model';
|
|
6
6
|
export interface SdTableQuickFilter {
|
|
7
7
|
code: string;
|
|
8
8
|
columnFilter: Record<string, any>;
|
|
@@ -68,6 +68,7 @@ interface BaseFilter<TData = any> {
|
|
|
68
68
|
hidden?: boolean;
|
|
69
69
|
defaultOperator?: SdOperator;
|
|
70
70
|
data?: TData;
|
|
71
|
+
onChange?: (value: any) => void;
|
|
71
72
|
}
|
|
72
73
|
interface TextFilter<TData = any> extends BaseFilter<TData> {
|
|
73
74
|
type: 'string';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SdTableColumn } from '../../models/table-column.model';
|
|
2
|
+
import { SdTableItem } from '../../models/table-item.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TableFormatService {
|
|
5
|
+
#private;
|
|
6
|
+
/**
|
|
7
|
+
* Tải và cache các giá trị từ điển cho cột 'values'
|
|
8
|
+
*/
|
|
9
|
+
loadValues(columns: SdTableColumn[], cacheValues: Record<string, any[]>, cacheObjValues: Record<string, Record<string, string>>): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Chuyển đổi dữ liệu thô thành SdTableItem kèm các thiết lập hiển thị (Display Meta)
|
|
12
|
+
*/
|
|
13
|
+
format<T = any>(rawItems: T[], columns: SdTableColumn[], cacheValues: Record<string, any[]>, cacheObjValues: Record<string, Record<string, string>>): Promise<SdTableItem<T>[]>;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableFormatService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TableFormatService>;
|
|
16
|
+
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { AfterViewInit,
|
|
1
|
+
import { AfterViewInit, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
|
|
3
3
|
import { MatSort } from '@angular/material/sort';
|
|
4
4
|
import { MatTable } from '@angular/material/table';
|
|
5
|
-
import { SdExcelColumn
|
|
5
|
+
import { SdExcelColumn } from '@sd-angular/core/services';
|
|
6
6
|
import { SdTabelCellDefDirective } from './directives/sd-table-cell-def.directive';
|
|
7
7
|
import { SdMaterialSubInformationDefDirective } from './directives/sd-table-expand-def.directive';
|
|
8
8
|
import { SdTableFilterDefDirective } from './directives/sd-table-filter-def.directive';
|
|
9
9
|
import { SdMaterialFooterDefDirective } from './directives/sd-table-footer-def.directive';
|
|
10
10
|
import { SdTableColumn } from './models/table-column.model';
|
|
11
11
|
import { SdTableOption } from './models/table-option.model';
|
|
12
|
-
import { TableFilterRegister } from './services/table-filter/table-filter.model';
|
|
12
|
+
import { SdTableFilterRequest, TableFilterRegister } from './services/table-filter/table-filter.model';
|
|
13
13
|
import { SdBaseSecureComponent } from '@sd-angular/core/components/base';
|
|
14
14
|
import { SdQuickAction } from '@sd-angular/core/components/quick-action';
|
|
15
15
|
import { SdScrollDirective } from '@sd-angular/core/directives';
|
|
16
|
-
import { SdFormatNumberPipe } from '@sd-angular/core/pipes';
|
|
17
16
|
import { SdOperator } from '@sd-angular/core/utilities';
|
|
18
17
|
import { ExternalFilterComponent } from './components';
|
|
19
18
|
import { ConfigComponent } from './components/config/config.component';
|
|
@@ -21,8 +20,6 @@ import { SdPopupExport } from './components/popup-export/popup-export.component'
|
|
|
21
20
|
import { ISdTableConfiguration } from './configurations';
|
|
22
21
|
import { SdTableItem } from './models/table-item.model';
|
|
23
22
|
import { ConfiguredTableResult } from './models/table-option-config.model';
|
|
24
|
-
import { ConfigService } from './services/config.service';
|
|
25
|
-
import { SdTableFilterService } from './services/table-filter/table-filter.service';
|
|
26
23
|
import * as i0 from "@angular/core";
|
|
27
24
|
export declare class MatPaginatorIntlCro extends MatPaginatorIntl {
|
|
28
25
|
firstPageLabel: string;
|
|
@@ -36,13 +33,6 @@ export declare class MatPaginatorIntlCro extends MatPaginatorIntl {
|
|
|
36
33
|
}
|
|
37
34
|
export declare class SdTable<T = unknown> extends SdBaseSecureComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
38
35
|
#private;
|
|
39
|
-
private ref;
|
|
40
|
-
private formatNumberPipe;
|
|
41
|
-
tableConfiguration: ISdTableConfiguration | undefined;
|
|
42
|
-
private configService;
|
|
43
|
-
private excelService;
|
|
44
|
-
private notifyService;
|
|
45
|
-
private gridFilterService;
|
|
46
36
|
autoIdInput: import("@angular/core").InputSignal<string | null | undefined>;
|
|
47
37
|
autoId: import("@angular/core").Signal<string | undefined>;
|
|
48
38
|
option: import("@angular/core").InputSignal<SdTableOption<T>>;
|
|
@@ -77,17 +67,15 @@ export declare class SdTable<T = unknown> extends SdBaseSecureComponent implemen
|
|
|
77
67
|
columnOperator: Record<string, SdOperator>;
|
|
78
68
|
columnFilter?: Record<string, any>;
|
|
79
69
|
cacheValues: Record<string, any[]>;
|
|
80
|
-
|
|
70
|
+
tableConfiguration: ISdTableConfiguration | null;
|
|
71
|
+
constructor();
|
|
81
72
|
ngOnInit(): void;
|
|
82
73
|
ngAfterViewInit(): void;
|
|
83
74
|
ngOnDestroy(): void;
|
|
75
|
+
getFilterRequest: () => SdTableFilterRequest;
|
|
84
76
|
reload: (force?: boolean, scrollTop?: boolean) => Promise<void>;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
isCSV?: boolean;
|
|
88
|
-
}) => Promise<void>;
|
|
89
|
-
exportExcel: () => Promise<void>;
|
|
90
|
-
exportCSV: () => Promise<void>;
|
|
77
|
+
exportExcel: (columns?: SdExcelColumn[]) => void;
|
|
78
|
+
exportCSV: (columns?: SdExcelColumn[]) => void;
|
|
91
79
|
exportCustom: () => void;
|
|
92
80
|
onFilterChange: () => void;
|
|
93
81
|
onExpand: (rowData: SdTableItem<T>) => Promise<void>;
|
|
@@ -104,6 +92,6 @@ export declare class SdTable<T = unknown> extends SdBaseSecureComponent implemen
|
|
|
104
92
|
detectChanges: () => void;
|
|
105
93
|
onOperatorChange: (column: SdTableColumn, operator: SdOperator) => void;
|
|
106
94
|
trackBy: (index: number, item: SdTableItem) => string;
|
|
107
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SdTable<any>,
|
|
95
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdTable<any>, never>;
|
|
108
96
|
static ɵcmp: i0.ɵɵComponentDeclaration<SdTable<any>, "sd-table", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "option": { "alias": "option"; "required": true; "isSignal": true; }; }, {}, ["sdSubInformation", "sdCellDefs", "sdFooterDefs", "sdFilterDefs"], ["[sdTableTop]"], true, never>;
|
|
109
97
|
}
|