@sdcorejs/angular 21.0.10 → 21.1.0
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 +32 -23
- package/assets/STYLE-GUIDE.md +58 -72
- package/assets/scss/core/_inline-edit.scss +1 -1
- package/assets/scss/core/color.scss +56 -45
- package/assets/scss/core/form.scss +21 -9
- package/assets/scss/core/utilities/_base.scss +3 -3
- package/assets/scss/core/utilities/_border.scss +1 -1
- package/assets/scss/themes/default.scss +46 -32
- package/assets/scss/themes/material-theme.scss +8 -87
- package/fesm2022/sdcorejs-angular-components-anchor.mjs +5 -6
- package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs +10 -11
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-badge.mjs +14 -12
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-button.mjs +9 -10
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-code-editor.mjs +4 -5
- package/fesm2022/sdcorejs-angular-components-code-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-document-builder.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-document-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-editor.mjs +4 -5
- package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +21 -24
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-history.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +5 -7
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-inform.mjs +4 -14
- package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +5 -6
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +25 -7
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-org-chart.mjs +4 -5
- package/fesm2022/sdcorejs-angular-components-org-chart.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-preview.mjs +7 -8
- package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +24 -28
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +3 -4
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-section.mjs +8 -13
- package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +3 -4
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-splitter.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-stepper.mjs +3 -4
- package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +5 -6
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +3 -4
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +23 -27
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tree.mjs +6 -8
- package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +8 -9
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-view.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +5 -7
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +7 -9
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip.mjs +5 -7
- package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +7 -9
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +7 -9
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +466 -344
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-inline-text.mjs +4 -5
- package/fesm2022/sdcorejs-angular-forms-inline-text.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +5 -7
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +5 -7
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-label.mjs +4 -5
- package/fesm2022/sdcorejs-angular-forms-label.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs +2 -4
- package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +6 -8
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +5 -7
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-icon.mjs +505 -0
- package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +29 -29
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules.mjs +1 -0
- package/fesm2022/sdcorejs-angular-modules.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +85 -5
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-excel.mjs +22 -14
- package/fesm2022/sdcorejs-angular-services-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-utilities-models.mjs +3 -2
- package/fesm2022/sdcorejs-angular-utilities-models.mjs.map +1 -1
- package/package.json +6 -1
- package/types/sdcorejs-angular-components-badge.d.ts +5 -16
- package/types/sdcorejs-angular-components-button.d.ts +7 -5
- package/types/sdcorejs-angular-components-inform.d.ts +2 -8
- package/types/sdcorejs-angular-components-modal.d.ts +1 -1
- package/types/sdcorejs-angular-components-query-builder.d.ts +6 -6
- package/types/sdcorejs-angular-components-section.d.ts +1 -5
- package/types/sdcorejs-angular-components-side-drawer.d.ts +1 -1
- package/types/sdcorejs-angular-components-table.d.ts +9 -10
- package/types/sdcorejs-angular-components-tree.d.ts +3 -2
- package/types/sdcorejs-angular-forms-datetime.d.ts +4 -4
- package/types/sdcorejs-angular-modules-icon.d.ts +191 -0
- package/types/sdcorejs-angular-modules.d.ts +1 -0
- package/types/sdcorejs-angular-services-confirm.d.ts +49 -1
- package/types/sdcorejs-angular-utilities-models.d.ts +6 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-services-excel.mjs","sources":["../../../projects/sdcorejs-angular/services/excel/src/lib/excel.service.ts","../../../projects/sdcorejs-angular/services/excel/sdcorejs-angular-services-excel.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport type { CellValue, Style } from 'exceljs';\n// import hash from 'object-hash';\nimport { DateUtilities } from '@sdcorejs/angular/utilities/extensions';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\nimport { I18nService } from '@sdcorejs/angular/i18n';\nimport { SdExcelExportOption, SdExcelTemplate } from './excel.model';\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 constructor() {}\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: any = await import('exceljs');\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 = column.field;\n cellTitle.value = column.title;\n if (hasDescription) {\n cellDescription.style = this.#descriptionStyle;\n cellDescription.value = 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 = header.value;\n newSheet.getCell(2, index + 1).style = this.#titleStyle;\n newSheet.getCell(2, index + 1).value = 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 = item[header.value];\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 = 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 = column.field;\n firstSheet.getCell(2, index + 1).value = column.title;\n if (hasDescription) {\n firstSheet.getCell(3, index + 1).style = this.#descriptionStyle;\n firstSheet.getCell(3, index + 1).value = 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 = header.value;\n newSheet.getCell(2, index + 1).style = this.#titleStyle;\n newSheet.getCell(2, index + 1).value = 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 = item[header.value];\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 = e[column.field];\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 any;\n }\n }\n return value as any;\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":";;;;;;MAWa,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,MAAM,EAAE;AACzB,YAAA,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;AACvB,YAAA,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;AACzB,SAAA;AACD,QAAA,SAAS,EAAE;AACT,YAAA,QAAQ,EAAE,QAAQ;AAClB,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,QAAQ,EAAE,IAAI;AACf,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,IAAI,EAAE,EAAE;AACR,YAAA,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC1B,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,SAAS;AACf,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,OAAO,EAAE;AACP,gBAAA,IAAI,EAAE,QAAQ;AACf,aAAA;AACF,SAAA;KACF;IACD,WAAW,GAAG,QAAQ;IACtB,aAAa,GAAG,QAAQ;AACxB,IAAA,WAAW,GAAmB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,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;;;ACVD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-services-excel.mjs","sources":["../../../projects/sdcorejs-angular/services/excel/src/lib/spreadsheet-formula-injection.util.ts","../../../projects/sdcorejs-angular/services/excel/src/lib/excel.service.ts","../../../projects/sdcorejs-angular/services/excel/sdcorejs-angular-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 '@sdcorejs/angular/utilities/extensions';\nimport { BrowserUtilities } from '@sdcorejs/utils/fns';\nimport { I18nService } from '@sdcorejs/angular/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 constructor() {}\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: any = await import('exceljs');\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 any;\n }\n }\n return value as any;\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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E,IAAI,EAAE,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;wGA7aU,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;;;ACXD;;AAEG;;;;"}
|
|
@@ -49,7 +49,7 @@ class SdLoadingService {
|
|
|
49
49
|
width: '5rem',
|
|
50
50
|
height: '5rem',
|
|
51
51
|
border: '0.5rem solid var(--sd-primary)',
|
|
52
|
-
'border-top': '0.5rem solid var(--sd-
|
|
52
|
+
'border-top': '0.5rem solid var(--sd-border)',
|
|
53
53
|
'border-radius': '50%',
|
|
54
54
|
animation: 'spin 1s linear infinite',
|
|
55
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-services-loading.mjs","sources":["../../../projects/sdcorejs-angular/services/loading/src/loading.service.ts","../../../projects/sdcorejs-angular/services/loading/sdcorejs-angular-services-loading.ts"],"sourcesContent":["import { Injectable, Renderer2, RendererFactory2 } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SdLoadingService {\n private loadingId = 'L8d556b9b-f6dd-46e9-9710-757e65d82839';\n\n private renderer: Renderer2;\n\n private loadingMap = new WeakMap<Element, HTMLElement>();\n constructor(rendererFactory: RendererFactory2) {\n this.renderer = rendererFactory.createRenderer(null, null);\n }\n\n start = (element = 'body') => {\n const ele = document.querySelector(element);\n if (ele && !this.loadingMap.has(ele)) {\n const loadingElement = this.#createLoading();\n ele.appendChild(loadingElement);\n this.loadingMap.set(ele, loadingElement);\n }\n };\n\n isLoading = (element = 'body') => {\n const ele = document.querySelector(element);\n return ele && this.loadingMap.has(ele);\n };\n\n stop = (element = 'body') => {\n const ele = document.querySelector(element);\n if (ele && this.loadingMap.has(ele)) {\n const loadingElement = this.loadingMap.get(ele);\n loadingElement?.remove();\n this.loadingMap.delete(ele);\n }\n };\n\n #createLoading = (): HTMLElement => {\n const renderer = this.renderer;\n const container: HTMLElement = this.renderer.createElement('div');\n const spinner: HTMLElement = this.renderer.createElement('div');\n const containerStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n height: '100%',\n width: '100%',\n opacity: 0.6,\n background: '#FFFFFF',\n 'z-index': 99999,\n };\n const spinnerStyle = {\n position: 'absolute',\n top: 'calc(50% - 2.5rem)',\n left: 'calc(50% - 2.5rem)',\n width: '5rem',\n height: '5rem',\n border: '0.5rem solid var(--sd-primary)',\n 'border-top': '0.5rem solid var(--sd-
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-services-loading.mjs","sources":["../../../projects/sdcorejs-angular/services/loading/src/loading.service.ts","../../../projects/sdcorejs-angular/services/loading/sdcorejs-angular-services-loading.ts"],"sourcesContent":["import { Injectable, Renderer2, RendererFactory2 } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SdLoadingService {\n private loadingId = 'L8d556b9b-f6dd-46e9-9710-757e65d82839';\n\n private renderer: Renderer2;\n\n private loadingMap = new WeakMap<Element, HTMLElement>();\n constructor(rendererFactory: RendererFactory2) {\n this.renderer = rendererFactory.createRenderer(null, null);\n }\n\n start = (element = 'body') => {\n const ele = document.querySelector(element);\n if (ele && !this.loadingMap.has(ele)) {\n const loadingElement = this.#createLoading();\n ele.appendChild(loadingElement);\n this.loadingMap.set(ele, loadingElement);\n }\n };\n\n isLoading = (element = 'body') => {\n const ele = document.querySelector(element);\n return ele && this.loadingMap.has(ele);\n };\n\n stop = (element = 'body') => {\n const ele = document.querySelector(element);\n if (ele && this.loadingMap.has(ele)) {\n const loadingElement = this.loadingMap.get(ele);\n loadingElement?.remove();\n this.loadingMap.delete(ele);\n }\n };\n\n #createLoading = (): HTMLElement => {\n const renderer = this.renderer;\n const container: HTMLElement = this.renderer.createElement('div');\n const spinner: HTMLElement = this.renderer.createElement('div');\n const containerStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n height: '100%',\n width: '100%',\n opacity: 0.6,\n background: '#FFFFFF',\n 'z-index': 99999,\n };\n const spinnerStyle = {\n position: 'absolute',\n top: 'calc(50% - 2.5rem)',\n left: 'calc(50% - 2.5rem)',\n width: '5rem',\n height: '5rem',\n border: '0.5rem solid var(--sd-primary)',\n 'border-top': '0.5rem solid var(--sd-border)',\n 'border-radius': '50%',\n animation: 'spin 1s linear infinite',\n };\n const keyframes = `\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n `;\n\n renderer.addClass(container, 'sd-loading');\n renderer.setAttribute(container, 'id', this.loadingId);\n\n Object.entries(containerStyle).forEach(entry => {\n renderer.setStyle(container, entry[0], entry[1]);\n });\n\n renderer.addClass(spinner, 'sd-loading-spinner');\n Object.entries(spinnerStyle).forEach(entry => {\n renderer.setStyle(spinner, entry[0], entry[1]);\n });\n\n const styleElement = this.renderer.createElement('style');\n this.renderer.appendChild(styleElement, this.renderer.createText(keyframes));\n document.head.appendChild(styleElement);\n\n container.appendChild(spinner);\n return container;\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAKa,gBAAgB,CAAA;IACnB,SAAS,GAAG,uCAAuC;AAEn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AAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,KAAK,IAAG;AAC3C,YAAA,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AAChD,QAAA,CAAC,CAAC;QAEF,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC;AACzD,QAAA,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAC5E,QAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC;AAEvC,QAAA,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC;AAC9B,QAAA,OAAO,SAAS;AAClB,IAAA,CAAC;wGAnFU,gBAAgB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA;;4FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACJD;;AAEG;;;;"}
|
|
@@ -4,7 +4,8 @@ import { StringUtilities } from '@sdcorejs/utils/fns';
|
|
|
4
4
|
import { resolveMaybeAsync, normalizeAsync } from '@sdcorejs/utils/models';
|
|
5
5
|
export { normalizeAsync, resolveMaybeAsync } from '@sdcorejs/utils/models';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const DefaultSdIconSet = 'material-icons-outlined';
|
|
8
|
+
const DefaultSdMaterialIconSet = 'material-icons-outlined';
|
|
8
9
|
|
|
9
10
|
// `name` và `errorMessage` chứa i18n KEY (không phải chuỗi đã dịch).
|
|
10
11
|
/** @deprecated Use `VALIDATION_PATTERNS` from `@sdcorejs/utils/constants` instead. */
|
|
@@ -66,5 +67,5 @@ const SdOperators = [
|
|
|
66
67
|
* Generated bundle index. Do not edit.
|
|
67
68
|
*/
|
|
68
69
|
|
|
69
|
-
export {
|
|
70
|
+
export { DefaultSdIconSet, DefaultSdMaterialIconSet, SD_EMPTY_STR, SdNormalizeAsync, SdOperators, SdPatternCommons, SdResolveMaybeAsync };
|
|
70
71
|
//# sourceMappingURL=sdcorejs-angular-utilities-models.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdcorejs-angular-utilities-models.mjs","sources":["../../../projects/sdcorejs-angular/utilities/models/src/icon.model.ts","../../../projects/sdcorejs-angular/utilities/models/src/pattern.model.ts","../../../projects/sdcorejs-angular/utilities/models/src/empty.model.ts","../../../projects/sdcorejs-angular/utilities/models/src/maybe-async.model.ts","../../../projects/sdcorejs-angular/utilities/models/src/operator.model.ts","../../../projects/sdcorejs-angular/utilities/models/sdcorejs-angular-utilities-models.ts"],"sourcesContent":["export type
|
|
1
|
+
{"version":3,"file":"sdcorejs-angular-utilities-models.mjs","sources":["../../../projects/sdcorejs-angular/utilities/models/src/icon.model.ts","../../../projects/sdcorejs-angular/utilities/models/src/pattern.model.ts","../../../projects/sdcorejs-angular/utilities/models/src/empty.model.ts","../../../projects/sdcorejs-angular/utilities/models/src/maybe-async.model.ts","../../../projects/sdcorejs-angular/utilities/models/src/operator.model.ts","../../../projects/sdcorejs-angular/utilities/models/sdcorejs-angular-utilities-models.ts"],"sourcesContent":["export type SdIconSet = 'material-icons' | 'material-icons-outlined' | 'material-icons-round' | 'material-icons-sharp' | 'lucide';\nexport type SdMaterialIconSet = Exclude<SdIconSet, 'lucide'>;\nexport const DefaultSdIconSet: SdIconSet = 'material-icons-outlined';\nexport const DefaultSdMaterialIconSet: SdMaterialIconSet = '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 {\n type: 'PHONE_VN',\n name: 'core.validator.phone-vn.name',\n regex: StringUtilities.REGEX_VN_PHONE,\n errorMessage: 'core.validator.phone-vn.error',\n },\n { type: 'IDVN', name: 'core.validator.cccd.name', regex: StringUtilities.REGEX_VN_ID, errorMessage: 'core.validator.cccd.error' },\n {\n type: 'PASSPORT',\n name: 'core.validator.passport.name',\n regex: StringUtilities.REGEX_PASSPORT,\n errorMessage: 'core.validator.passport.error',\n },\n {\n type: 'IDVN_OR_PASSPORT',\n name: 'core.validator.id-vn.name',\n regex: StringUtilities.REGEX_VN_ID_OR_PASSPORT,\n errorMessage: 'core.validator.id-vn.error',\n },\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":";;;;;;AAEO,MAAM,gBAAgB,GAAc;AACpC,MAAM,wBAAwB,GAAsB;;ACoB3D;AACA;AACO,MAAM,gBAAgB,GAAsB;AACjD,IAAA,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,2BAA2B,EAAE,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,YAAY,EAAE,4BAA4B,EAAE;AACpI,IAAA,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,2BAA2B,EAAE,KAAK,EAAE,eAAe,CAAC,WAAW,EAAE,YAAY,EAAE,4BAA4B,EAAE;AACpI,IAAA;AACE,QAAA,IAAI,EAAE,UAAU;AAChB,QAAA,IAAI,EAAE,8BAA8B;QACpC,KAAK,EAAE,eAAe,CAAC,cAAc;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Ae,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,qCAAqC,EAAE;IACvF,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,+BAA+B,EAAE;IACpF,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,mCAAmC,EAAE;IACtF,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,kCAAkC,EAAE;IACjG,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,gCAAgC,EAAE;IAC3F,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,0BAA0B,EAAE;IAC7E,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,8BAA8B,EAAE;IAClF,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,4BAA4B,EAAE;IACrF,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,gCAAgC,EAAE;;;AChCpF;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdcorejs/angular",
|
|
3
|
-
"version": "21.0
|
|
3
|
+
"version": "21.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@sdcorejs/utils": "1.1.4",
|
|
13
|
+
"@lucide/angular": "^1.22.0",
|
|
13
14
|
"@ckeditor/ckeditor5-angular": "11.1.2",
|
|
14
15
|
"@omer-go/docx-parser-converter-ts": "^1.0.0",
|
|
15
16
|
"@bjorn3/browser_wasi_shim": "^0.4.2",
|
|
@@ -285,6 +286,10 @@
|
|
|
285
286
|
"types": "./types/sdcorejs-angular-modules-authom.d.ts",
|
|
286
287
|
"default": "./fesm2022/sdcorejs-angular-modules-authom.mjs"
|
|
287
288
|
},
|
|
289
|
+
"./modules/icon": {
|
|
290
|
+
"types": "./types/sdcorejs-angular-modules-icon.d.ts",
|
|
291
|
+
"default": "./fesm2022/sdcorejs-angular-modules-icon.mjs"
|
|
292
|
+
},
|
|
288
293
|
"./modules/keycloak": {
|
|
289
294
|
"types": "./types/sdcorejs-angular-modules-keycloak.d.ts",
|
|
290
295
|
"default": "./fesm2022/sdcorejs-angular-modules-keycloak.mjs"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { EventEmitter } from '@angular/core';
|
|
3
|
+
import { SdIconSet } from '@sdcorejs/angular/modules/icon';
|
|
3
4
|
import { Color, Size } from '@sdcorejs/utils/models';
|
|
4
|
-
import { MaterialIconFontSet } from '@sdcorejs/angular/utilities/models';
|
|
5
5
|
|
|
6
6
|
type SdBadgeType = 'tag' | 'round' | 'icon';
|
|
7
7
|
declare class SdBadge {
|
|
@@ -14,7 +14,7 @@ declare class SdBadge {
|
|
|
14
14
|
info: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
15
15
|
warning: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
16
16
|
error: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
17
|
-
fontSet: _angular_core.InputSignalWithTransform<
|
|
17
|
+
fontSet: _angular_core.InputSignalWithTransform<SdIconSet | undefined, SdIconSet | null | undefined>;
|
|
18
18
|
title: _angular_core.InputSignal<string | number | null | undefined>;
|
|
19
19
|
description: _angular_core.InputSignal<string | null | undefined>;
|
|
20
20
|
tooltip: _angular_core.InputSignal<string | null | undefined>;
|
|
@@ -33,7 +33,7 @@ declare class SdBadge {
|
|
|
33
33
|
}>;
|
|
34
34
|
iconColorClasses: _angular_core.Signal<{
|
|
35
35
|
'c-primary': boolean;
|
|
36
|
-
'c-
|
|
36
|
+
'c-secondary': boolean;
|
|
37
37
|
'c-info': boolean;
|
|
38
38
|
'c-success': boolean;
|
|
39
39
|
'c-warning': boolean;
|
|
@@ -43,11 +43,8 @@ declare class SdBadge {
|
|
|
43
43
|
'c-sm': boolean;
|
|
44
44
|
'c-md': boolean;
|
|
45
45
|
'c-lg': boolean;
|
|
46
|
-
'material-icons': boolean;
|
|
47
|
-
'material-icons-outlined': boolean;
|
|
48
|
-
'material-icons-round': boolean;
|
|
49
|
-
'material-icons-sharp': boolean;
|
|
50
46
|
}>;
|
|
47
|
+
iconCssSize: _angular_core.Signal<"18px" | "24px" | "16px">;
|
|
51
48
|
containerSizeClasses: _angular_core.Signal<{
|
|
52
49
|
'c-badge--sm': boolean;
|
|
53
50
|
'c-badge--md': boolean;
|
|
@@ -63,10 +60,6 @@ declare class SdBadge {
|
|
|
63
60
|
'c-sm': boolean;
|
|
64
61
|
'c-md': boolean;
|
|
65
62
|
'c-lg': boolean;
|
|
66
|
-
'material-icons': boolean;
|
|
67
|
-
'material-icons-outlined': boolean;
|
|
68
|
-
'material-icons-round': boolean;
|
|
69
|
-
'material-icons-sharp': boolean;
|
|
70
63
|
}>;
|
|
71
64
|
containerCombinedClasses: _angular_core.Signal<{
|
|
72
65
|
'c-badge--sm': boolean;
|
|
@@ -81,7 +74,7 @@ declare class SdBadge {
|
|
|
81
74
|
}>;
|
|
82
75
|
iconCombinedClasses: _angular_core.Signal<{
|
|
83
76
|
'c-primary': boolean;
|
|
84
|
-
'c-
|
|
77
|
+
'c-secondary': boolean;
|
|
85
78
|
'c-info': boolean;
|
|
86
79
|
'c-success': boolean;
|
|
87
80
|
'c-warning': boolean;
|
|
@@ -89,10 +82,6 @@ declare class SdBadge {
|
|
|
89
82
|
'c-sm': boolean;
|
|
90
83
|
'c-md': boolean;
|
|
91
84
|
'c-lg': boolean;
|
|
92
|
-
'material-icons': boolean;
|
|
93
|
-
'material-icons-outlined': boolean;
|
|
94
|
-
'material-icons-round': boolean;
|
|
95
|
-
'material-icons-sharp': boolean;
|
|
96
85
|
}>;
|
|
97
86
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdBadge, never>;
|
|
98
87
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdBadge, "sd-badge", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "primary": { "alias": "primary"; "required": false; "isSignal": true; }; "secondary": { "alias": "secondary"; "required": false; "isSignal": true; }; "success": { "alias": "success"; "required": false; "isSignal": true; }; "info": { "alias": "info"; "required": false; "isSignal": true; }; "warning": { "alias": "warning"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "fontSet": { "alias": "fontSet"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "click": "click"; }, never, never, true, never>;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { OnInit, OnDestroy } from '@angular/core';
|
|
3
3
|
import { Color } from '@sdcorejs/utils/models';
|
|
4
|
-
import {
|
|
4
|
+
import { SdIconSet } from '@sdcorejs/angular/modules/icon';
|
|
5
5
|
|
|
6
|
-
type SdButtonType = 'fill' | 'light' | 'outline' | '
|
|
6
|
+
type SdButtonType = 'fill' | 'light' | 'outline' | 'text';
|
|
7
7
|
type SdButtonSize = 'sm' | 'md' | 'lg';
|
|
8
8
|
type SdButtonHtmlType = 'button' | 'submit' | 'reset';
|
|
9
|
+
type SdButtonColor = Color | 'black';
|
|
9
10
|
declare class SdButton implements OnInit, OnDestroy {
|
|
10
11
|
#private;
|
|
11
12
|
private el;
|
|
12
13
|
autoIdInput: _angular_core.InputSignal<string | null | undefined>;
|
|
13
14
|
type: _angular_core.InputSignalWithTransform<SdButtonType, SdButtonType | null | undefined>;
|
|
14
|
-
color: _angular_core.InputSignalWithTransform<
|
|
15
|
+
color: _angular_core.InputSignalWithTransform<SdButtonColor, SdButtonColor | null | undefined>;
|
|
15
16
|
size: _angular_core.InputSignalWithTransform<SdButtonSize, SdButtonSize | null | undefined>;
|
|
16
|
-
fontSet: _angular_core.InputSignalWithTransform<
|
|
17
|
+
fontSet: _angular_core.InputSignalWithTransform<SdIconSet | undefined, SdIconSet | null | undefined>;
|
|
17
18
|
title: _angular_core.InputSignal<string | null | undefined>;
|
|
18
19
|
width: _angular_core.InputSignal<string | null | undefined>;
|
|
19
20
|
tooltip: _angular_core.InputSignal<string | null | undefined>;
|
|
@@ -29,6 +30,7 @@ declare class SdButton implements OnInit, OnDestroy {
|
|
|
29
30
|
'c-sm': boolean;
|
|
30
31
|
'c-md': boolean;
|
|
31
32
|
'c-lg': boolean;
|
|
33
|
+
'c-black': boolean;
|
|
32
34
|
'c-disabled': boolean;
|
|
33
35
|
'c-block': boolean;
|
|
34
36
|
}>;
|
|
@@ -42,4 +44,4 @@ declare class SdButton implements OnInit, OnDestroy {
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
export { SdButton };
|
|
45
|
-
export type { SdButtonHtmlType, SdButtonSize, SdButtonType };
|
|
47
|
+
export type { SdButtonColor, SdButtonHtmlType, SdButtonSize, SdButtonType };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { ElementRef } from '@angular/core';
|
|
3
3
|
import { Color } from '@sdcorejs/utils/models';
|
|
4
|
-
import {
|
|
4
|
+
import { SdIconSet } from '@sdcorejs/angular/modules/icon';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Marker cho vùng action custom chiếu vào <sd-inform>.
|
|
@@ -25,7 +25,7 @@ declare class SdInform {
|
|
|
25
25
|
description: _angular_core.InputSignal<string | undefined>;
|
|
26
26
|
icon: _angular_core.InputSignal<string | undefined>;
|
|
27
27
|
hideIcon: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
28
|
-
fontSet: _angular_core.InputSignalWithTransform<
|
|
28
|
+
fontSet: _angular_core.InputSignalWithTransform<SdIconSet | undefined, SdIconSet | null | undefined>;
|
|
29
29
|
closable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
30
30
|
actionLabel: _angular_core.InputSignal<string | undefined>;
|
|
31
31
|
lineClamp: _angular_core.InputSignal<number | undefined>;
|
|
@@ -47,12 +47,6 @@ declare class SdInform {
|
|
|
47
47
|
'c-error': boolean;
|
|
48
48
|
}>;
|
|
49
49
|
effectiveIcon: _angular_core.Signal<string | null>;
|
|
50
|
-
fontSetClasses: _angular_core.Signal<{
|
|
51
|
-
'material-icons': boolean;
|
|
52
|
-
'material-icons-outlined': boolean;
|
|
53
|
-
'material-icons-round': boolean;
|
|
54
|
-
'material-icons-sharp': boolean;
|
|
55
|
-
}>;
|
|
56
50
|
hasActionSlot: _angular_core.Signal<boolean>;
|
|
57
51
|
clampLines: _angular_core.Signal<number | null>;
|
|
58
52
|
showToggle: _angular_core.Signal<boolean>;
|
|
@@ -27,7 +27,7 @@ declare class SdModal {
|
|
|
27
27
|
open: () => void;
|
|
28
28
|
close: () => void;
|
|
29
29
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdModal, never>;
|
|
30
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdModal, "sd-modal", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "modalClass": { "alias": "modalClass"; "required": false; "isSignal": true; }; "lazyLoadContent": { "alias": "lazyLoadContent"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; "disableBackdropClose": { "alias": "disableBackdropClose"; "required": false; "isSignal": true; }; }, { "sdClosed": "sdClosed"; }, never, ["[sdHeaderLeft]", "[sdHeaderRight]", "
|
|
30
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdModal, "sd-modal", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "modalClass": { "alias": "modalClass"; "required": false; "isSignal": true; }; "lazyLoadContent": { "alias": "lazyLoadContent"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; "disableBackdropClose": { "alias": "disableBackdropClose"; "required": false; "isSignal": true; }; }, { "sdClosed": "sdClosed"; }, never, ["[sdHeaderLeft]", "[sdHeaderRight]", "*", "[sdFooterLeft]", "[sdFooterRight]"], true, never>;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export { SdModal };
|
|
@@ -150,7 +150,7 @@ interface QbDateModeOption {
|
|
|
150
150
|
icon: string;
|
|
151
151
|
}
|
|
152
152
|
/** Stable option list for the date-mode select (module ref — never reallocated). */
|
|
153
|
-
declare const QB_DATE_MODES:
|
|
153
|
+
declare const QB_DATE_MODES: QbDateModeOption[];
|
|
154
154
|
/** One value-source option for field-to-field comparison UI. */
|
|
155
155
|
interface QbValueSourceOption {
|
|
156
156
|
value: QbValueSource;
|
|
@@ -159,9 +159,9 @@ interface QbValueSourceOption {
|
|
|
159
159
|
icon: string;
|
|
160
160
|
}
|
|
161
161
|
/** Stable option list for choosing between a literal value and another field. */
|
|
162
|
-
declare const QB_VALUE_SOURCE_OPTIONS:
|
|
162
|
+
declare const QB_VALUE_SOURCE_OPTIONS: QbValueSourceOption[];
|
|
163
163
|
/** Stable combined direction×unit option list (token `'unit:direction'`). */
|
|
164
|
-
declare const QB_RELATIVE_UNIT_OPTIONS:
|
|
164
|
+
declare const QB_RELATIVE_UNIT_OPTIONS: {
|
|
165
165
|
value: string;
|
|
166
166
|
display: string;
|
|
167
167
|
}[];
|
|
@@ -204,11 +204,11 @@ declare class SdQueryBuilder {
|
|
|
204
204
|
readonly resolvedAutoId: _angular_core.Signal<string | undefined>;
|
|
205
205
|
readonly fieldByKey: _angular_core.Signal<Record<string, SdQueryBuilderField>>;
|
|
206
206
|
/** Stable option list for the date-mode select. */
|
|
207
|
-
readonly dateModes:
|
|
207
|
+
readonly dateModes: _sdcorejs_angular_components_query_builder.QbDateModeOption[];
|
|
208
208
|
/** Stable option list for the literal-vs-field operand select. */
|
|
209
|
-
readonly valueSourceOptions:
|
|
209
|
+
readonly valueSourceOptions: _sdcorejs_angular_components_query_builder.QbValueSourceOption[];
|
|
210
210
|
/** Stable combined unit×direction option list for the relative select. */
|
|
211
|
-
readonly relativeUnitOptions:
|
|
211
|
+
readonly relativeUnitOptions: {
|
|
212
212
|
value: string;
|
|
213
213
|
display: string;
|
|
214
214
|
}[];
|
|
@@ -9,15 +9,11 @@ declare class SdSection {
|
|
|
9
9
|
iconColor: _angular_core.InputSignal<Color>;
|
|
10
10
|
collapsed: _angular_core.ModelSignal<boolean>;
|
|
11
11
|
collapsible: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
12
|
-
/** @deprecated Use `collapsible` instead. */
|
|
13
|
-
collapsable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
14
|
-
readonly isCollapsible: _angular_core.Signal<boolean>;
|
|
15
12
|
hideHeader: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
16
|
-
noPaddingBody: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
17
13
|
constructor();
|
|
18
14
|
toggleCollapse: () => void;
|
|
19
15
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdSection, never>;
|
|
20
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdSection, "sd-section", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "subTitle": { "alias": "subTitle"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconColor": { "alias": "iconColor"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "
|
|
16
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdSection, "sd-section", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "subTitle": { "alias": "subTitle"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconColor": { "alias": "iconColor"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "hideHeader": { "alias": "hideHeader"; "required": false; "isSignal": true; }; }, { "collapsed": "collapsedChange"; }, never, ["[sdHeaderLeft]", "[sdHeaderRight]", "*", "[sdFooterLeft]", "[sdFooterRight]"], true, never>;
|
|
21
17
|
}
|
|
22
18
|
|
|
23
19
|
declare class SdSectionItem {
|
|
@@ -26,7 +26,7 @@ declare class SdSideDrawer {
|
|
|
26
26
|
stopLoading: () => void;
|
|
27
27
|
preventScroll: (event: Event) => void;
|
|
28
28
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdSideDrawer, never>;
|
|
29
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdSideDrawer, "sd-side-drawer", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; "disableBackdropClose": { "alias": "disableBackdropClose"; "required": false; "isSignal": true; }; "drawerClass": { "alias": "drawerClass"; "required": false; "isSignal": true; }; "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; }, { "sdClosed": "sdClosed"; }, never, ["[sdHeaderLeft]", "[sdHeaderRight]", "*", "[
|
|
29
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdSideDrawer, "sd-side-drawer", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; "disableBackdropClose": { "alias": "disableBackdropClose"; "required": false; "isSignal": true; }; "drawerClass": { "alias": "drawerClass"; "required": false; "isSignal": true; }; "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; }, { "sdClosed": "sdClosed"; }, never, ["[sdHeaderLeft]", "[sdHeaderRight]", "*", "[sdFooterLeft]", "[sdFooterRight]"], true, never>;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export { SdSideDrawer };
|
|
@@ -3,12 +3,13 @@ import { TemplateRef, Signal, EventEmitter, ChangeDetectorRef, InjectionToken, A
|
|
|
3
3
|
import { SdBadge } from '@sdcorejs/angular/components/badge';
|
|
4
4
|
import { SdSearch } from '@sdcorejs/angular/forms';
|
|
5
5
|
import { Operator, NestedKeyOf, Order, PagingReq, Color } from '@sdcorejs/utils/models';
|
|
6
|
-
import { SdUnwrapSignal
|
|
6
|
+
import { SdUnwrapSignal } from '@sdcorejs/angular/utilities/models';
|
|
7
7
|
import { MatPaginatorIntl, MatPaginator } from '@angular/material/paginator';
|
|
8
8
|
import { MatSort } from '@angular/material/sort';
|
|
9
9
|
import { MatTable } from '@angular/material/table';
|
|
10
10
|
import { SdExcelColumn, SdLoadingService, SdExcelService, SdNotifyService, SdConfirmService } from '@sdcorejs/angular/services';
|
|
11
11
|
import { Observable } from 'rxjs';
|
|
12
|
+
import { SdIconSet } from '@sdcorejs/angular/modules/icon';
|
|
12
13
|
import { SdButton } from '@sdcorejs/angular/components/button';
|
|
13
14
|
import { CdkDrag, CdkDropList, CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
14
15
|
import { SdQuickAction } from '@sdcorejs/angular/components/quick-action';
|
|
@@ -341,8 +342,6 @@ interface SdTableOptionFilter<T = any> {
|
|
|
341
342
|
manualFilter?: boolean;
|
|
342
343
|
/** Có thể thu gọn bộ lọc hay không */
|
|
343
344
|
collapsible?: boolean;
|
|
344
|
-
/** @deprecated Use `collapsible` instead. */
|
|
345
|
-
collapsable?: boolean;
|
|
346
345
|
/** Ẩn toolbar (xóa bộ lọc, thiết lập) của external filter, khi có ít external filter user không cần chức năng này */
|
|
347
346
|
hideExternalFilterToolbar?: boolean;
|
|
348
347
|
/** Hàm xử lý khi trigger clear filter từ external filter */
|
|
@@ -451,7 +450,7 @@ type SdTableCommand<T = any> = SdTableCommandNormal<T> | SdTableCommandChildren<
|
|
|
451
450
|
interface SdTableCommandNormal<T = any> {
|
|
452
451
|
color?: Color;
|
|
453
452
|
icon?: string | ((rowData: T) => string);
|
|
454
|
-
fontSet?:
|
|
453
|
+
fontSet?: SdIconSet;
|
|
455
454
|
title?: string | ((rowData: T) => string);
|
|
456
455
|
disabled?: boolean | ((rowData: T) => boolean);
|
|
457
456
|
hidden?: boolean | ((rowData: T) => boolean | Promise<boolean>);
|
|
@@ -460,7 +459,7 @@ interface SdTableCommandNormal<T = any> {
|
|
|
460
459
|
}
|
|
461
460
|
interface SdTableCommandChildren<T = any> {
|
|
462
461
|
icon?: string | ((rowData: T) => string);
|
|
463
|
-
fontSet?:
|
|
462
|
+
fontSet?: SdIconSet;
|
|
464
463
|
title?: string | ((rowData: T) => string);
|
|
465
464
|
disabled?: boolean | ((rowData: T) => boolean);
|
|
466
465
|
hidden?: boolean | ((rowData: T) => boolean | Promise<boolean>);
|
|
@@ -635,13 +634,13 @@ type SdTableAction<T = any> = SdTableActionNormal<T> | SdTableActionChildren<T>;
|
|
|
635
634
|
interface SdTableActionNormal<T = any> {
|
|
636
635
|
/**
|
|
637
636
|
* Tên icon hiển thị trên action button.
|
|
638
|
-
* Giá trị này được render qua `
|
|
637
|
+
* Giá trị này được render qua `sd-icon`, vì vậy nên dùng đúng tên glyph của configured icon set.
|
|
639
638
|
* Tra cứu icon tại: https://fonts.google.com/icons
|
|
640
639
|
*/
|
|
641
640
|
icon?: string;
|
|
642
641
|
/**
|
|
643
|
-
* Font set của
|
|
644
|
-
* Kiểu thực tế lấy từ `SdButton['fontSet']` và chỉ hỗ trợ các giá trị thuộc `
|
|
642
|
+
* Font set của icon.
|
|
643
|
+
* Kiểu thực tế lấy từ `SdButton['fontSet']` và chỉ hỗ trợ các giá trị thuộc `SdIconSet`,
|
|
645
644
|
* ví dụ: `material-icons`, `material-icons-outlined`, `material-icons-round`,
|
|
646
645
|
* `material-icons-sharp`.
|
|
647
646
|
* Nếu không truyền, `SdButton` sẽ dùng font set mặc định của nó.
|
|
@@ -672,11 +671,11 @@ interface SdTableActionNormal<T = any> {
|
|
|
672
671
|
interface SdTableActionChildren<T = any> {
|
|
673
672
|
/**
|
|
674
673
|
* Tên icon của action cha (group action).
|
|
675
|
-
* Giá trị nên là tên glyph
|
|
674
|
+
* Giá trị nên là tên glyph configured icon set: https://fonts.google.com/icons
|
|
676
675
|
*/
|
|
677
676
|
icon?: string;
|
|
678
677
|
/**
|
|
679
|
-
* Font set của
|
|
678
|
+
* Font set của icon cho action cha.
|
|
680
679
|
* Dùng cùng kiểu dữ liệu với `SdButton['fontSet']`.
|
|
681
680
|
*/
|
|
682
681
|
fontSet?: SdUnwrapSignal<SdButton['fontSet']>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { Signal, TemplateRef } from '@angular/core';
|
|
3
3
|
import { SdButton } from '@sdcorejs/angular/components/button';
|
|
4
|
-
import {
|
|
4
|
+
import { SdIconSet } from '@sdcorejs/angular/modules/icon';
|
|
5
|
+
import { SdUnwrapSignal } from '@sdcorejs/angular/utilities/models';
|
|
5
6
|
import { Color } from '@sdcorejs/utils/models';
|
|
6
7
|
|
|
7
8
|
type SdTreeDataSource<TItem = any> = TItem[] | Signal<TItem[]> | (() => TItem[] | Promise<TItem[]>);
|
|
@@ -60,7 +61,7 @@ interface SdTreeCommand<T = any> {
|
|
|
60
61
|
title: string | ((item: T) => string);
|
|
61
62
|
icon?: string | ((item: T) => string | undefined | null);
|
|
62
63
|
color?: Color;
|
|
63
|
-
fontSet?:
|
|
64
|
+
fontSet?: SdIconSet;
|
|
64
65
|
disabled?: boolean | ((item: T) => boolean);
|
|
65
66
|
hidden?: boolean | ((item: T) => boolean);
|
|
66
67
|
click: (item: T) => void;
|