@sdcorejs/angular 20.1.5 → 20.1.6
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/README.md +2 -4
- package/components/table/index.d.ts +1 -1
- package/fesm2022/sdcorejs-angular-components-preview.mjs +31 -2
- package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +18 -3
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +3 -4
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +122 -27
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-models.mjs +54 -2
- package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +20 -0
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +110 -25
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/forms/date/index.d.ts +8 -1
- package/forms/models/index.d.ts +28 -2
- package/i18n/index.d.ts +4 -0
- package/modules/layout/index.d.ts +10 -1
- package/package.json +9 -1
|
@@ -2553,11 +2553,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2553
2553
|
|
|
2554
2554
|
class TableExportService {
|
|
2555
2555
|
#excelService = inject(SdExcelService);
|
|
2556
|
+
#i18n = inject(I18nService);
|
|
2556
2557
|
// ==========================================
|
|
2557
2558
|
// SIGNAL STATE (Component sẽ bind trực tiếp vào đây)
|
|
2558
2559
|
// ==========================================
|
|
2559
2560
|
exporting = signal(false, ...(ngDevMode ? [{ debugName: "exporting" }] : []));
|
|
2560
|
-
|
|
2561
|
+
// Phần trăm tiến độ export; null = đang rảnh (nút hiện nhãn mặc định).
|
|
2562
|
+
#exportPercent = signal(null, ...(ngDevMode ? [{ debugName: "#exportPercent" }] : []));
|
|
2563
|
+
// WHY computed + i18n: trước đây đây là signal('Export') hard-code tiếng Anh nên
|
|
2564
|
+
// app chạy tiếng Việt vẫn hiện "Export". Đọc qua I18nService.t() để nhãn nút bám
|
|
2565
|
+
// theo catalog ngôn ngữ hiện tại.
|
|
2566
|
+
exportTitle = computed(() => {
|
|
2567
|
+
const percent = this.#exportPercent();
|
|
2568
|
+
return percent === null
|
|
2569
|
+
? this.#i18n.t('core.component.table.export')
|
|
2570
|
+
: this.#i18n.t('core.component.table.exporting', { percent });
|
|
2571
|
+
}, ...(ngDevMode ? [{ debugName: "exportTitle" }] : []));
|
|
2572
|
+
/** Đặt tiến độ export (0-100), hoặc null để trả nút về nhãn mặc định. */
|
|
2573
|
+
setExportProgress = (percent) => {
|
|
2574
|
+
this.#exportPercent.set(percent === null ? null : Math.min(Math.max(percent, 0), 100));
|
|
2575
|
+
};
|
|
2561
2576
|
// ==========================================
|
|
2562
2577
|
// PUBLIC METHODS
|
|
2563
2578
|
// ==========================================
|
|
@@ -2622,7 +2637,7 @@ class TableExportService {
|
|
|
2622
2637
|
const totalPage = Math.max(1, currentTotal / pageSize);
|
|
2623
2638
|
const percent = Math.round(((pageNumber - 1) * 100.0) / totalPage);
|
|
2624
2639
|
// Đảm bảo percent không vượt quá 100
|
|
2625
|
-
this.
|
|
2640
|
+
this.setExportProgress(percent);
|
|
2626
2641
|
const allColumns = this.#allColumns(option);
|
|
2627
2642
|
const allExportedColumns = this.#allExportedColumns(option);
|
|
2628
2643
|
for (const item of exportItems) {
|
|
@@ -2732,7 +2747,7 @@ class TableExportService {
|
|
|
2732
2747
|
}
|
|
2733
2748
|
finally {
|
|
2734
2749
|
this.exporting.set(false);
|
|
2735
|
-
this.
|
|
2750
|
+
this.setExportProgress(null);
|
|
2736
2751
|
}
|
|
2737
2752
|
}
|
|
2738
2753
|
#getExportColumns(context, explicitColumns) {
|