@sd-angular/core 19.0.39 → 19.0.41

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 (24) hide show
  1. package/components/table/src/components/desktop-cell/desktop-cell.component.d.ts +1 -1
  2. package/components/table/src/services/field-value.util.d.ts +14 -0
  3. package/fesm2022/sd-angular-core-components-table.mjs +105 -11
  4. package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
  5. package/fesm2022/sd-angular-core-components-upload-file.mjs +5 -0
  6. package/fesm2022/sd-angular-core-components-upload-file.mjs.map +1 -1
  7. package/fesm2022/sd-angular-core-modules-auth.mjs.map +1 -1
  8. package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
  9. package/fesm2022/sd-angular-core-modules-permission.mjs.map +1 -1
  10. package/fesm2022/sd-angular-core-services-api.mjs +211 -8
  11. package/fesm2022/sd-angular-core-services-api.mjs.map +1 -1
  12. package/fesm2022/sd-angular-core-services-excel.mjs +5 -0
  13. package/fesm2022/sd-angular-core-services-excel.mjs.map +1 -1
  14. package/fesm2022/sd-angular-core-utilities-models.mjs.map +1 -1
  15. package/modules/auth/configurations/auth.configuration.d.ts +4 -3
  16. package/modules/layout/configurations/layout.configuration.d.ts +3 -2
  17. package/modules/permission/src/configurations/permission.configuration.d.ts +3 -2
  18. package/package.json +10 -10
  19. package/services/api/index.d.ts +1 -0
  20. package/services/api/src/api-handler-registry.d.ts +49 -0
  21. package/services/api/src/api-handler-selection.d.ts +10 -0
  22. package/services/api/src/api-route-configurations.d.ts +20 -0
  23. package/services/api/src/api.model.d.ts +7 -0
  24. package/utilities/models/src/maybe-async.model.d.ts +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sd-angular-core-services-excel.mjs","sources":["../../../projects/sd-angular/services/excel/src/lib/spreadsheet-formula-injection.util.ts","../../../projects/sd-angular/services/excel/src/lib/excel.service.ts","../../../projects/sd-angular/services/excel/sd-angular-core-services-excel.ts"],"sourcesContent":["const DANGEROUS_SPREADSHEET_FORMULA_PREFIX = /^[=+\\-@\\t\\r\\n]/;\n\n/**\n * Prefix spreadsheet formula-like strings so exported files treat them as text.\n */\nexport function neutralizeSpreadsheetFormula(value: string): string;\nexport function neutralizeSpreadsheetFormula<T>(value: T): T;\nexport function neutralizeSpreadsheetFormula(value: unknown): unknown {\n if (typeof value !== 'string' || value === '' || value.startsWith(\"'\")) {\n return value;\n }\n\n return DANGEROUS_SPREADSHEET_FORMULA_PREFIX.test(value) ? `'${value}` : value;\n}\n","import { inject, Injectable } from '@angular/core';\nimport type { CellValue, Style } from 'exceljs';\n// import hash from 'object-hash';\nimport { DateUtilities } from '@sd-angular/core/utilities/extensions';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\nimport { I18nService } from '@sd-angular/core/i18n';\nimport { SdExcelExportOption, SdExcelTemplate } from './excel.model';\nimport { neutralizeSpreadsheetFormula } from './spreadsheet-formula-injection.util';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SdExcelService {\n readonly #i18n = inject(I18nService);\n #fieldStyle: Partial<Style> = {\n border: {\n bottom: { style: 'thin' },\n left: { style: 'thin' },\n right: { style: 'thin' },\n },\n alignment: {\n vertical: 'middle',\n horizontal: 'center',\n wrapText: true,\n },\n font: {\n bold: true,\n size: 11,\n color: { argb: '000000' },\n },\n fill: {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {\n argb: 'FAFAFA',\n },\n },\n };\n #titleColor = 'FFFFFF';\n #titleFgColor = '143180';\n #titleStyle: Partial<Style> = {\n border: {\n bottom: { style: 'thin' },\n left: { style: 'thin' },\n right: { style: 'thin' },\n },\n alignment: {\n vertical: 'middle',\n horizontal: 'center',\n wrapText: true,\n },\n font: {\n bold: true,\n size: 11,\n color: { argb: this.#titleColor },\n },\n fill: {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {\n argb: this.#titleFgColor,\n },\n },\n };\n\n #requiredStyle: Partial<Style> = {\n border: {\n bottom: { style: 'thin' },\n left: { style: 'thin' },\n right: { style: 'thin' },\n },\n alignment: {\n vertical: 'middle',\n horizontal: 'center',\n wrapText: true,\n },\n font: {\n italic: true,\n size: 11,\n color: { argb: 'FFFFFF' },\n },\n fill: {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {\n argb: 'FF1744',\n },\n },\n };\n\n #descriptionStyle: Partial<Style> = {\n border: {\n bottom: { style: 'thin' },\n left: { style: 'thin' },\n right: { style: 'thin' },\n },\n alignment: {\n wrapText: true,\n },\n font: {\n italic: true,\n size: 9,\n color: { argb: '000000' },\n },\n fill: {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {\n argb: 'CFD8DC',\n },\n },\n };\n\n #cellStyle: Partial<Style> = {\n alignment: {\n vertical: 'middle',\n wrapText: true,\n },\n };\n\n // exceljs là CJS module — khi dynamic import từ ESM, named export `Workbook`\n // có thể nằm trên `mod.Workbook` hoặc bị bọc trong `mod.default.Workbook` tuỳ bundler.\n // Helper này chuẩn hoá cả hai trường hợp.\n async #loadWorkbook(): Promise<new () => import('exceljs').Workbook> {\n const mod = (await import('exceljs')) as typeof import('exceljs') & {\n default?: typeof import('exceljs');\n };\n return mod.Workbook ?? mod.default?.Workbook;\n }\n\n generateTemplate = async (template: SdExcelTemplate) => {\n const { fileName, columns, sheets } = template;\n if (!Array.isArray(columns)) {\n throw new Error('Excel template columns must be an array');\n }\n for (const [idx, column] of columns.entries()) {\n if (!column.field) {\n throw new Error(`Column ${idx + 1}: Field is required`);\n }\n if (!column.title) {\n throw new Error(`Column ${idx + 1}: Title is required`);\n }\n }\n const hasDescription = columns.some(column => column.description);\n const Workbook = await this.#loadWorkbook();\n const workbook = new Workbook();\n const firstSheet = workbook.addWorksheet('template'); // Lấy ra sheet đầu tiên\n columns.forEach((column, index) => {\n const { required, fill, fontColor } = column;\n const cellField = firstSheet.getCell(1, index + 1);\n const cellTitle = firstSheet.getCell(2, index + 1);\n const cellDescription = firstSheet.getCell(3, index + 1);\n let width = 120;\n if (column.width && column.width.endsWith('px')) {\n width = +column.width.replace('px', '');\n }\n firstSheet.getColumn(index + 1).width = width / 7 || 20;\n cellField.style = this.#fieldStyle;\n if (required) {\n cellField.style = this.#requiredStyle;\n } else {\n cellField.style = this.#fieldStyle;\n }\n cellTitle.style = {\n ...this.#titleStyle,\n font: {\n ...this.#titleStyle?.font,\n color: {\n ...this.#titleStyle?.font?.color,\n argb: fontColor || this.#titleStyle?.font?.color?.argb,\n },\n },\n fill: {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {\n argb: fill || this.#titleFgColor,\n },\n },\n };\n cellField.value = neutralizeSpreadsheetFormula(column.field);\n cellTitle.value = neutralizeSpreadsheetFormula(column.title);\n if (hasDescription) {\n cellDescription.style = this.#descriptionStyle;\n cellDescription.value = neutralizeSpreadsheetFormula(column.description || '');\n }\n });\n if (sheets?.length) {\n for (const sheet of sheets) {\n if (sheet.name && Array.isArray(sheet.items) && Array.isArray(sheet.headers)) {\n const newSheet = workbook.addWorksheet(sheet.name);\n sheet.headers.forEach((header, index) => {\n newSheet.getColumn(index + 1).width = 30;\n newSheet.getCell(1, index + 1).style = this.#titleStyle;\n newSheet.getCell(1, index + 1).value = neutralizeSpreadsheetFormula(header.value);\n newSheet.getCell(2, index + 1).style = this.#titleStyle;\n newSheet.getCell(2, index + 1).value = neutralizeSpreadsheetFormula(header.display || header.value);\n });\n sheet.items.forEach((item, idx1) => {\n sheet.headers.forEach((header, idx2) => {\n newSheet.getCell(3 + idx1, 1 + idx2).value = neutralizeSpreadsheetFormula(item[header.value]) as CellValue;\n newSheet.getCell(3 + idx1, 1 + idx2).style = this.#cellStyle;\n });\n });\n }\n }\n }\n const file = await workbook.xlsx.writeBuffer();\n BrowserUtilities.downloadBlob(\n new Blob([file], {\n type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n }),\n fileName\n );\n };\n\n exportCSV = async (option: SdExcelExportOption): Promise<void> => {\n const { columns, items, fileName } = option;\n const filename = `${fileName || 'CSV'}_${DateUtilities.toFormat(new Date(), 'yyyy-MM-dd-HH-mm-ss')}.csv`;\n\n // Escape CSV cell: bọc trong dấu \" nếu chứa dấu phẩy / xuống dòng / dấu ngoặc kép.\n // Dấu \" bên trong được nhân đôi theo chuẩn RFC 4180.\n const escape = (v: unknown): string => {\n if (v == null) return '';\n const s = typeof v === 'string' ? neutralizeSpreadsheetFormula(v) : String(v);\n return /[\",\\n\\r]/.test(s) ? `\"${s.replace(/\"/g, '\"\"')}\"` : s;\n };\n\n const headerLine = columns.map(c => escape(c.title)).join(',');\n const dataLines = items.map(item => columns.map(c => escape((item as Record<string, unknown>)[c.field])).join(','));\n\n // Prepend UTF-8 BOM so Excel opens Vietnamese text with the correct encoding.\n // Dùng CRLF vì Excel trên Windows ưu tiên, macOS Excel cũng chấp nhận.\n const csv = '\\uFEFF' + [headerLine, ...dataLines].join('\\r\\n');\n\n BrowserUtilities.downloadBlob(new Blob([csv], { type: 'text/csv;charset=utf-8;' }), filename);\n };\n\n export = async (option: SdExcelExportOption) => {\n const { columns, items, fileName, sheets } = option;\n let hasDescription = false;\n for (const [idx, column] of columns.entries()) {\n if (!column.field) {\n throw new Error(`Column ${idx + 1}: Field is required`);\n }\n if (!column.title) {\n throw new Error(`Column ${idx + 1}: Title is required`);\n }\n if (column.description) {\n hasDescription = true;\n }\n }\n const Workbook = await this.#loadWorkbook();\n const workbook = new Workbook(); //await XlsxPopulate.fromBlankAsync(); // Đọc file sau khi đã download\n const firstSheet = workbook.addWorksheet('data'); // Lấy ra sheet đầu tiên\n columns.forEach((column, index) => {\n let width = 120;\n if (column.width && column.width.endsWith('px')) {\n width = +column.width.replace('px', '');\n }\n firstSheet.getColumn(index + 1).width = width / 7 || 20;\n firstSheet.getCell(1, index + 1).style = this.#fieldStyle;\n if (column.required) {\n firstSheet.getCell(2, index + 1).style = this.#requiredStyle;\n } else {\n firstSheet.getCell(2, index + 1).style = this.#titleStyle;\n }\n firstSheet.getCell(1, index + 1).value = neutralizeSpreadsheetFormula(column.field);\n firstSheet.getCell(2, index + 1).value = neutralizeSpreadsheetFormula(column.title);\n if (hasDescription) {\n firstSheet.getCell(3, index + 1).style = this.#descriptionStyle;\n firstSheet.getCell(3, index + 1).value = neutralizeSpreadsheetFormula(column.description || '');\n }\n });\n if (sheets?.length) {\n for (const sheet of sheets) {\n if (sheet.name && Array.isArray(sheet.items) && Array.isArray(sheet.headers)) {\n const newSheet = workbook.addWorksheet(sheet.name);\n sheet.headers.forEach((header, index) => {\n newSheet.getColumn(index + 1).width = 30;\n newSheet.getCell(1, index + 1).style = this.#titleStyle;\n newSheet.getCell(1, index + 1).value = neutralizeSpreadsheetFormula(header.value);\n newSheet.getCell(2, index + 1).style = this.#titleStyle;\n newSheet.getCell(2, index + 1).value = neutralizeSpreadsheetFormula(header.display || header.value);\n });\n sheet.items.forEach((item, idx1) => {\n sheet.headers.forEach((header, idx2) => {\n newSheet.getCell(3 + idx1, 1 + idx2).value = neutralizeSpreadsheetFormula(item[header.value]) as CellValue;\n newSheet.getCell(3 + idx1, 1 + idx2).style = this.#cellStyle;\n });\n });\n }\n }\n }\n\n const fromRow = hasDescription ? 4 : 3;\n items.forEach((e, idx1) => {\n columns.forEach((column, idx2) => {\n if (typeof e[column.field] === 'number') {\n // Format mặc định với kiểu số\n firstSheet.getCell(fromRow + idx1, 1 + idx2).value = +e[column.field];\n firstSheet.getCell(fromRow + idx1, 1 + idx2).numFmt = '#';\n } else {\n firstSheet.getCell(fromRow + idx1, 1 + idx2).value = neutralizeSpreadsheetFormula(e[column.field]) as CellValue;\n }\n firstSheet.getCell(fromRow + idx1, 1 + idx2).style = {\n ...this.#cellStyle,\n };\n });\n });\n const file = await workbook.xlsx.writeBuffer();\n BrowserUtilities.downloadBlob(\n new Blob([file], {\n type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n }),\n fileName\n );\n };\n\n // Helper để lấy giá trị text chuẩn từ ô Excel (xử lý RichText, Formula, Hyperlink)\n #getCellValue = (value: CellValue): string | number | null | undefined | boolean | Date => {\n if (value && typeof value === 'object') {\n // Xử lý Rich Text (vd: ô bôi đậm)\n if ('richText' in value) {\n return value.richText.map(t => t.text).join('');\n }\n // Xử lý Hyperlink\n if ('text' in value) {\n return value.text as string; // hoặc value.result nếu là công thức\n }\n // Xử lý Formula\n if ('result' in value) {\n return value.result as string | number | null | undefined | boolean | Date;\n }\n }\n return value as string | number | null | undefined | boolean | Date;\n };\n upload = async (): Promise<{ items: Record<string, any>[]; file: File | null }> => {\n try {\n const fileResult = await BrowserUtilities.upload({\n extensions: ['xlsx'],\n maxSizeInMb: 10,\n });\n\n // Chuẩn hóa file đầu vào (nếu upload trả về mảng thì lấy phần tử đầu)\n const file = Array.isArray(fileResult) ? fileResult[0] : fileResult;\n\n if (!file) {\n return { items: [], file: null };\n }\n\n return await this.parse(file);\n } catch (error) {\n console.error('Upload error:', error);\n throw error; // Hoặc return { items: [], file: null } tùy logic nghiệp vụ\n }\n };\n parse = async (file: File): Promise<{ items: Record<string, any>[]; file: File | null }> => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = async e => {\n try {\n const buffer = e.target?.result as ArrayBuffer;\n if (!buffer) {\n throw new Error(this.#i18n.t('core.excel.cannot-read-file'));\n }\n\n const Workbook = await this.#loadWorkbook();\n const wb = new Workbook();\n await wb.xlsx.load(buffer);\n\n const sheet = wb.worksheets[0];\n if (!sheet) {\n throw new Error(this.#i18n.t('core.excel.no-sheet'));\n }\n\n const items: Record<string, any>[] = [];\n\n // Lấy row Header (Row 1)\n const headerRow = sheet.getRow(1);\n // Map: Column Index (bắt đầu từ 1) -> Tên trường (Key)\n const headerMap: Record<number, string> = {};\n\n // Duyệt qua các ô có dữ liệu thực tế của dòng Header\n headerRow.eachCell((cell, colNumber) => {\n const cellValue = this.#getCellValue(cell.value);\n if (cellValue) {\n // Ép kiểu về string và trim để làm key\n headerMap[colNumber] = String(cellValue).trim();\n }\n });\n\n // Duyệt dữ liệu từ dòng 2 trở đi\n sheet.eachRow((row, rowIndex) => {\n if (rowIndex <= 1 || !row.hasValues) return;\n\n const item: Record<string, any> = {};\n\n // Chỉ duyệt qua các cột đã định nghĩa trong headerMap\n // Cách này an toàn hơn là duyệt mảng values\n Object.keys(headerMap).forEach(colKey => {\n const colNumber = Number(colKey);\n const fieldKey = headerMap[colNumber];\n\n // Lấy giá trị ô tại cột tương ứng\n const rawValue = this.#getCellValue(row.getCell(colNumber).value);\n\n let finalValue = rawValue;\n\n // Xử lý string: trim\n if (typeof finalValue === 'string') {\n finalValue = finalValue.trim();\n }\n\n // Xử lý các keyword đặc biệt\n if (finalValue === '' || finalValue === undefined) {\n finalValue = null;\n } else if (finalValue === 'SET_NULL') {\n finalValue = null;\n } else if (finalValue === 'SET_EMPTY') {\n finalValue = '';\n }\n\n item[fieldKey] = finalValue;\n });\n\n // Chỉ push nếu item có dữ liệu (tùy chọn)\n if (Object.keys(item).length > 0) {\n items.push(item);\n }\n });\n\n resolve({ items, file });\n } catch (err) {\n reject(err);\n }\n };\n\n reader.onerror = error => reject(error);\n reader.readAsArrayBuffer(file);\n });\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA,MAAM,oCAAoC,GAAG,gBAAgB;AAOvD,SAAU,4BAA4B,CAAC,KAAc,EAAA;AACzD,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AACtE,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,OAAO,oCAAoC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE,GAAG,KAAK;AAC/E;;MCDa,cAAc,CAAA;AAChB,IAAA,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC;AACpC,IAAA,WAAW,GAAmB;AAC5B,QAAA,MAAM,EAAE;AACN,YAAA,MAAM,EAAE,EAAE,KAAK,EAAE,MA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AAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACXD;;AAEG;;;;"}
1
+ {"version":3,"file":"sd-angular-core-services-excel.mjs","sources":["../../../projects/sd-angular/services/excel/src/lib/spreadsheet-formula-injection.util.ts","../../../projects/sd-angular/services/excel/src/lib/excel.service.ts","../../../projects/sd-angular/services/excel/sd-angular-core-services-excel.ts"],"sourcesContent":["const DANGEROUS_SPREADSHEET_FORMULA_PREFIX = /^[=+\\-@\\t\\r\\n]/;\n\n/**\n * Prefix spreadsheet formula-like strings so exported files treat them as text.\n */\nexport function neutralizeSpreadsheetFormula(value: string): string;\nexport function neutralizeSpreadsheetFormula<T>(value: T): T;\nexport function neutralizeSpreadsheetFormula(value: unknown): unknown {\n if (typeof value !== 'string' || value === '' || value.startsWith(\"'\")) {\n return value;\n }\n\n return DANGEROUS_SPREADSHEET_FORMULA_PREFIX.test(value) ? `'${value}` : value;\n}\n","import { inject, Injectable } from '@angular/core';\nimport type { CellValue, Style } from 'exceljs';\n// import hash from 'object-hash';\nimport { DateUtilities } from '@sd-angular/core/utilities/extensions';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\nimport { FilePickerCancelledError } from '@sdcorejs/utils/errors';\nimport { I18nService } from '@sd-angular/core/i18n';\nimport { SdExcelExportOption, SdExcelTemplate } from './excel.model';\nimport { neutralizeSpreadsheetFormula } from './spreadsheet-formula-injection.util';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SdExcelService {\n readonly #i18n = inject(I18nService);\n #fieldStyle: Partial<Style> = {\n border: {\n bottom: { style: 'thin' },\n left: { style: 'thin' },\n right: { style: 'thin' },\n },\n alignment: {\n vertical: 'middle',\n horizontal: 'center',\n wrapText: true,\n },\n font: {\n bold: true,\n size: 11,\n color: { argb: '000000' },\n },\n fill: {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {\n argb: 'FAFAFA',\n },\n },\n };\n #titleColor = 'FFFFFF';\n #titleFgColor = '143180';\n #titleStyle: Partial<Style> = {\n border: {\n bottom: { style: 'thin' },\n left: { style: 'thin' },\n right: { style: 'thin' },\n },\n alignment: {\n vertical: 'middle',\n horizontal: 'center',\n wrapText: true,\n },\n font: {\n bold: true,\n size: 11,\n color: { argb: this.#titleColor },\n },\n fill: {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {\n argb: this.#titleFgColor,\n },\n },\n };\n\n #requiredStyle: Partial<Style> = {\n border: {\n bottom: { style: 'thin' },\n left: { style: 'thin' },\n right: { style: 'thin' },\n },\n alignment: {\n vertical: 'middle',\n horizontal: 'center',\n wrapText: true,\n },\n font: {\n italic: true,\n size: 11,\n color: { argb: 'FFFFFF' },\n },\n fill: {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {\n argb: 'FF1744',\n },\n },\n };\n\n #descriptionStyle: Partial<Style> = {\n border: {\n bottom: { style: 'thin' },\n left: { style: 'thin' },\n right: { style: 'thin' },\n },\n alignment: {\n wrapText: true,\n },\n font: {\n italic: true,\n size: 9,\n color: { argb: '000000' },\n },\n fill: {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {\n argb: 'CFD8DC',\n },\n },\n };\n\n #cellStyle: Partial<Style> = {\n alignment: {\n vertical: 'middle',\n wrapText: true,\n },\n };\n\n // exceljs là CJS module — khi dynamic import từ ESM, named export `Workbook`\n // có thể nằm trên `mod.Workbook` hoặc bị bọc trong `mod.default.Workbook` tuỳ bundler.\n // Helper này chuẩn hoá cả hai trường hợp.\n async #loadWorkbook(): Promise<new () => import('exceljs').Workbook> {\n const mod = (await import('exceljs')) as typeof import('exceljs') & {\n default?: typeof import('exceljs');\n };\n return mod.Workbook ?? mod.default?.Workbook;\n }\n\n generateTemplate = async (template: SdExcelTemplate) => {\n const { fileName, columns, sheets } = template;\n if (!Array.isArray(columns)) {\n throw new Error('Excel template columns must be an array');\n }\n for (const [idx, column] of columns.entries()) {\n if (!column.field) {\n throw new Error(`Column ${idx + 1}: Field is required`);\n }\n if (!column.title) {\n throw new Error(`Column ${idx + 1}: Title is required`);\n }\n }\n const hasDescription = columns.some(column => column.description);\n const Workbook = await this.#loadWorkbook();\n const workbook = new Workbook();\n const firstSheet = workbook.addWorksheet('template'); // Lấy ra sheet đầu tiên\n columns.forEach((column, index) => {\n const { required, fill, fontColor } = column;\n const cellField = firstSheet.getCell(1, index + 1);\n const cellTitle = firstSheet.getCell(2, index + 1);\n const cellDescription = firstSheet.getCell(3, index + 1);\n let width = 120;\n if (column.width && column.width.endsWith('px')) {\n width = +column.width.replace('px', '');\n }\n firstSheet.getColumn(index + 1).width = width / 7 || 20;\n cellField.style = this.#fieldStyle;\n if (required) {\n cellField.style = this.#requiredStyle;\n } else {\n cellField.style = this.#fieldStyle;\n }\n cellTitle.style = {\n ...this.#titleStyle,\n font: {\n ...this.#titleStyle?.font,\n color: {\n ...this.#titleStyle?.font?.color,\n argb: fontColor || this.#titleStyle?.font?.color?.argb,\n },\n },\n fill: {\n type: 'pattern',\n pattern: 'solid',\n fgColor: {\n argb: fill || this.#titleFgColor,\n },\n },\n };\n cellField.value = neutralizeSpreadsheetFormula(column.field);\n cellTitle.value = neutralizeSpreadsheetFormula(column.title);\n if (hasDescription) {\n cellDescription.style = this.#descriptionStyle;\n cellDescription.value = neutralizeSpreadsheetFormula(column.description || '');\n }\n });\n if (sheets?.length) {\n for (const sheet of sheets) {\n if (sheet.name && Array.isArray(sheet.items) && Array.isArray(sheet.headers)) {\n const newSheet = workbook.addWorksheet(sheet.name);\n sheet.headers.forEach((header, index) => {\n newSheet.getColumn(index + 1).width = 30;\n newSheet.getCell(1, index + 1).style = this.#titleStyle;\n newSheet.getCell(1, index + 1).value = neutralizeSpreadsheetFormula(header.value);\n newSheet.getCell(2, index + 1).style = this.#titleStyle;\n newSheet.getCell(2, index + 1).value = neutralizeSpreadsheetFormula(header.display || header.value);\n });\n sheet.items.forEach((item, idx1) => {\n sheet.headers.forEach((header, idx2) => {\n newSheet.getCell(3 + idx1, 1 + idx2).value = neutralizeSpreadsheetFormula(item[header.value]) as CellValue;\n newSheet.getCell(3 + idx1, 1 + idx2).style = this.#cellStyle;\n });\n });\n }\n }\n }\n const file = await workbook.xlsx.writeBuffer();\n BrowserUtilities.downloadBlob(\n new Blob([file], {\n type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n }),\n fileName\n );\n };\n\n exportCSV = async (option: SdExcelExportOption): Promise<void> => {\n const { columns, items, fileName } = option;\n const filename = `${fileName || 'CSV'}_${DateUtilities.toFormat(new Date(), 'yyyy-MM-dd-HH-mm-ss')}.csv`;\n\n // Escape CSV cell: bọc trong dấu \" nếu chứa dấu phẩy / xuống dòng / dấu ngoặc kép.\n // Dấu \" bên trong được nhân đôi theo chuẩn RFC 4180.\n const escape = (v: unknown): string => {\n if (v == null) return '';\n const s = typeof v === 'string' ? neutralizeSpreadsheetFormula(v) : String(v);\n return /[\",\\n\\r]/.test(s) ? `\"${s.replace(/\"/g, '\"\"')}\"` : s;\n };\n\n const headerLine = columns.map(c => escape(c.title)).join(',');\n const dataLines = items.map(item => columns.map(c => escape((item as Record<string, unknown>)[c.field])).join(','));\n\n // Prepend UTF-8 BOM so Excel opens Vietnamese text with the correct encoding.\n // Dùng CRLF vì Excel trên Windows ưu tiên, macOS Excel cũng chấp nhận.\n const csv = '\\uFEFF' + [headerLine, ...dataLines].join('\\r\\n');\n\n BrowserUtilities.downloadBlob(new Blob([csv], { type: 'text/csv;charset=utf-8;' }), filename);\n };\n\n export = async (option: SdExcelExportOption) => {\n const { columns, items, fileName, sheets } = option;\n let hasDescription = false;\n for (const [idx, column] of columns.entries()) {\n if (!column.field) {\n throw new Error(`Column ${idx + 1}: Field is required`);\n }\n if (!column.title) {\n throw new Error(`Column ${idx + 1}: Title is required`);\n }\n if (column.description) {\n hasDescription = true;\n }\n }\n const Workbook = await this.#loadWorkbook();\n const workbook = new Workbook(); //await XlsxPopulate.fromBlankAsync(); // Đọc file sau khi đã download\n const firstSheet = workbook.addWorksheet('data'); // Lấy ra sheet đầu tiên\n columns.forEach((column, index) => {\n let width = 120;\n if (column.width && column.width.endsWith('px')) {\n width = +column.width.replace('px', '');\n }\n firstSheet.getColumn(index + 1).width = width / 7 || 20;\n firstSheet.getCell(1, index + 1).style = this.#fieldStyle;\n if (column.required) {\n firstSheet.getCell(2, index + 1).style = this.#requiredStyle;\n } else {\n firstSheet.getCell(2, index + 1).style = this.#titleStyle;\n }\n firstSheet.getCell(1, index + 1).value = neutralizeSpreadsheetFormula(column.field);\n firstSheet.getCell(2, index + 1).value = neutralizeSpreadsheetFormula(column.title);\n if (hasDescription) {\n firstSheet.getCell(3, index + 1).style = this.#descriptionStyle;\n firstSheet.getCell(3, index + 1).value = neutralizeSpreadsheetFormula(column.description || '');\n }\n });\n if (sheets?.length) {\n for (const sheet of sheets) {\n if (sheet.name && Array.isArray(sheet.items) && Array.isArray(sheet.headers)) {\n const newSheet = workbook.addWorksheet(sheet.name);\n sheet.headers.forEach((header, index) => {\n newSheet.getColumn(index + 1).width = 30;\n newSheet.getCell(1, index + 1).style = this.#titleStyle;\n newSheet.getCell(1, index + 1).value = neutralizeSpreadsheetFormula(header.value);\n newSheet.getCell(2, index + 1).style = this.#titleStyle;\n newSheet.getCell(2, index + 1).value = neutralizeSpreadsheetFormula(header.display || header.value);\n });\n sheet.items.forEach((item, idx1) => {\n sheet.headers.forEach((header, idx2) => {\n newSheet.getCell(3 + idx1, 1 + idx2).value = neutralizeSpreadsheetFormula(item[header.value]) as CellValue;\n newSheet.getCell(3 + idx1, 1 + idx2).style = this.#cellStyle;\n });\n });\n }\n }\n }\n\n const fromRow = hasDescription ? 4 : 3;\n items.forEach((e, idx1) => {\n columns.forEach((column, idx2) => {\n if (typeof e[column.field] === 'number') {\n // Format mặc định với kiểu số\n firstSheet.getCell(fromRow + idx1, 1 + idx2).value = +e[column.field];\n firstSheet.getCell(fromRow + idx1, 1 + idx2).numFmt = '#';\n } else {\n firstSheet.getCell(fromRow + idx1, 1 + idx2).value = neutralizeSpreadsheetFormula(e[column.field]) as CellValue;\n }\n firstSheet.getCell(fromRow + idx1, 1 + idx2).style = {\n ...this.#cellStyle,\n };\n });\n });\n const file = await workbook.xlsx.writeBuffer();\n BrowserUtilities.downloadBlob(\n new Blob([file], {\n type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n }),\n fileName\n );\n };\n\n // Helper để lấy giá trị text chuẩn từ ô Excel (xử lý RichText, Formula, Hyperlink)\n #getCellValue = (value: CellValue): string | number | null | undefined | boolean | Date => {\n if (value && typeof value === 'object') {\n // Xử lý Rich Text (vd: ô bôi đậm)\n if ('richText' in value) {\n return value.richText.map(t => t.text).join('');\n }\n // Xử lý Hyperlink\n if ('text' in value) {\n return value.text as string; // hoặc value.result nếu là công thức\n }\n // Xử lý Formula\n if ('result' in value) {\n return value.result as string | number | null | undefined | boolean | Date;\n }\n }\n return value as string | number | null | undefined | boolean | Date;\n };\n upload = async (): Promise<{ items: Record<string, any>[]; file: File | null }> => {\n try {\n const fileResult = await BrowserUtilities.upload({\n extensions: ['xlsx'],\n maxSizeInMb: 10,\n });\n\n // Chuẩn hóa file đầu vào (nếu upload trả về mảng thì lấy phần tử đầu)\n const file = Array.isArray(fileResult) ? fileResult[0] : fileResult;\n\n if (!file) {\n return { items: [], file: null };\n }\n\n return await this.parse(file);\n } catch (error) {\n // why: từ `@sdcorejs/utils` 1.2, huỷ/timeout hộp chọn file reject `FilePickerCancelledError` thay vì\n // resolve `null`. Huỷ không phải lỗi — giữ nguyên kết quả rỗng như 1.1.x.\n if (error instanceof FilePickerCancelledError) return { items: [], file: null };\n console.error('Upload error:', error);\n throw error; // Hoặc return { items: [], file: null } tùy logic nghiệp vụ\n }\n };\n parse = async (file: File): Promise<{ items: Record<string, any>[]; file: File | null }> => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = async e => {\n try {\n const buffer = e.target?.result as ArrayBuffer;\n if (!buffer) {\n throw new Error(this.#i18n.t('core.excel.cannot-read-file'));\n }\n\n const Workbook = await this.#loadWorkbook();\n const wb = new Workbook();\n await wb.xlsx.load(buffer);\n\n const sheet = wb.worksheets[0];\n if (!sheet) {\n throw new Error(this.#i18n.t('core.excel.no-sheet'));\n }\n\n const items: Record<string, any>[] = [];\n\n // Lấy row Header (Row 1)\n const headerRow = sheet.getRow(1);\n // Map: Column Index (bắt đầu từ 1) -> Tên trường (Key)\n const headerMap: Record<number, string> = {};\n\n // Duyệt qua các ô có dữ liệu thực tế của dòng Header\n headerRow.eachCell((cell, colNumber) => {\n const cellValue = this.#getCellValue(cell.value);\n if (cellValue) {\n // Ép kiểu về string và trim để làm key\n headerMap[colNumber] = String(cellValue).trim();\n }\n });\n\n // Duyệt dữ liệu từ dòng 2 trở đi\n sheet.eachRow((row, rowIndex) => {\n if (rowIndex <= 1 || !row.hasValues) return;\n\n const item: Record<string, any> = {};\n\n // Chỉ duyệt qua các cột đã định nghĩa trong headerMap\n // Cách này an toàn hơn là duyệt mảng values\n Object.keys(headerMap).forEach(colKey => {\n const colNumber = Number(colKey);\n const fieldKey = headerMap[colNumber];\n\n // Lấy giá trị ô tại cột tương ứng\n const rawValue = this.#getCellValue(row.getCell(colNumber).value);\n\n let finalValue = rawValue;\n\n // Xử lý string: trim\n if (typeof finalValue === 'string') {\n finalValue = finalValue.trim();\n }\n\n // Xử lý các keyword đặc biệt\n if (finalValue === '' || finalValue === undefined) {\n finalValue = null;\n } else if (finalValue === 'SET_NULL') {\n finalValue = null;\n } else if (finalValue === 'SET_EMPTY') {\n finalValue = '';\n }\n\n item[fieldKey] = finalValue;\n });\n\n // Chỉ push nếu item có dữ liệu (tùy chọn)\n if (Object.keys(item).length > 0) {\n items.push(item);\n }\n });\n\n resolve({ items, file });\n } catch (err) {\n reject(err);\n }\n };\n\n reader.onerror = error => reject(error);\n reader.readAsArrayBuffer(file);\n });\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA,MAAM,oCAAoC,GA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CAAC;gBAC1B;gBAAE,OAAO,GAAG,EAAE;oBACZ,MAAM,CAAC,GAAG,CAAC;gBACb;AACF,YAAA,CAAC;YAED,MAAM,CAAC,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC;AACvC,YAAA,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC;AAChC,QAAA,CAAC,CAAC;AACJ,IAAA,CAAC;wGAhbU,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFb,MAAM,EAAA,CAAA;;4FAEP,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACZD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"sd-angular-core-utilities-models.mjs","sources":["../../../projects/sd-angular/utilities/models/src/icon.model.ts","../../../projects/sd-angular/utilities/models/src/pattern.model.ts","../../../projects/sd-angular/utilities/models/src/empty.model.ts","../../../projects/sd-angular/utilities/models/src/maybe-async.model.ts","../../../projects/sd-angular/utilities/models/src/operator.model.ts","../../../projects/sd-angular/utilities/models/sd-angular-core-utilities-models.ts"],"sourcesContent":["export type MaterialIconFontSet = 'material-icons' | 'material-icons-outlined' | 'material-icons-round' | 'material-icons-sharp';\nexport const DefaultMaterialIconFontSet: MaterialIconFontSet = 'material-icons-outlined';\n","import type { ValidationPatternType, ValidationPattern } from '@sdcorejs/utils/models';\nimport { VALIDATION_PATTERNS } from '@sdcorejs/utils/constants';\nimport { StringUtilities } from '@sdcorejs/utils/fns';\nexport type { ValidationPatternType, ValidationPattern };\nexport { VALIDATION_PATTERNS };\n\n/**\n * @deprecated Use {@link ValidationPatternType} from `@sdcorejs/utils/models` instead.\n * Note: member names changed — PHONE_VN → VN_PHONE, IDVN → VN_ID, IDVN_OR_PASSPORT → VN_ID_OR_PASSPORT.\n */\nexport type SdPatternType = 'EMAIL' | 'PHONE' | 'PHONE_VN' | 'IDVN' | 'PASSPORT' | 'IDVN_OR_PASSPORT' | 'TIME';\n\n/**\n * @deprecated Use {@link ValidationPattern} from `@sdcorejs/utils/models` instead.\n * Note: `regex` field renamed to `pattern` to align with Angular `Validators.pattern()`.\n */\nexport interface SdPatternCommon {\n type: SdPatternType;\n name: string;\n regex: string;\n errorMessage: string;\n}\n\n// `name` và `errorMessage` chứa i18n KEY (không phải chuỗi đã dịch).\n/** @deprecated Use `VALIDATION_PATTERNS` from `@sdcorejs/utils/constants` instead. */\nexport const SdPatternCommons: SdPatternCommon[] = [\n { type: 'EMAIL', name: 'core.validator.email.name', regex: StringUtilities.REGEX_EMAIL, errorMessage: 'core.validator.email.error' },\n { type: 'PHONE', name: 'core.validator.phone.name', regex: StringUtilities.REGEX_PHONE, errorMessage: 'core.validator.phone.error' },\n { type: 'PHONE_VN', name: 'core.validator.phone-vn.name', regex: StringUtilities.REGEX_VN_PHONE, errorMessage: 'core.validator.phone-vn.error' },\n { type: 'IDVN', name: 'core.validator.cccd.name', regex: StringUtilities.REGEX_VN_ID, errorMessage: 'core.validator.cccd.error' },\n { type: 'PASSPORT', name: 'core.validator.passport.name', regex: StringUtilities.REGEX_PASSPORT, errorMessage: 'core.validator.passport.error' },\n { type: 'IDVN_OR_PASSPORT', name: 'core.validator.id-vn.name', regex: StringUtilities.REGEX_VN_ID_OR_PASSPORT, errorMessage: 'core.validator.id-vn.error' },\n { type: 'TIME', name: 'core.validator.time.name', regex: StringUtilities.REGEX_TIME, errorMessage: 'core.validator.time.error' },\n];\n","import { EMPTY_STR } from '@sdcorejs/utils/constants';\nexport { EMPTY_STR };\n\n/** @deprecated Use {@link EMPTY_STR} from `@sdcorejs/utils/constants` instead */\nexport const SD_EMPTY_STR = EMPTY_STR;\n","import type { MaybeAsync } from '@sdcorejs/utils/models';\nimport { resolveMaybeAsync, normalizeAsync } from '@sdcorejs/utils/models';\nexport type { MaybeAsync };\nexport { resolveMaybeAsync, normalizeAsync };\n\n/** @deprecated Use {@link MaybeAsync} from `@sdcorejs/utils/models` instead */\nexport type SdMaybeAsync<T> = MaybeAsync<T>;\n/** @deprecated Use {@link resolveMaybeAsync} from `@sdcorejs/utils/models` instead */\nexport const SdResolveMaybeAsync = resolveMaybeAsync;\n/** @deprecated Use {@link normalizeAsync} from `@sdcorejs/utils/models` instead */\nexport const SdNormalizeAsync = normalizeAsync;\n","import type { Operator, OperatorHasData, OperatorNoData } from '@sdcorejs/utils/models';\nexport type { Operator, OperatorHasData, OperatorNoData };\n\n/** @deprecated Use {@link Operator} from `@sdcorejs/utils/models` instead */\nexport type SdOperator = Operator;\n/** @deprecated Use {@link OperatorHasData} from `@sdcorejs/utils/models` instead */\nexport type SdOperatorHasData = OperatorHasData;\n/** @deprecated Use {@link OperatorNoData} from `@sdcorejs/utils/models` instead */\nexport type SdOperatorNoData = OperatorNoData;\n\n// `display` chứa i18n KEY (không phải chuỗi đã dịch).\n// Consumer phải gọi i18n.t(display) trước khi render ra UI.\n// @deprecated Use `OPERATORS` from `@sdcorejs/utils/constants` instead.\n// Note: OPERATORS has translated display labels; SdOperators uses i18n keys.\nexport const SdOperators: {\n value: Operator;\n symbol?: string;\n display: string;\n}[] = [\n { value: 'EQUAL', symbol: '=', display: 'core.operator.equal.display' },\n { value: 'NOT_EQUAL', symbol: '≠', display: 'core.operator.not-equal.display' },\n { value: 'GREATER_THAN', symbol: '>', display: 'core.operator.greater-than.display' },\n { value: 'LESS_THAN', symbol: '<', display: 'core.operator.less-than.display' },\n { value: 'GREATER_OR_EQUAL', symbol: '≥', display: 'core.operator.greater-or-equal.display' },\n { value: 'LESS_OR_EQUAL', symbol: '≤', display: 'core.operator.less-or-equal.display' },\n { value: 'CONTAIN', symbol: 'join_inner', display: 'core.operator.contain.display' },\n { value: 'NOT_CONTAIN', symbol: 'join', display: 'core.operator.not-contain.display' },\n { value: 'START_WITH', symbol: 'line_start_circle', display: 'core.operator.start-with.display' },\n { value: 'END_WITH', symbol: 'line_end_circle', display: 'core.operator.end-with.display' },\n { value: 'IN', symbol: 'checklist_rtl', display: 'core.operator.in.display' },\n { value: 'NOT_IN', symbol: 'event_list', display: 'core.operator.not-in.display' },\n { value: 'NULL', symbol: 'motion_photos_off', display: 'core.operator.null.display' },\n { value: 'NOT_NULL', symbol: 'adjust', display: 'core.operator.not-null.display' },\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AACO,MAAM,0BAA0B,GAAwB;;ACsB/D;AACA;AACO,MAAM,gBAAgB,GAAsB;AACjD,IAAA,EAAE,IAAI,EAAE,OAAO,EAAa,IAAI,EAAE,2BAA2B,EAAK,KAAK,EAAE,eAAe,CAAC,WAAW,EAAc,YAAY,EAAE,4BAA4B,EAAE;AAC9J,IAAA,EAAE,IAAI,EAAE,OAAO,EAAa,IAAI,EAAE,2BAA2B,EAAK,KAAK,EAAE,eAAe,CAAC,WAAW,EAAc,YAAY,EAAE,4BAA4B,EAAE;AAC9J,IAAA,EAAE,IAAI,EAAE,UAAU,EAAU,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,eAAe,CAAC,cAAc,EAAW,YAAY,EAAE,+BAA+B,EAAE;AACjK,IAAA,EAAE,IAAI,EAAE,MAAM,EAAc,IAAI,EAAE,0BAA0B,EAAM,KAAK,EAAE,eAAe,CAAC,WAAW,EAAc,YAAY,EAAE,2BAA2B,EAAE;AAC7J,IAAA,EAAE,IAAI,EAAE,UAAU,EAAU,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,eAAe,CAAC,cAAc,EAAW,YAAY,EAAE,+BAA+B,EAAE;AACjK,IAAA,EAAE,IAAI,EAAE,kBA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EAAI,OAAO,EAAE,gCAAgC,EAAE;IACrG,EAAE,KAAK,EAAE,IAAI,EAAgB,MAAM,EAAE,eAAe,EAAM,OAAO,EAAE,0BAA0B,EAAE;IAC/F,EAAE,KAAK,EAAE,QAAQ,EAAY,MAAM,EAAE,YAAY,EAAS,OAAO,EAAE,8BAA8B,EAAE;IACnG,EAAE,KAAK,EAAE,MAAM,EAAc,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,4BAA4B,EAAE;IACjG,EAAE,KAAK,EAAE,UAAU,EAAU,MAAM,EAAE,QAAQ,EAAa,OAAO,EAAE,gCAAgC,EAAE;;;AChCvG;;AAEG;;;;"}
1
+ {"version":3,"file":"sd-angular-core-utilities-models.mjs","sources":["../../../projects/sd-angular/utilities/models/src/icon.model.ts","../../../projects/sd-angular/utilities/models/src/pattern.model.ts","../../../projects/sd-angular/utilities/models/src/empty.model.ts","../../../projects/sd-angular/utilities/models/src/maybe-async.model.ts","../../../projects/sd-angular/utilities/models/src/operator.model.ts","../../../projects/sd-angular/utilities/models/sd-angular-core-utilities-models.ts"],"sourcesContent":["export type MaterialIconFontSet = 'material-icons' | 'material-icons-outlined' | 'material-icons-round' | 'material-icons-sharp';\nexport const DefaultMaterialIconFontSet: MaterialIconFontSet = 'material-icons-outlined';\n","import type { ValidationPatternType, ValidationPattern } from '@sdcorejs/utils/models';\nimport { VALIDATION_PATTERNS } from '@sdcorejs/utils/constants';\nimport { StringUtilities } from '@sdcorejs/utils/fns';\nexport type { ValidationPatternType, ValidationPattern };\nexport { VALIDATION_PATTERNS };\n\n/**\n * @deprecated Use {@link ValidationPatternType} from `@sdcorejs/utils/models` instead.\n * Note: member names changed — PHONE_VN → VN_PHONE, IDVN → VN_ID, IDVN_OR_PASSPORT → VN_ID_OR_PASSPORT.\n */\nexport type SdPatternType = 'EMAIL' | 'PHONE' | 'PHONE_VN' | 'IDVN' | 'PASSPORT' | 'IDVN_OR_PASSPORT' | 'TIME';\n\n/**\n * @deprecated Use {@link ValidationPattern} from `@sdcorejs/utils/models` instead.\n * Note: `regex` field renamed to `pattern` to align with Angular `Validators.pattern()`.\n */\nexport interface SdPatternCommon {\n type: SdPatternType;\n name: string;\n regex: string;\n errorMessage: string;\n}\n\n// `name` và `errorMessage` chứa i18n KEY (không phải chuỗi đã dịch).\n/** @deprecated Use `VALIDATION_PATTERNS` from `@sdcorejs/utils/constants` instead. */\nexport const SdPatternCommons: SdPatternCommon[] = [\n { type: 'EMAIL', name: 'core.validator.email.name', regex: StringUtilities.REGEX_EMAIL, errorMessage: 'core.validator.email.error' },\n { type: 'PHONE', name: 'core.validator.phone.name', regex: StringUtilities.REGEX_PHONE, errorMessage: 'core.validator.phone.error' },\n { type: 'PHONE_VN', name: 'core.validator.phone-vn.name', regex: StringUtilities.REGEX_VN_PHONE, errorMessage: 'core.validator.phone-vn.error' },\n { type: 'IDVN', name: 'core.validator.cccd.name', regex: StringUtilities.REGEX_VN_ID, errorMessage: 'core.validator.cccd.error' },\n { type: 'PASSPORT', name: 'core.validator.passport.name', regex: StringUtilities.REGEX_PASSPORT, errorMessage: 'core.validator.passport.error' },\n { type: 'IDVN_OR_PASSPORT', name: 'core.validator.id-vn.name', regex: StringUtilities.REGEX_VN_ID_OR_PASSPORT, errorMessage: 'core.validator.id-vn.error' },\n { type: 'TIME', name: 'core.validator.time.name', regex: StringUtilities.REGEX_TIME, errorMessage: 'core.validator.time.error' },\n];\n","import { EMPTY_STR } from '@sdcorejs/utils/constants';\nexport { EMPTY_STR };\n\n/** @deprecated Use {@link EMPTY_STR} from `@sdcorejs/utils/constants` instead */\nexport const SD_EMPTY_STR = EMPTY_STR;\n","import type { MaybeAsync } from '@sdcorejs/utils/models';\nimport type { Observable } from 'rxjs';\nimport { resolveMaybeAsync, normalizeAsync } from '@sdcorejs/utils/models';\nexport type { MaybeAsync };\nexport { resolveMaybeAsync, normalizeAsync };\n\n/** @deprecated Use {@link MaybeAsync} from `@sdcorejs/utils/models` instead */\n// why: `MaybeAsync` của `@sdcorejs/utils` 1.1.x là `T | Promise<T> | Observable<T>` (RxJS). Từ 1.2 nó dùng\n// `SubscribableLike<T>` cấu trúc, và kiểu này KHÔNG nhận `Observable` của kiểu hẹp hơn (vd `Observable<string>`\n// cho slot `string | null | undefined`, hay Observable của một subtype). Giữ `Observable<T>` tường minh để\n// consumer đang truyền Observable/BehaviorSubject vẫn compile như trước.\nexport type SdMaybeAsync<T> = MaybeAsync<T> | Observable<T>;\n/** @deprecated Use {@link resolveMaybeAsync} from `@sdcorejs/utils/models` instead */\nexport const SdResolveMaybeAsync = resolveMaybeAsync;\n/** @deprecated Use {@link normalizeAsync} from `@sdcorejs/utils/models` instead */\nexport const SdNormalizeAsync = normalizeAsync;\n","import type { Operator, OperatorHasData, OperatorNoData } from '@sdcorejs/utils/models';\nexport type { Operator, OperatorHasData, OperatorNoData };\n\n/** @deprecated Use {@link Operator} from `@sdcorejs/utils/models` instead */\nexport type SdOperator = Operator;\n/** @deprecated Use {@link OperatorHasData} from `@sdcorejs/utils/models` instead */\nexport type SdOperatorHasData = OperatorHasData;\n/** @deprecated Use {@link OperatorNoData} from `@sdcorejs/utils/models` instead */\nexport type SdOperatorNoData = OperatorNoData;\n\n// `display` chứa i18n KEY (không phải chuỗi đã dịch).\n// Consumer phải gọi i18n.t(display) trước khi render ra UI.\n// @deprecated Use `OPERATORS` from `@sdcorejs/utils/constants` instead.\n// Note: OPERATORS has translated display labels; SdOperators uses i18n keys.\nexport const SdOperators: {\n value: Operator;\n symbol?: string;\n display: string;\n}[] = [\n { value: 'EQUAL', symbol: '=', display: 'core.operator.equal.display' },\n { value: 'NOT_EQUAL', symbol: '≠', display: 'core.operator.not-equal.display' },\n { value: 'GREATER_THAN', symbol: '>', display: 'core.operator.greater-than.display' },\n { value: 'LESS_THAN', symbol: '<', display: 'core.operator.less-than.display' },\n { value: 'GREATER_OR_EQUAL', symbol: '≥', display: 'core.operator.greater-or-equal.display' },\n { value: 'LESS_OR_EQUAL', symbol: '≤', display: 'core.operator.less-or-equal.display' },\n { value: 'CONTAIN', symbol: 'join_inner', display: 'core.operator.contain.display' },\n { value: 'NOT_CONTAIN', symbol: 'join', display: 'core.operator.not-contain.display' },\n { value: 'START_WITH', symbol: 'line_start_circle', display: 'core.operator.start-with.display' },\n { value: 'END_WITH', symbol: 'line_end_circle', display: 'core.operator.end-with.display' },\n { value: 'IN', symbol: 'checklist_rtl', display: 'core.operator.in.display' },\n { value: 'NOT_IN', symbol: 'event_list', display: 'core.operator.not-in.display' },\n { value: 'NULL', symbol: 'motion_photos_off', display: 'core.operator.null.display' },\n { value: 'NOT_NULL', symbol: 'adjust', display: 'core.operator.not-null.display' },\n];\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AACO,MAAM,0BAA0B,GAAwB;;ACsB/D;AACA;AACO,MAAM,gBAAgB,GAAsB;AACjD,IAAA,EAAE,IAAI,EAAE,OAAO,EAAa,IAAI,EAAE,2BAA2B,EAAK,KAAK,EAAE,eAAe,CAAC,WAAW,EAAc,YAAY,EAAE,4BAA4B,EAAE;AAC9J,IAAA,EAAE,IAAI,EAAE,OAAO,EAAa,IAAI,EAAE,2BAA2B,EAAK,KAAK,EAAE,eAAe,CAAC,WAAW,EAAc,YAAY,EAAE,4BAA4B,EAAE;AAC9J,IAAA,EAAE,IAAI,EAAE,UAAU,EAAU,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,eAAe,CAAC,cAAc,EAAW,YAAY,EAAE,+BAA+B,EAAE;AACjK,IAAA,EAAE,IAAI,EAAE,MAAM,EAAc,IAAI,EAAE,0BAA0B,EAAM,KAAK,EAAE,eAAe,CAAC,WAAW,EAAc,YAAY,EAAE,2BAA2B,EAAE;AAC7J,IAAA,EAAE,IAAI,EAAE,UAAU,EAAU,IAAI,EAAE,8BAA8B,EAAE,KAAK,EAAE,eAAe,CAAC,cAAc,EAAW,YAAY,EAAE,+BAA+B,EAAE;AACjK,IAAA,EAAE,IAAI,E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,iBAAiB,EAAI,OAAO,EAAE,gCAAgC,EAAE;IACrG,EAAE,KAAK,EAAE,IAAI,EAAgB,MAAM,EAAE,eAAe,EAAM,OAAO,EAAE,0BAA0B,EAAE;IAC/F,EAAE,KAAK,EAAE,QAAQ,EAAY,MAAM,EAAE,YAAY,EAAS,OAAO,EAAE,8BAA8B,EAAE;IACnG,EAAE,KAAK,EAAE,MAAM,EAAc,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,4BAA4B,EAAE;IACjG,EAAE,KAAK,EAAE,UAAU,EAAU,MAAM,EAAE,QAAQ,EAAa,OAAO,EAAE,gCAAgC,EAAE;;;AChCvG;;AAEG;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { InjectionToken } from '@angular/core';
2
2
  import { CanActivate } from '@angular/router';
3
3
  import { MaybeAsync } from '@sdcorejs/utils/models';
4
+ import { Observable } from 'rxjs';
4
5
  import { SdAuthInfo } from '../services';
5
6
  export interface ISdAuthConfiguration {
6
7
  action?: IAuthConfigurationAction;
@@ -8,12 +9,12 @@ export interface ISdAuthConfiguration {
8
9
  }
9
10
  export declare const SD_AUTH_CONFIGURATION: InjectionToken<ISdAuthConfiguration>;
10
11
  interface IAuthConfigurationAction {
11
- signout: () => MaybeAsync<void>;
12
- changePassword?: () => MaybeAsync<void>;
12
+ signout: () => MaybeAsync<void> | Observable<void>;
13
+ changePassword?: () => MaybeAsync<void> | Observable<void>;
13
14
  }
14
15
  interface IAuthConfigurationGuard {
15
16
  auth?: CanActivate['canActivate'];
16
17
  portal?: CanActivate['canActivate'];
17
- authInfo: () => MaybeAsync<SdAuthInfo>;
18
+ authInfo: () => MaybeAsync<SdAuthInfo> | Observable<SdAuthInfo>;
18
19
  }
19
20
  export {};
@@ -1,9 +1,10 @@
1
1
  import { InjectionToken } from '@angular/core';
2
2
  import { MaybeAsync } from '@sdcorejs/utils/models';
3
+ import { Observable } from 'rxjs';
3
4
  export interface ISdLayoutConfiguration {
4
5
  homeUrl?: string;
5
- sidebar: ISdSidebarConfiguration | (() => MaybeAsync<ISdSidebarConfiguration>);
6
- userInfo: SdLayoutUserInfo | (() => MaybeAsync<SdLayoutUserInfo>);
6
+ sidebar: ISdSidebarConfiguration | (() => MaybeAsync<ISdSidebarConfiguration> | Observable<ISdSidebarConfiguration>);
7
+ userInfo: SdLayoutUserInfo | (() => MaybeAsync<SdLayoutUserInfo> | Observable<SdLayoutUserInfo>);
7
8
  signout: () => void | Promise<void>;
8
9
  changePassword?: () => void | Promise<void>;
9
10
  }
@@ -1,5 +1,6 @@
1
1
  import { InjectionToken } from '@angular/core';
2
2
  import { MaybeAsync } from '@sdcorejs/utils/models';
3
+ import { Observable } from 'rxjs';
3
4
  /**
4
5
  * Cấu hình trung tâm cho module permission.
5
6
  *
@@ -33,7 +34,7 @@ export interface ISdPermissionConfiguration {
33
34
  * Ví dụ giá trị trả về:
34
35
  * - `['PRODUCT_C_EMPLOYEE_VIEW', 'PRODUCT_C_EMPLOYEE_UPDATE']`
35
36
  */
36
- loadPermissions: () => MaybeAsync<string[]>;
37
+ loadPermissions: () => MaybeAsync<string[]> | Observable<string[]>;
37
38
  /**
38
39
  * Callback xử lý khi user không có quyền truy cập URL hiện tại.
39
40
  * Thường dùng để điều hướng sang trang forbidden hoặc hiển thị thông báo.
@@ -45,7 +46,7 @@ export interface ISdPermissionConfiguration {
45
46
  * Cung cấp access token hiện tại cho các tác vụ liên quan permission.
46
47
  * Hỗ trợ trả về đồng bộ, Promise hoặc Observable.
47
48
  */
48
- getToken?: () => MaybeAsync<string | undefined | null>;
49
+ getToken?: () => MaybeAsync<string | undefined | null> | Observable<string | undefined | null>;
49
50
  }
50
51
  /**
51
52
  * InjectionToken cho cấu hình permission.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sd-angular/core",
3
- "version": "19.0.39",
3
+ "version": "19.0.41",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.0.0 || ^20.0.0 || ^21.0.0",
6
6
  "@angular/core": "^19.0.0 || ^20.0.0 || ^21.0.0",
@@ -9,7 +9,7 @@
9
9
  "angular-oauth2-oidc": ">=19.0.0"
10
10
  },
11
11
  "dependencies": {
12
- "@sdcorejs/utils": "1.2.2",
12
+ "@sdcorejs/utils": "1.2.4",
13
13
  "@ckeditor/ckeditor5-angular": "11.1.2",
14
14
  "@omer-go/docx-parser-converter-ts": "^1.0.0",
15
15
  "@bjorn3/browser_wasi_shim": "^0.4.2",
@@ -190,14 +190,14 @@
190
190
  "types": "./components/splitter/index.d.ts",
191
191
  "default": "./fesm2022/sd-angular-core-components-splitter.mjs"
192
192
  },
193
- "./components/tab": {
194
- "types": "./components/tab/index.d.ts",
195
- "default": "./fesm2022/sd-angular-core-components-tab.mjs"
196
- },
197
193
  "./components/stepper": {
198
194
  "types": "./components/stepper/index.d.ts",
199
195
  "default": "./fesm2022/sd-angular-core-components-stepper.mjs"
200
196
  },
197
+ "./components/tab": {
198
+ "types": "./components/tab/index.d.ts",
199
+ "default": "./fesm2022/sd-angular-core-components-tab.mjs"
200
+ },
201
201
  "./components/tab-router": {
202
202
  "types": "./components/tab-router/index.d.ts",
203
203
  "default": "./fesm2022/sd-angular-core-components-tab-router.mjs"
@@ -222,10 +222,6 @@
222
222
  "types": "./components/view/index.d.ts",
223
223
  "default": "./fesm2022/sd-angular-core-components-view.mjs"
224
224
  },
225
- "./forms/autocomplete": {
226
- "types": "./forms/autocomplete/index.d.ts",
227
- "default": "./fesm2022/sd-angular-core-forms-autocomplete.mjs"
228
- },
229
225
  "./forms/checkbox": {
230
226
  "types": "./forms/checkbox/index.d.ts",
231
227
  "default": "./fesm2022/sd-angular-core-forms-checkbox.mjs"
@@ -234,6 +230,10 @@
234
230
  "types": "./forms/chip/index.d.ts",
235
231
  "default": "./fesm2022/sd-angular-core-forms-chip.mjs"
236
232
  },
233
+ "./forms/autocomplete": {
234
+ "types": "./forms/autocomplete/index.d.ts",
235
+ "default": "./fesm2022/sd-angular-core-forms-autocomplete.mjs"
236
+ },
237
237
  "./forms/chip-calendar": {
238
238
  "types": "./forms/chip-calendar/index.d.ts",
239
239
  "default": "./fesm2022/sd-angular-core-forms-chip-calendar.mjs"
@@ -1,4 +1,5 @@
1
1
  export * from './src/api.model';
2
+ export * from './src/api-handler-registry';
2
3
  export * from './src/api.service';
3
4
  export * from './src/interceptors/api.interceptor';
4
5
  export * from './src/api.module';
@@ -0,0 +1,49 @@
1
+ import { EnvironmentProviders, Type } from '@angular/core';
2
+ import { ISdApiConfiguration } from './api.model';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Handler API đăng ký lúc runtime, sống ở root injector.
6
+ *
7
+ * why: `SdHttpInterceptor` được đăng ký qua `HTTP_INTERCEPTORS` ở ROOT, nên
8
+ * `inject(SD_API_CONFIG)` của nó chỉ thấy provider ở root. Library nào khai
9
+ * `{ provide: SD_API_CONFIG, multi: true }` trong NgModule mà shell nạp bằng
10
+ * `loadChildren` thì provider nằm ở child injector của lazy route — interceptor không
11
+ * bao giờ thấy, nên mất `intercept` / `beforeRemote` / `afterRemote` trong im lặng.
12
+ * Registry này là điểm hẹn ở root mà mọi scope (root, eager, lazy) đều ghi vào được.
13
+ *
14
+ * Registry tự nhặt `SD_API_CONFIG` khai trong injector của lazy route (`Route.providers`,
15
+ * NgModule của `loadChildren`) trong chính navigation Router tạo injector đó — trước guard,
16
+ * resolver và component — và gỡ khi injector bị huỷ;
17
+ * library giữ nguyên cách khai multi provider, không cần biết shell mount nó eager hay lazy.
18
+ */
19
+ export declare class SdApiHandlerRegistry {
20
+ #private;
21
+ /** Các configuration đang được đăng ký, theo thứ tự đăng ký. */
22
+ readonly configurations: import("@angular/core").Signal<ISdApiConfiguration[]>;
23
+ constructor();
24
+ /**
25
+ * Đăng ký một configuration. Trả về hàm gỡ đăng ký (gọi nhiều lần vẫn an toàn); dùng
26
+ * {@link provideSdApiConfiguration} để việc gỡ gắn với vòng đời của scope.
27
+ */
28
+ register(configuration: ISdApiConfiguration): () => void;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdApiHandlerRegistry, never>;
30
+ static ɵprov: i0.ɵɵInjectableDeclaration<SdApiHandlerRegistry>;
31
+ }
32
+ /**
33
+ * Đăng ký handler API cho scope hiện tại: root (`bootstrapApplication` / `AppModule`),
34
+ * NgModule nạp eager, hay `Route.providers` / NgModule của lazy route.
35
+ *
36
+ * Configuration được đăng ký vào {@link SdApiHandlerRegistry} ngay khi injector của scope
37
+ * được tạo — tức trước mọi request scope đó phát ra — và gỡ khi injector bị huỷ. Truyền
38
+ * class thì class được provide trong chính scope đó, nên nó inject được dependency của scope.
39
+ *
40
+ * ```ts
41
+ * // library
42
+ * @NgModule({ providers: [provideSdApiConfiguration(ApiConfiguration)] })
43
+ * export class OrdersModule {}
44
+ *
45
+ * // hoặc route
46
+ * { path: 'orders', providers: [provideSdApiConfiguration(ApiConfiguration)], loadComponent: ... }
47
+ * ```
48
+ */
49
+ export declare function provideSdApiConfiguration(configuration: Type<ISdApiConfiguration> | ISdApiConfiguration): EnvironmentProviders;
@@ -0,0 +1,10 @@
1
+ import { ISdApiConfiguration, SdApiHandler } from './api.model';
2
+ /**
3
+ * Handler chịu trách nhiệm cho `url`: host khớp prefix DÀI NHẤT thắng; hai host dài bằng nhau
4
+ * thì handler đăng ký trước thắng.
5
+ *
6
+ * why: trước đây là `handlers.find(...)` — handler đầu tiên khớp thắng, nên khi nhiều lib nằm
7
+ * sau cùng một gateway (phân biệt bằng context path) thì thứ tự đăng ký quyết định ai nhận
8
+ * request. Giờ `https://gw.example/bpm` thắng `https://gw.example` bất kể thứ tự.
9
+ */
10
+ export declare function sdResolveApiHandler(url: string, configurations: readonly (ISdApiConfiguration | null | undefined)[]): SdApiHandler | undefined;
@@ -0,0 +1,20 @@
1
+ import { DestroyRef, ErrorHandler } from '@angular/core';
2
+ import { Router } from '@angular/router';
3
+ import { ISdApiConfiguration } from './api.model';
4
+ /** Nơi nhận configuration nhặt được từ route; {@link SdApiHandlerRegistry} là hiện thực. */
5
+ interface SdApiConfigurationSink {
6
+ register(configuration: ISdApiConfiguration): () => void;
7
+ }
8
+ /**
9
+ * Nhặt `SD_API_CONFIG` khai trong injector của lazy route và đăng ký vào registry ở root.
10
+ *
11
+ * why: interceptor sống ở root nên không thấy `{ provide: SD_API_CONFIG, multi: true }` nằm trong
12
+ * `Route.providers` hay NgModule nạp bằng `loadChildren`. Library không biết shell mount nó eager
13
+ * hay lazy, nên Core phải tự tìm các injector đó thay vì bắt library đổi cách khai.
14
+ *
15
+ * Duyệt cây route của Router lúc registry được tạo và ở mỗi `RoutesRecognized` — lúc recognize vừa
16
+ * tạo xong mọi injector của navigation, trước guard (`canActivate`), resolver và component. Mỗi
17
+ * injector được đọc một lần và gỡ khi nó bị huỷ, nên handler sống đúng bằng injector của route.
18
+ */
19
+ export declare function sdTrackRouteApiConfigurations(router: Router, sink: SdApiConfigurationSink, errorHandler: ErrorHandler, destroyRef: DestroyRef): void;
20
+ export {};
@@ -32,5 +32,12 @@ export interface ISdApiConfiguration {
32
32
  handlers: SdApiHandler[];
33
33
  }
34
34
  export declare const SD_API_CONFIG: InjectionToken<ISdApiConfiguration>;
35
+ /**
36
+ * @deprecated Use `SD_API_CONFIG`. This is the same injection token.
37
+ *
38
+ * why: trước đây đây là một InjectionToken RIÊNG (cùng description) và không nơi nào đọc nó, nên
39
+ * consumer theo tên này nhận danh sách handler rỗng mà không có cảnh báo. Giờ là alias của
40
+ * `SD_API_CONFIG`, cùng chiều với `@sdcorejs/angular`.
41
+ */
35
42
  export declare const SD_API_CONFIGURATION: InjectionToken<ISdApiConfiguration>;
36
43
  export {};
@@ -1,9 +1,10 @@
1
1
  import type { MaybeAsync } from '@sdcorejs/utils/models';
2
+ import type { Observable } from 'rxjs';
2
3
  import { resolveMaybeAsync, normalizeAsync } from '@sdcorejs/utils/models';
3
4
  export type { MaybeAsync };
4
5
  export { resolveMaybeAsync, normalizeAsync };
5
6
  /** @deprecated Use {@link MaybeAsync} from `@sdcorejs/utils/models` instead */
6
- export type SdMaybeAsync<T> = MaybeAsync<T>;
7
+ export type SdMaybeAsync<T> = MaybeAsync<T> | Observable<T>;
7
8
  /** @deprecated Use {@link resolveMaybeAsync} from `@sdcorejs/utils/models` instead */
8
9
  export declare const SdResolveMaybeAsync: <T>(value: MaybeAsync<T>) => Promise<T>;
9
10
  /** @deprecated Use {@link normalizeAsync} from `@sdcorejs/utils/models` instead */