@es.framework/ng.ui.core 2.0.65 → 2.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/es.framework-ng.ui.core-breadcrumb.mjs +7 -6
- package/fesm2022/es.framework-ng.ui.core-breadcrumb.mjs.map +1 -1
- package/fesm2022/es.framework-ng.ui.core-generic-button.mjs +8 -2
- package/fesm2022/es.framework-ng.ui.core-generic-button.mjs.map +1 -1
- package/fesm2022/es.framework-ng.ui.core-generic-crud-table.mjs +24 -6
- package/fesm2022/es.framework-ng.ui.core-generic-crud-table.mjs.map +1 -1
- package/fesm2022/es.framework-ng.ui.core-generic-report.mjs +19 -1
- package/fesm2022/es.framework-ng.ui.core-generic-report.mjs.map +1 -1
- package/fesm2022/es.framework-ng.ui.core-generic-search-advanced.mjs +76 -53
- package/fesm2022/es.framework-ng.ui.core-generic-search-advanced.mjs.map +1 -1
- package/fesm2022/es.framework-ng.ui.core-generic-table.mjs +14 -6
- package/fesm2022/es.framework-ng.ui.core-generic-table.mjs.map +1 -1
- package/fesm2022/es.framework-ng.ui.core-generic-view.mjs +1 -1
- package/fesm2022/es.framework-ng.ui.core-generic-view.mjs.map +1 -1
- package/package.json +1 -1
- package/types/es.framework-ng.ui.core-generic-button.d.ts +3 -1
- package/types/es.framework-ng.ui.core-generic-crud-table.d.ts +2 -0
- package/types/es.framework-ng.ui.core-generic-report.d.ts +1 -0
- package/types/es.framework-ng.ui.core-generic-search-advanced.d.ts +5 -2
- package/types/es.framework-ng.ui.core-generic-table.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es.framework-ng.ui.core-generic-report.mjs","sources":["../../../../libs/ng.ui.core/generic-report/src/lib/generic-report-module.ts","../../../../libs/ng.ui.core/generic-report/src/lib/report-name-dialog.component.ts","../../../../libs/ng.ui.core/generic-report/src/lib/generic-report.component.ts","../../../../libs/ng.ui.core/generic-report/src/lib/generic-report.component.html","../../../../libs/ng.ui.core/generic-report/src/es.framework-ng.ui.core-generic-report.ts"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class GenericReportModule {}\n","// report-name-dialog.component.ts\r\nimport { Component, inject } from '@angular/core';\r\n\r\nimport { FormsModule } from '@angular/forms';\r\nimport { TranslatePipe } from '@es.framework/ng.core/pipes';\r\nimport { DynamicDialogRef, DynamicDialogConfig } from 'primeng/dynamicdialog';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { InputTextModule } from 'primeng/inputtext';\r\nimport { LocalizationService } from '@es.framework/ng.core/services';\r\n\r\n@Component({\r\n selector: 'app-report-name-dialog',\r\n standalone: true,\r\n imports: [\r\n FormsModule,\r\n TranslatePipe,\r\n ButtonModule,\r\n InputTextModule\r\n],\r\n template: `\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"fileName\" class=\"block text-sm font-medium mb-2\">\r\n {{ 'REPORT_NAME' | translate }}\r\n </label>\r\n <input\r\n id=\"fileName\"\r\n type=\"text\"\r\n [(ngModel)]=\"fileName\"\r\n pInputText\r\n class=\"w-full\"\r\n [placeholder]=\"'ENTER_REPORT_NAME' | translate\"\r\n autofocus>\r\n </div>\r\n </div>\r\n\r\n <div class=\"flex justify-end gap-2 mt-4\">\r\n <button\r\n type=\"button\"\r\n pButton\r\n class=\"p-button-text\"\r\n (click)=\"ref.close()\"\r\n [label]=\"'CANCEL' | translate\">\r\n </button>\r\n <button\r\n type=\"button\"\r\n pButton\r\n (click)=\"save()\"\r\n [label]=\"'SAVE' | translate\">\r\n </button>\r\n </div>\r\n `\r\n})\r\nexport class ReportNameDialogComponent {\r\n fileName: string = '';\r\n\r\n ref = inject(DynamicDialogRef);\r\n config = inject(DynamicDialogConfig);\r\n translate = inject(LocalizationService);\r\n\r\n ngOnInit() {\r\n this.fileName = this.config.data?.fileName || '';\r\n }\r\n\r\n save() {\r\n if (this.fileName?.trim()) {\r\n this.ref.close(this.fileName.trim());\r\n }\r\n }\r\n}\r\n","\r\nimport { Component, inject, OnInit, ViewChild, ElementRef, Input, OnDestroy } from '@angular/core';\r\nimport { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { FormlyFieldConfig, FormlyFormOptions, FormlyForm } from '@ngx-formly/core';\r\nimport { TranslatePipe } from '@es.framework/ng.core/pipes';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { DialogModule } from 'primeng/dialog';\r\nimport { InputTextModule } from 'primeng/inputtext';\r\nimport { RadioButtonModule } from 'primeng/radiobutton';\r\nimport { CheckboxModule } from 'primeng/checkbox';\r\nimport { DynamicDialogRef, DynamicDialogConfig, DialogService } from 'primeng/dynamicdialog';\r\nimport { LocalizationService, RestService } from '@es.framework/ng.core/services';\r\nimport { Subject, takeUntil } from 'rxjs';\r\nimport { DrawerModule } from 'primeng/drawer';\r\nimport { TableModule } from 'primeng/table';\r\nimport { SplitButtonModule } from 'primeng/splitbutton';\r\nimport { MenuItem } from 'primeng/api';\r\nimport { TooltipModule } from 'primeng/tooltip';\r\nimport { ReportNameDialogComponent } from './report-name-dialog.component';\r\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\r\nimport { QueryBuilderService } from '@es.framework/ng.ui.core/generic-search-advanced';\r\n\r\nexport interface ExportConfig {\r\n filters: any;\r\n exportType: ExportType;\r\n fileName?: string;\r\n}\r\n\r\nexport enum ExportType {\r\n LIST,\r\n HTML,\r\n PDF,\r\n EXCEL,\r\n PRINT\r\n}\r\n\r\n@Component({\r\n selector: 'app-generic-report',\r\n templateUrl: './generic-report.component.html',\r\n imports: [\r\n ReactiveFormsModule,\r\n FormsModule,\r\n TranslatePipe,\r\n ButtonModule,\r\n DialogModule,\r\n InputTextModule,\r\n RadioButtonModule,\r\n CheckboxModule,\r\n DrawerModule,\r\n FormlyForm,\r\n TableModule,\r\n SplitButtonModule,\r\n TooltipModule\r\n],\r\n providers:[DialogService,RestService]\r\n})\r\nexport class GenericReportComponent implements OnInit, OnDestroy {\r\n @ViewChild('previewContainer') previewContainer!: ElementRef;\r\n\r\n @Input() filterFields: FormlyFieldConfig[] = [];\r\n fields_: FormlyFieldConfig[] = [];\r\n exportType: ExportType = ExportType.PDF;\r\n fileName: string = '';\r\n showFilters: boolean = false;\r\n loading: boolean = false;\r\n currentDate: Date = new Date();\r\n previewData: any[] = [];\r\n htmlExportContent: string = '';\r\n showHtmlInIframe: boolean = false;\r\n previewColumns: any[] = [];\r\n\r\n options: FormlyFormOptions = {};\r\n @Input() enableQueryBuilder: boolean = true;\r\n @Input() localExport: boolean = false;\r\n @Input() queryString: string = '';\r\n @Input() apiName: string = '';\r\n @Input() moduleName: string = '';\r\n\r\n @Input() model: any = {};\r\n form = new FormGroup({});\r\n exportConfig!: ExportConfig;\r\n\r\n exportTypes = [\r\n { value: ExportType.EXCEL, label: 'EXCEL', icon: 'pi pi-file-excel' },\r\n { value: ExportType.PDF, label: 'PDF', icon: 'pi pi-file-pdf' },\r\n { value: ExportType.HTML, label: 'HTML', icon: 'pi pi-code' },\r\n { value: ExportType.PRINT, label: 'PRINT', icon: 'pi pi-print' }\r\n ];\r\n\r\n exportMenuItems: MenuItem[] = [];\r\n\r\n private destroy$ = new Subject<void>();\r\n private dialogService:DialogService = inject(DialogService);\r\n private translate = inject(LocalizationService);\r\n private restService: RestService = inject(RestService);\r\n private queryBuilder = inject(QueryBuilderService);\r\nprivate sanitizer: DomSanitizer = inject(DomSanitizer);\r\n constructor(\r\n public ref: DynamicDialogRef,\r\n public config: DynamicDialogConfig\r\n ) {}\r\n\r\n ngOnDestroy() {\r\n this.destroy$.next();\r\n this.destroy$.complete();\r\n\r\n if (this.ref) {\r\n try {\r\n this.ref.close();\r\n } catch (e) {\r\n // Ignore errors during cleanup\r\n }\r\n }\r\n }\r\n\r\n ngOnInit() {\r\n this.filterFields = this.config.data?.filterFields || [];\r\n this.buildQueryUIFields();\r\n this.initializeComponent();\r\n this.initializeExportConfig();\r\n this.initializeExportMenu();\r\n }\r\n get filterCount() {\r\n\r\n return this.queryBuilder.getAppliedFiltersCount(this.model).total;\r\n }\r\n private buildQueryUIFields() {\r\n if (this.enableQueryBuilder) {\r\n this.fields_ = this.queryBuilder.buildQueryUIFields(this.filterFields,true,true);\r\n } else {\r\n this.fields_ = this.filterFields;\r\n }\r\n }\r\n\r\n private initializeComponent() {\r\n this.apiName = this.config.data?.apiName || '';\r\n this.moduleName = this.config.data?.moduleName || '';\r\n this.initializeFilterFields();\r\n this.onExport();\r\n }\r\n\r\n private initializeFilterFields() {\r\n this.filterFields = this.config.data?.filterFields || this.getDefaultFilterFields();\r\n this.model = this.config.data?.model || {};\r\n this.fileName = this.config.data?.defaultFileName || `export_${new Date().toISOString().split('T')[0]}`;\r\n }\r\n\r\n private initializeExportConfig() {\r\n this.exportConfig = {\r\n filters: this.model,\r\n exportType: this.exportType,\r\n fileName: this.fileName\r\n };\r\n }\r\n\r\n private initializeExportMenu() {\r\n this.exportMenuItems = [\r\n // Edit Report Name menu item\r\n {\r\n label: this.translate.instant('EDIT_REPORT_NAME'),\r\n icon: 'pi pi-pencil',\r\n command: () => this.openReportNameDialog()\r\n },\r\n // Separator\r\n { separator: true },\r\n // Export type menu items\r\n ...this.exportTypes.map(type => ({\r\n label: this.translate.instant(type.label),\r\n icon: type.icon,\r\n command: () => this.onExportTypeChange(type.value)\r\n }))\r\n ];\r\n}\r\n\r\nprivate openReportNameDialog() {\r\n const ref = this.dialogService.open(ReportNameDialogComponent, {\r\n header: this.translate.instant('EDIT_REPORT_NAME'),\r\n width: '500px',\r\n data: {\r\n fileName: this.fileName\r\n }\r\n });\r\n\r\n ref?.onClose.subscribe((result: string) => {\r\n if (result) {\r\n this.fileName = result;\r\n }\r\n });\r\n}\r\n\r\n private getDefaultFilterFields(): FormlyFieldConfig[] {\r\n return [\r\n {\r\n key: 'search',\r\n type: 'input',\r\n props: {\r\n label: this.translate.instant('SEARCH'),\r\n placeholder: this.translate.instant('ENTER_SEARCH_TERM'),\r\n }\r\n }\r\n ];\r\n }\r\n\r\n // Query and Preview Methods\r\n generatePreview() {\r\n this.onExport();\r\n }\r\n\r\n onSubmit() {\r\n const odataParams = this.queryBuilder.buildODataFromQueryModel(this.model, this.filterFields);\r\n this.queryString = this.queryBuilder.toODataQueryString(odataParams);\r\n this.onExport();\r\n }\r\n\r\n onReset() {\r\n this.exportType = ExportType.PDF;\r\n this.fileName = `export_${new Date().toISOString().split('T')[0]}`;\r\n this.form.reset();\r\n this.model = {};\r\n this.generatePreview();\r\n }\r\n\r\n // Export Methods\r\n onExport() {\r\n this.loading = true;\r\n const exportConfig = this.createExportConfig();\r\n this.handleApiExport(exportConfig);\r\n }\r\n\r\n private createExportConfig(): any {\r\n return {\r\n filters: this.model,\r\n exportType: this.exportType,\r\n fileName: this.fileName\r\n };\r\n }\r\n\r\n private handleApiExport(config: any) {\r\n if (this.form.invalid) return;\r\n\r\n const requestOptions = this.createRequestOptions(config);\r\n\r\n this.restService.request<any, any>(\r\n requestOptions,\r\n { apiName: this.apiName , moduleName: this.moduleName }\r\n )\r\n .pipe(takeUntil(this.destroy$))\r\n .subscribe({\r\n next: (response) => {\r\n this.handleExportResponse(response, config);\r\n },\r\n error: (error) => {\r\n console.error('Export failed:', error);\r\n this.loading = false;\r\n }\r\n });\r\n }\r\n\r\n private createRequestOptions(config: any): any {\r\n // Default query\r\n if(!this.queryString || this.queryString == ''){\r\n\r\n // Use the new QueryBuilderService methods\r\n const odataParams = this.queryBuilder.buildODataFromQueryModel(this.model, this.filterFields);\r\n // this.odataSearch.emit(odataParams);\r\n\r\n // Generate query string using the unified method\r\n this.queryString = this.queryBuilder.toODataQueryString(odataParams);\r\n // console.log('OData Query String:', queryString);\r\n\r\n }\r\n const filters: Partial<any> = {\r\n fileName: config.fileName || '',\r\n query: this.queryString,\r\n exportType: config.exportType,\r\n };\r\n\r\n\r\n\r\n const params = Object.keys(filters).reduce((acc: any, key) => {\r\n acc[key] = filters[key];\r\n return acc;\r\n }, {});\r\n\r\n const requestOptions: any = {\r\n method: 'GET',\r\n url: `/${this.apiName}/export`,\r\n params: params\r\n };\r\n\r\n if (config.exportType === ExportType.HTML) {\r\n requestOptions.responseType = 'text';\r\n }\r\n\r\n return requestOptions;\r\n }\r\n\r\n // private handleExportResponse(response: any, config: any) {\r\n // this.loading = false;\r\n\r\n // if (config.exportType === ExportType.HTML) {\r\n // this.showHtmlExport(response);\r\n // } else {\r\n // this.downloadBinaryExport(response, config);\r\n // }\r\n // }\r\n private handleExportResponse(response: any, config: any) {\r\n this.loading = false;\r\n\r\n if (config.exportType === ExportType.HTML) {\r\n this.showHtmlExport(response);\r\n // } else if (config.exportType === ExportType.PDF && this.isMobileDevice()) {\r\n } else if (config.exportType === ExportType.PDF) {\r\n this.showPdfInMobile(response, config);\r\n } else {\r\n this.downloadBinaryExport(response, config);\r\n }\r\n }\r\n // Platform detection methods\r\nprivate isMobileDevice(): boolean {\r\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\r\n}\r\n\r\nprivate isIOS(): boolean {\r\n return /iPad|iPhone|iPod/.test(navigator.userAgent);\r\n}\r\n\r\nprivate isAndroid(): boolean {\r\n return /Android/.test(navigator.userAgent);\r\n}\r\n showPdfModal = false;\r\n currentPdfUrl?:SafeResourceUrl;\r\n currentFileName = '';\r\n private showPdfInMobile(base64Data: string, config: any): void {\r\n\r\n\r\n try {\r\n const blob = this.base64ToBlob(base64Data, this.getMimeType(ExportType.PDF));\r\n this.currentPdfUrl = this.sanitizeUrl(URL.createObjectURL(blob));\r\n this.currentFileName = `${config.fileName}.pdf`;\r\n this.showPdfModal = true;\r\n } catch (error) {\r\n var error = 'PDF is too large for mobile viewing. Please download instead.';\r\n } finally {\r\n // this.loading = false;\r\n }\r\n }\r\n\r\n\r\n private sanitizeUrl(url: string): SafeResourceUrl {\r\n return this.sanitizer.bypassSecurityTrustResourceUrl(url);\r\n }\r\n\r\n // onPdfModalClose(): void {\r\n // this.showPdfModal = false;\r\n // if (this.currentPdfUrl) {\r\n // URL.revokeObjectURL(this.currentPdfUrl);\r\n // this.currentPdfUrl = '';\r\n // }\r\n // }\r\n\r\n onPdfDownload(): void {\r\n // Trigger download\r\n // const blob = this.base64ToBlob(this.getCurrentBase64(), this.getMimeType(ExportType.PDF));\r\n // this.downloadFile(blob, this.currentFileName);\r\n }\r\n private downloadBinaryExport(response: any, config: any) {\r\n const blob = this.base64ToBlob(\r\n response,\r\n this.getMimeType(config.exportType)\r\n );\r\n\r\n this.downloadFile(\r\n blob,\r\n `${config.fileName}.${this.getFileExtension(config.exportType)}`\r\n );\r\n }\r\n\r\n // HTML Export Methods\r\n private showHtmlExport(htmlContent: string): void {\r\n const cleanHtml = this.cleanHtmlContent(htmlContent);\r\n this.htmlExportContent = cleanHtml;\r\n this.showHtmlInIframe = true;\r\n\r\n setTimeout(() => {\r\n this.setIframeContent(cleanHtml);\r\n }, 100);\r\n }\r\n\r\n private setIframeContent(htmlContent: string): void {\r\n const iframe = document.getElementById('reportIframe') as HTMLIFrameElement;\r\n if (!iframe) {\r\n console.error('Iframe not found');\r\n return;\r\n }\r\n\r\n const iframeDoc = iframe.contentDocument || iframe.contentWindow?.document;\r\n if (iframeDoc) {\r\n iframeDoc.open();\r\n iframeDoc.write(htmlContent);\r\n iframeDoc.close();\r\n }\r\n }\r\n\r\n print(): void {\r\n // const iframe = document.getElementById('reportIframe') as HTMLIFrameElement | null;\r\n // if (!iframe || !iframe.contentWindow) return;\r\n\r\n // const iframeWindow = iframe.contentWindow;\r\n // iframeWindow.focus();\r\n // iframeWindow.print();\r\n\r\n (document.getElementById('reportIframe') as any).contentWindow.print() ;\r\n }\r\n\r\n\r\n // Utility Methods\r\n getExportButtonText(): string {\r\n switch (this.exportType) {\r\n case ExportType.PRINT:\r\n return this.translate.instant('PRINT');\r\n case ExportType.HTML:\r\n return this.translate.instant('EXPORT');\r\n default:\r\n return this.translate.instant('EXPORT');\r\n }\r\n }\r\n\r\n onExportTypeChange(type: ExportType) {\r\n this.exportType = type;\r\n }\r\n\r\n getCurrentExportTypeIcon(): string {\r\n const currentType = this.exportTypes.find(type => type.value === this.exportType);\r\n return currentType?.icon || 'pi pi-download';\r\n }\r\n\r\n private base64ToBlob(base64: string, mime: string): Blob {\r\n const byteChars = atob(base64);\r\n const byteNums = Array.from(byteChars, c => c.charCodeAt(0));\r\n return new Blob([new Uint8Array(byteNums)], { type: mime });\r\n }\r\n\r\n private downloadFile(blob: Blob, fileName: string) {\r\n const url = window.URL.createObjectURL(blob);\r\n const link = document.createElement('a');\r\n link.href = url;\r\n link.download = fileName;\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n window.URL.revokeObjectURL(url);\r\n }\r\n\r\n private getFileExtension(exportType: ExportType): string {\r\n switch (exportType) {\r\n case ExportType.EXCEL:\r\n return 'xlsx';\r\n case ExportType.PDF:\r\n return 'pdf';\r\n case ExportType.HTML:\r\n return 'html';\r\n default:\r\n return 'pdf';\r\n }\r\n }\r\n\r\n private getMimeType(exportType: ExportType): string {\r\n switch (exportType) {\r\n case ExportType.EXCEL:\r\n return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';\r\n case ExportType.PDF:\r\n return 'application/pdf';\r\n default:\r\n return 'application/octet-stream';\r\n }\r\n }\r\n\r\n private cleanHtmlContent(html: string): string {\r\n return html\r\n .replace(/\\\\r\\\\n/g, '\\n')\r\n .replace(/\\\\\"/g, '\"')\r\n .replace(/\\\\t/g, ' ')\r\n .trim();\r\n }\r\n}\r\n","<!-- class=\"flex flex-col h-full bg-white dark:bg-gray-900 rounded-lg max-w-6xl mx-auto\" -->\n<div >\n <!-- Content -->\n <div class=\"flex-1 overflow-hidden p-2\">\n\n <!-- Preview Actions -->\n <div class=\"flex justify-between items-center mb-6 p-2 bg-white rounded-lg\">\n <h3 class=\"text-lg font-semibold text-gray-900 dark:text-white\">\n {{ 'REPORT' | translate }}\n </h3>\n <div class=\"flex gap-2\">\n <!-- Filters Button -->\n <button\n type=\"button\"\n (click)=\"showFilters = !showFilters\"\n class=\"flex items-center px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors\"\n [pTooltip]=\"'SEARCH_FILTERS' | translate\">\n <i class=\"pi pi-filter\"></i>\n @if (filterCount > 0) {\n <span class=\"ml-2 bg-blue-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center\">\n {{ filterCount }}\n </span>\n }\n </button>\n\n <!-- Refresh Preview -->\n <button\n (click)=\"generatePreview()\"\n [disabled]=\"loading\"\n class=\"flex items-center px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors\"\n [pTooltip]=\"'REFRESH' | translate\">\n <i class=\"pi pi-refresh mr-2 ml-2\" [class.animate-spin]=\"loading\"></i>\n {{ 'REFRESH' | translate }}\n </button>\n\n <!-- Print Button -->\n @if (exportType === 4 || exportType === 1 || exportType === 2) {\n <button\n (click)=\"print()\"\n class=\"flex items-center px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors\"\n [pTooltip]=\"'PRINT' | translate\">\n <i class=\"pi pi-print mr-2 ml-2\"></i>\n {{ 'PRINT' | translate }}\n </button>\n }\n </div>\n </div>\n\n <!-- Preview Content -->\n <div #previewContainer class=\"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg\">\n <!-- HTML Export Preview (Iframe) -->\n @if (showHtmlInIframe && htmlExportContent || showPdfModal) {\n <div class=\"html-export-preview\">\n <iframe\n id=\"reportIframe\"\n class=\"w-full border border-gray-300 dark:border-gray-600 rounded-b-lg\"\n [style.height]=\"'600px'\"\n title=\"HTML Export Preview\"\n [src]=\"currentPdfUrl\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen\n >\n <!-- allowfullscreen -->\n </iframe>\n </div>\n }\n <!-- <app-pdf-modal\n *ngIf=\"showPdfModal\"\n [pdfUrl]=\"currentPdfUrl\"\n [fileName]=\"currentFileName\"\n (closed)=\"onPdfModalClose()\"\n (downloadRequested)=\"onPdfDownload()\">\n </app-pdf-modal> -->\n\n <!-- Regular Preview Table -->\n <!-- <div *ngIf=\"!showHtmlInIframe\" class=\"p-4\">\n <p-table\n [value]=\"previewData\"\n [columns]=\"previewColumns\"\n [paginator]=\"true\"\n [rows]=\"10\"\n [showCurrentPageReport]=\"true\"\n currentPageReportTemplate=\"Showing {first} to {last} of {totalRecords} entries\"\n styleClass=\"p-datatable-sm\">\n <ng-template pTemplate=\"header\">\n <tr>\n <th *ngFor=\"let col of previewColumns\" class=\"text-left\">\n {{ col.header }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData>\n <tr>\n <td *ngFor=\"let col of previewColumns\" class=\"text-left\">\n {{ rowData[col.field] }}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td [attr.colspan]=\"previewColumns.length\" class=\"text-center py-4\">\n <div class=\"text-center py-8\">\n <i class=\"pi pi-inbox text-4xl text-gray-400 dark:text-gray-500 mb-4\"></i>\n <p class=\"text-gray-500 dark:text-gray-400\">{{ 'NO_PREVIEW_DATA' | translate }}</p>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div> -->\n</div>\n\n<!-- <div class=\"mt-4 p-3 bg-green-50 dark:bg-green-900/20 rounded-lg\">\n<p class=\"text-sm text-green-700 dark:text-green-300\">\n <i class=\"pi pi-info-circle mr-2\"></i>\n {{ 'PREVIEW_INFO' | translate }}\n</p>\n</div> -->\n</div>\n\n<!-- Footer -->\n<div class=\"border-t border-gray-200 dark:border-gray-700 px-2 py-2 bg-gray-50 dark:bg-gray-800\">\n <div class=\"flex justify-between items-center\">\n <button\n type=\"button\"\n (click)=\"onReset()\"\n class=\"flex items-center px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors\"\n [disabled]=\"loading\">\n <i class=\"pi pi-refresh mr-2\"></i>\n {{ 'RESET' | translate }}\n </button>\n\n <div class=\"flex gap-2\">\n <button\n type=\"button\"\n (click)=\"ref?.close()\"\n class=\"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors\"\n [disabled]=\"loading\">\n {{ 'CANCEL' | translate }}\n </button>\n\n <!-- SplitButton for Export -->\n <!-- || previewData.length === 0 -->\n <p-splitButton\n [label]=\"getExportButtonText()\"\n [icon]=\"getCurrentExportTypeIcon()\"\n [model]=\"exportMenuItems\"\n (onClick)=\"onExport()\"\n [disabled]=\"loading\"\n styleClass=\"p-button-primary\">\n </p-splitButton>\n </div>\n </div>\n</div>\n\n<!-- Filters Drawer -->\n@if(showFilters){\n <p-drawer\n [(visible)]=\"showFilters\"\n position=\"right\"\n [styleClass]=\"'!w-full md:!w-80 lg:!w-[40rem] !h-full' \"\n [modal]=\"true\"\n [dismissible]=\"true\"\n styleClass=\"p-4 w-full max-w-md max-h-[90vh] flex flex-col\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit(); showFilters=false\" class=\"flex flex-col flex-1\">\n <div class=\"flex-1 overflow-auto\">\n <formly-form\n [form]=\"form\"\n [fields]=\"fields_\"\n [model]=\"model\"\n [options]=\"options\">\n </formly-form>\n </div>\n </form>\n <ng-template pTemplate=\"footer\">\n <div class=\"flex justify-end mt-2 space-x-2 flex-none\">\n <button\n type=\"submit\"\n pButton size=\"small\"\n (click)=\" onSubmit(); showFilters=false\"\n label=\"{{ 'SEARCH' | translate }}\">\n </button>\n <button\n type=\"button\"\n pButton\n size=\"small\"\n class=\"p-button-text\"\n (click)=\"onReset(); showFilters=false\">\n {{ 'CLEAR' | translate }}\n </button>\n </div>\n </ng-template>\n </p-drawer>\n}\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMa,mBAAmB,CAAA;uGAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAFpB,YAAY,CAAA,EAAA,CAAA;AAEX,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAFpB,YAAY,CAAA,EAAA,CAAA;;2FAEX,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;AACxB,iBAAA;;;ACLD;MAqDa,yBAAyB,CAAA;IACpC,QAAQ,GAAW,EAAE;AAErB,IAAA,GAAG,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACpC,IAAA,SAAS,GAAG,MAAM,CAAC,mBAAmB,CAAC;IAEvC,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,IAAI,EAAE;IAClD;IAEA,IAAI,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE;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AAA,OAAA,EAAA,UAAA,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,SAAA,EAAA,OAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,YAAA,EAAA,WAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA,aAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,UAAA,EAAA,oBAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,YAAA,EAAA,YAAA,EAAA,iBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACjB,aAAa,8XAVb,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA;;2FAcJ,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBApBlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAAA,OAAA,EAErB;wBACP,mBAAmB;wBACnB,WAAW;wBACX,aAAa;wBACb,YAAY;wBACZ,YAAY;wBACZ,eAAe;wBACf,iBAAiB;wBACjB,cAAc;wBACd,YAAY;wBACZ,UAAU;wBACV,WAAW;wBACX,iBAAiB;wBACjB;AACH,qBAAA,EAAA,SAAA,EACW,CAAC,aAAa,EAAC,WAAW,CAAC,EAAA,QAAA,EAAA,qvOAAA,EAAA;;sBAGpC,SAAS;uBAAC,kBAAkB;;sBAE5B;;sBAaA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;;AE9EH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"es.framework-ng.ui.core-generic-report.mjs","sources":["../../../../libs/ng.ui.core/generic-report/src/lib/generic-report-module.ts","../../../../libs/ng.ui.core/generic-report/src/lib/report-name-dialog.component.ts","../../../../libs/ng.ui.core/generic-report/src/lib/generic-report.component.ts","../../../../libs/ng.ui.core/generic-report/src/lib/generic-report.component.html","../../../../libs/ng.ui.core/generic-report/src/es.framework-ng.ui.core-generic-report.ts"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n@NgModule({\n imports: [CommonModule],\n})\nexport class GenericReportModule {}\n","// report-name-dialog.component.ts\r\nimport { Component, inject } from '@angular/core';\r\n\r\nimport { FormsModule } from '@angular/forms';\r\nimport { TranslatePipe } from '@es.framework/ng.core/pipes';\r\nimport { DynamicDialogRef, DynamicDialogConfig } from 'primeng/dynamicdialog';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { InputTextModule } from 'primeng/inputtext';\r\nimport { LocalizationService } from '@es.framework/ng.core/services';\r\n\r\n@Component({\r\n selector: 'app-report-name-dialog',\r\n standalone: true,\r\n imports: [\r\n FormsModule,\r\n TranslatePipe,\r\n ButtonModule,\r\n InputTextModule\r\n],\r\n template: `\r\n <div class=\"p-fluid\">\r\n <div class=\"field\">\r\n <label for=\"fileName\" class=\"block text-sm font-medium mb-2\">\r\n {{ 'REPORT_NAME' | translate }}\r\n </label>\r\n <input\r\n id=\"fileName\"\r\n type=\"text\"\r\n [(ngModel)]=\"fileName\"\r\n pInputText\r\n class=\"w-full\"\r\n [placeholder]=\"'ENTER_REPORT_NAME' | translate\"\r\n autofocus>\r\n </div>\r\n </div>\r\n\r\n <div class=\"flex justify-end gap-2 mt-4\">\r\n <button\r\n type=\"button\"\r\n pButton\r\n class=\"p-button-text\"\r\n (click)=\"ref.close()\"\r\n [label]=\"'CANCEL' | translate\">\r\n </button>\r\n <button\r\n type=\"button\"\r\n pButton\r\n (click)=\"save()\"\r\n [label]=\"'SAVE' | translate\">\r\n </button>\r\n </div>\r\n `\r\n})\r\nexport class ReportNameDialogComponent {\r\n fileName: string = '';\r\n\r\n ref = inject(DynamicDialogRef);\r\n config = inject(DynamicDialogConfig);\r\n translate = inject(LocalizationService);\r\n\r\n ngOnInit() {\r\n this.fileName = this.config.data?.fileName || '';\r\n }\r\n\r\n save() {\r\n if (this.fileName?.trim()) {\r\n this.ref.close(this.fileName.trim());\r\n }\r\n }\r\n}\r\n","\r\nimport { Component, inject, OnInit, ViewChild, ElementRef, Input, OnDestroy } from '@angular/core';\r\nimport { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { FormlyFieldConfig, FormlyFormOptions, FormlyForm } from '@ngx-formly/core';\r\nimport { TranslatePipe } from '@es.framework/ng.core/pipes';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { DialogModule } from 'primeng/dialog';\r\nimport { InputTextModule } from 'primeng/inputtext';\r\nimport { RadioButtonModule } from 'primeng/radiobutton';\r\nimport { CheckboxModule } from 'primeng/checkbox';\r\nimport { DynamicDialogRef, DynamicDialogConfig, DialogService } from 'primeng/dynamicdialog';\r\nimport { LocalizationService, RestService } from '@es.framework/ng.core/services';\r\nimport { Subject, takeUntil } from 'rxjs';\r\nimport { DrawerModule } from 'primeng/drawer';\r\nimport { TableModule } from 'primeng/table';\r\nimport { SplitButtonModule } from 'primeng/splitbutton';\r\nimport { MenuItem } from 'primeng/api';\r\nimport { TooltipModule } from 'primeng/tooltip';\r\nimport { ReportNameDialogComponent } from './report-name-dialog.component';\r\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\r\nimport { QueryBuilderService } from '@es.framework/ng.ui.core/generic-search-advanced';\r\n\r\nexport interface ExportConfig {\r\n filters: any;\r\n exportType: ExportType;\r\n fileName?: string;\r\n}\r\n\r\nexport enum ExportType {\r\n LIST,\r\n HTML,\r\n PDF,\r\n EXCEL,\r\n PRINT\r\n}\r\n\r\n@Component({\r\n selector: 'app-generic-report',\r\n templateUrl: './generic-report.component.html',\r\n imports: [\r\n ReactiveFormsModule,\r\n FormsModule,\r\n TranslatePipe,\r\n ButtonModule,\r\n DialogModule,\r\n InputTextModule,\r\n RadioButtonModule,\r\n CheckboxModule,\r\n DrawerModule,\r\n FormlyForm,\r\n TableModule,\r\n SplitButtonModule,\r\n TooltipModule\r\n],\r\n providers:[DialogService,RestService]\r\n})\r\nexport class GenericReportComponent implements OnInit, OnDestroy {\r\n @ViewChild('previewContainer') previewContainer!: ElementRef;\r\n\r\n @Input() filterFields: FormlyFieldConfig[] = [];\r\n fields_: FormlyFieldConfig[] = [];\r\n exportType: ExportType = ExportType.PDF;\r\n fileName: string = '';\r\n showFilters: boolean = false;\r\n loading: boolean = false;\r\n currentDate: Date = new Date();\r\n previewData: any[] = [];\r\n htmlExportContent: string = '';\r\n showHtmlInIframe: boolean = false;\r\n previewColumns: any[] = [];\r\n\r\n options: FormlyFormOptions = {};\r\n @Input() enableQueryBuilder: boolean = true;\r\n @Input() localExport: boolean = false;\r\n @Input() queryString: string = '';\r\n @Input() apiName: string = '';\r\n @Input() moduleName: string = '';\r\n\r\n @Input() model: any = {};\r\n form = new FormGroup({});\r\n exportConfig!: ExportConfig;\r\n\r\n exportTypes = [\r\n { value: ExportType.EXCEL, label: 'EXCEL', icon: 'pi pi-file-excel' },\r\n { value: ExportType.PDF, label: 'PDF', icon: 'pi pi-file-pdf' },\r\n { value: ExportType.HTML, label: 'HTML', icon: 'pi pi-code' },\r\n { value: ExportType.PRINT, label: 'PRINT', icon: 'pi pi-print' }\r\n ];\r\n\r\n exportMenuItems: MenuItem[] = [];\r\n\r\n private destroy$ = new Subject<void>();\r\n private dialogService:DialogService = inject(DialogService);\r\n private translate = inject(LocalizationService);\r\n private restService: RestService = inject(RestService);\r\n private queryBuilder = inject(QueryBuilderService);\r\nprivate sanitizer: DomSanitizer = inject(DomSanitizer);\r\n constructor(\r\n public ref: DynamicDialogRef,\r\n public config: DynamicDialogConfig\r\n ) {}\r\n\r\n ngOnDestroy() {\r\n this.destroy$.next();\r\n this.destroy$.complete();\r\n\r\n if (this.ref) {\r\n try {\r\n this.ref.close();\r\n } catch (e) {\r\n // Ignore errors during cleanup\r\n }\r\n }\r\n }\r\n\r\n ngOnInit() {\r\n this.filterFields = this.config.data?.filterFields || [];\r\n this.buildQueryUIFields();\r\n this.initializeComponent();\r\n this.initializeExportConfig();\r\n this.initializeExportMenu();\r\n }\r\n get filterCount() {\r\n\r\n return this.queryBuilder.getAppliedFiltersCount(this.model).total;\r\n }\r\n private buildQueryUIFields() {\r\n if (this.enableQueryBuilder) {\r\n this.fields_ = this.queryBuilder.buildQueryUIFields(this.filterFields,true,true);\r\n } else {\r\n this.fields_ = this.filterFields;\r\n }\r\n }\r\n\r\n private initializeComponent() {\n this.apiName = this.config.data?.apiName || '';\n this.moduleName = this.config.data?.moduleName || '';\n this.queryString = this.config.data?.queryString || '';\n this.initializeFilterFields();\n this.onExport();\n }\n\r\n private initializeFilterFields() {\r\n this.filterFields = this.config.data?.filterFields || this.getDefaultFilterFields();\r\n this.model = this.config.data?.model || {};\r\n this.fileName = this.config.data?.defaultFileName || `export_${new Date().toISOString().split('T')[0]}`;\r\n }\r\n\r\n private initializeExportConfig() {\r\n this.exportConfig = {\r\n filters: this.model,\r\n exportType: this.exportType,\r\n fileName: this.fileName\r\n };\r\n }\r\n\r\n private initializeExportMenu() {\r\n this.exportMenuItems = [\r\n // Edit Report Name menu item\r\n {\r\n label: this.translate.instant('EDIT_REPORT_NAME'),\r\n icon: 'pi pi-pencil',\r\n command: () => this.openReportNameDialog()\r\n },\r\n // Separator\r\n { separator: true },\r\n // Export type menu items\r\n ...this.exportTypes.map(type => ({\r\n label: this.translate.instant(type.label),\r\n icon: type.icon,\r\n command: () => this.onExportTypeChange(type.value)\r\n }))\r\n ];\r\n}\r\n\r\nprivate openReportNameDialog() {\r\n const ref = this.dialogService.open(ReportNameDialogComponent, {\r\n header: this.translate.instant('EDIT_REPORT_NAME'),\r\n width: '500px',\r\n data: {\r\n fileName: this.fileName\r\n }\r\n });\r\n\r\n ref?.onClose.subscribe((result: string) => {\r\n if (result) {\r\n this.fileName = result;\r\n }\r\n });\r\n}\r\n\r\n private getDefaultFilterFields(): FormlyFieldConfig[] {\r\n return [\r\n {\r\n key: 'search',\r\n type: 'input',\r\n props: {\r\n label: this.translate.instant('SEARCH'),\r\n placeholder: this.translate.instant('ENTER_SEARCH_TERM'),\r\n }\r\n }\r\n ];\r\n }\r\n\r\n // Query and Preview Methods\r\n generatePreview() {\r\n this.onExport();\r\n }\r\n\r\n onSubmit() {\r\n const odataParams = this.queryBuilder.buildODataFromQueryModel(this.model, this.filterFields);\r\n this.queryString = this.queryBuilder.toODataQueryString(odataParams);\r\n this.onExport();\r\n }\r\n\r\n onReset() {\n this.exportType = ExportType.PDF;\n this.fileName = `export_${new Date().toISOString().split('T')[0]}`;\n this.queryString = '';\n this.form.reset();\n this.model = {};\n this.generatePreview();\n }\r\n\r\n // Export Methods\r\n onExport() {\r\n this.loading = true;\r\n const exportConfig = this.createExportConfig();\r\n this.handleApiExport(exportConfig);\r\n }\r\n\r\n private createExportConfig(): any {\r\n return {\r\n filters: this.model,\r\n exportType: this.exportType,\r\n fileName: this.fileName\r\n };\r\n }\r\n\r\n private handleApiExport(config: any) {\r\n if (this.form.invalid) return;\r\n\r\n const requestOptions = this.createRequestOptions(config);\r\n\r\n this.restService.request<any, any>(\r\n requestOptions,\r\n { apiName: this.apiName , moduleName: this.moduleName }\r\n )\r\n .pipe(takeUntil(this.destroy$))\r\n .subscribe({\r\n next: (response) => {\r\n this.handleExportResponse(response, config);\r\n },\r\n error: (error) => {\r\n console.error('Export failed:', error);\r\n this.loading = false;\r\n }\r\n });\r\n }\r\n\r\n private createRequestOptions(config: any): any {\r\n // Default query\r\n if(!this.queryString || this.queryString == ''){\r\n\r\n // Use the new QueryBuilderService methods\r\n const odataParams = this.queryBuilder.buildODataFromQueryModel(this.model, this.filterFields);\r\n // this.odataSearch.emit(odataParams);\r\n\r\n // Generate query string using the unified method\r\n this.queryString = this.queryBuilder.toODataQueryString(odataParams);\r\n // console.log('OData Query String:', queryString);\r\n\r\n }\r\n const filters: Partial<any> = {\n fileName: config.fileName || '',\n query: this.queryString,\n exportType: this.getApiExportType(config.exportType),\n };\n\r\n\r\n\r\n const params = Object.keys(filters).reduce((acc: any, key) => {\r\n acc[key] = filters[key];\r\n return acc;\r\n }, {});\r\n\r\n const requestOptions: any = {\r\n method: 'GET',\r\n url: `/${this.apiName}/export`,\r\n params: params\r\n };\r\n\r\n if (config.exportType === ExportType.HTML) {\r\n requestOptions.responseType = 'text';\r\n }\r\n\r\n return requestOptions;\r\n }\r\n\r\n // private handleExportResponse(response: any, config: any) {\r\n // this.loading = false;\r\n\r\n // if (config.exportType === ExportType.HTML) {\r\n // this.showHtmlExport(response);\r\n // } else {\r\n // this.downloadBinaryExport(response, config);\r\n // }\r\n // }\r\n private handleExportResponse(response: any, config: any) {\r\n this.loading = false;\r\n\r\n if (config.exportType === ExportType.HTML) {\r\n this.showHtmlExport(response);\r\n // } else if (config.exportType === ExportType.PDF && this.isMobileDevice()) {\r\n } else if (config.exportType === ExportType.PDF) {\r\n this.showPdfInMobile(response, config);\r\n } else {\r\n this.downloadBinaryExport(response, config);\r\n }\r\n }\r\n // Platform detection methods\r\nprivate isMobileDevice(): boolean {\r\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\r\n}\r\n\r\nprivate isIOS(): boolean {\r\n return /iPad|iPhone|iPod/.test(navigator.userAgent);\r\n}\r\n\r\nprivate isAndroid(): boolean {\r\n return /Android/.test(navigator.userAgent);\r\n}\r\n showPdfModal = false;\r\n currentPdfUrl?:SafeResourceUrl;\r\n currentFileName = '';\r\n private showPdfInMobile(base64Data: string, config: any): void {\r\n\r\n\r\n try {\r\n const blob = this.base64ToBlob(base64Data, this.getMimeType(ExportType.PDF));\r\n this.currentPdfUrl = this.sanitizeUrl(URL.createObjectURL(blob));\r\n this.currentFileName = `${config.fileName}.pdf`;\r\n this.showPdfModal = true;\r\n } catch (error) {\r\n var error = 'PDF is too large for mobile viewing. Please download instead.';\r\n } finally {\r\n // this.loading = false;\r\n }\r\n }\r\n\r\n\r\n private sanitizeUrl(url: string): SafeResourceUrl {\r\n return this.sanitizer.bypassSecurityTrustResourceUrl(url);\r\n }\r\n\r\n // onPdfModalClose(): void {\r\n // this.showPdfModal = false;\r\n // if (this.currentPdfUrl) {\r\n // URL.revokeObjectURL(this.currentPdfUrl);\r\n // this.currentPdfUrl = '';\r\n // }\r\n // }\r\n\r\n onPdfDownload(): void {\r\n // Trigger download\r\n // const blob = this.base64ToBlob(this.getCurrentBase64(), this.getMimeType(ExportType.PDF));\r\n // this.downloadFile(blob, this.currentFileName);\r\n }\r\n private downloadBinaryExport(response: any, config: any) {\r\n const blob = this.base64ToBlob(\r\n response,\r\n this.getMimeType(config.exportType)\r\n );\r\n\r\n this.downloadFile(\r\n blob,\r\n `${config.fileName}.${this.getFileExtension(config.exportType)}`\r\n );\r\n }\r\n\r\n // HTML Export Methods\r\n private showHtmlExport(htmlContent: string): void {\r\n const cleanHtml = this.cleanHtmlContent(htmlContent);\r\n this.htmlExportContent = cleanHtml;\r\n this.showHtmlInIframe = true;\r\n\r\n setTimeout(() => {\r\n this.setIframeContent(cleanHtml);\r\n }, 100);\r\n }\r\n\r\n private setIframeContent(htmlContent: string): void {\r\n const iframe = document.getElementById('reportIframe') as HTMLIFrameElement;\r\n if (!iframe) {\r\n console.error('Iframe not found');\r\n return;\r\n }\r\n\r\n const iframeDoc = iframe.contentDocument || iframe.contentWindow?.document;\r\n if (iframeDoc) {\r\n iframeDoc.open();\r\n iframeDoc.write(htmlContent);\r\n iframeDoc.close();\r\n }\r\n }\r\n\r\n print(): void {\r\n // const iframe = document.getElementById('reportIframe') as HTMLIFrameElement | null;\r\n // if (!iframe || !iframe.contentWindow) return;\r\n\r\n // const iframeWindow = iframe.contentWindow;\r\n // iframeWindow.focus();\r\n // iframeWindow.print();\r\n\r\n (document.getElementById('reportIframe') as any).contentWindow.print() ;\r\n }\r\n\r\n\r\n // Utility Methods\r\n getExportButtonText(): string {\r\n switch (this.exportType) {\r\n case ExportType.PRINT:\r\n return this.translate.instant('PRINT');\r\n case ExportType.HTML:\r\n return this.translate.instant('EXPORT');\r\n default:\r\n return this.translate.instant('EXPORT');\r\n }\r\n }\r\n\r\n onExportTypeChange(type: ExportType) {\r\n this.exportType = type;\r\n }\r\n\r\n getCurrentExportTypeIcon(): string {\r\n const currentType = this.exportTypes.find(type => type.value === this.exportType);\r\n return currentType?.icon || 'pi pi-download';\r\n }\r\n\r\n private base64ToBlob(base64: string, mime: string): Blob {\r\n const byteChars = atob(base64);\r\n const byteNums = Array.from(byteChars, c => c.charCodeAt(0));\r\n return new Blob([new Uint8Array(byteNums)], { type: mime });\r\n }\r\n\r\n private downloadFile(blob: Blob, fileName: string) {\r\n const url = window.URL.createObjectURL(blob);\r\n const link = document.createElement('a');\r\n link.href = url;\r\n link.download = fileName;\r\n document.body.appendChild(link);\r\n link.click();\r\n document.body.removeChild(link);\r\n window.URL.revokeObjectURL(url);\r\n }\r\n\r\n private getFileExtension(exportType: ExportType): string {\r\n switch (exportType) {\r\n case ExportType.EXCEL:\r\n return 'xlsx';\r\n case ExportType.PDF:\r\n return 'pdf';\r\n case ExportType.HTML:\r\n return 'html';\r\n default:\r\n return 'pdf';\r\n }\r\n }\r\n\r\n private getMimeType(exportType: ExportType): string {\n switch (exportType) {\n case ExportType.EXCEL:\n return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';\n case ExportType.PDF:\n return 'application/pdf';\n default:\n return 'application/octet-stream';\n }\n }\n\n private getApiExportType(exportType: ExportType): string {\n switch (exportType) {\n case ExportType.EXCEL:\n return 'Excel';\n case ExportType.PDF:\n return 'Pdf';\n case ExportType.LIST:\n return 'List';\n case ExportType.HTML:\n return 'Html';\n case ExportType.PRINT:\n return 'Print';\n default:\n return String(exportType);\n }\n }\n\n private cleanHtmlContent(html: string): string {\n return html\n .replace(/\\\\r\\\\n/g, '\\n')\r\n .replace(/\\\\\"/g, '\"')\r\n .replace(/\\\\t/g, ' ')\r\n .trim();\r\n }\r\n}\r\n","<!-- class=\"flex flex-col h-full bg-white dark:bg-gray-900 rounded-lg max-w-6xl mx-auto\" -->\n<div >\n <!-- Content -->\n <div class=\"flex-1 overflow-hidden p-2\">\n\n <!-- Preview Actions -->\n <div class=\"flex justify-between items-center mb-6 p-2 bg-white rounded-lg\">\n <h3 class=\"text-lg font-semibold text-gray-900 dark:text-white\">\n {{ 'REPORT' | translate }}\n </h3>\n <div class=\"flex gap-2\">\n <!-- Filters Button -->\n <button\n type=\"button\"\n (click)=\"showFilters = !showFilters\"\n class=\"flex items-center px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors\"\n [pTooltip]=\"'SEARCH_FILTERS' | translate\">\n <i class=\"pi pi-filter\"></i>\n @if (filterCount > 0) {\n <span class=\"ml-2 bg-blue-500 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center\">\n {{ filterCount }}\n </span>\n }\n </button>\n\n <!-- Refresh Preview -->\n <button\n (click)=\"generatePreview()\"\n [disabled]=\"loading\"\n class=\"flex items-center px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed transition-colors\"\n [pTooltip]=\"'REFRESH' | translate\">\n <i class=\"pi pi-refresh mr-2 ml-2\" [class.animate-spin]=\"loading\"></i>\n {{ 'REFRESH' | translate }}\n </button>\n\n <!-- Print Button -->\n @if (exportType === 4 || exportType === 1 || exportType === 2) {\n <button\n (click)=\"print()\"\n class=\"flex items-center px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors\"\n [pTooltip]=\"'PRINT' | translate\">\n <i class=\"pi pi-print mr-2 ml-2\"></i>\n {{ 'PRINT' | translate }}\n </button>\n }\n </div>\n </div>\n\n <!-- Preview Content -->\n <div #previewContainer class=\"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg\">\n <!-- HTML Export Preview (Iframe) -->\n @if (showHtmlInIframe && htmlExportContent || showPdfModal) {\n <div class=\"html-export-preview\">\n <iframe\n id=\"reportIframe\"\n class=\"w-full border border-gray-300 dark:border-gray-600 rounded-b-lg\"\n [style.height]=\"'600px'\"\n title=\"HTML Export Preview\"\n [src]=\"currentPdfUrl\"\n width=\"100%\"\n height=\"100%\"\n frameborder=\"0\"\n allowfullscreen\n >\n <!-- allowfullscreen -->\n </iframe>\n </div>\n }\n <!-- <app-pdf-modal\n *ngIf=\"showPdfModal\"\n [pdfUrl]=\"currentPdfUrl\"\n [fileName]=\"currentFileName\"\n (closed)=\"onPdfModalClose()\"\n (downloadRequested)=\"onPdfDownload()\">\n </app-pdf-modal> -->\n\n <!-- Regular Preview Table -->\n <!-- <div *ngIf=\"!showHtmlInIframe\" class=\"p-4\">\n <p-table\n [value]=\"previewData\"\n [columns]=\"previewColumns\"\n [paginator]=\"true\"\n [rows]=\"10\"\n [showCurrentPageReport]=\"true\"\n currentPageReportTemplate=\"Showing {first} to {last} of {totalRecords} entries\"\n styleClass=\"p-datatable-sm\">\n <ng-template pTemplate=\"header\">\n <tr>\n <th *ngFor=\"let col of previewColumns\" class=\"text-left\">\n {{ col.header }}\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-rowData>\n <tr>\n <td *ngFor=\"let col of previewColumns\" class=\"text-left\">\n {{ rowData[col.field] }}\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"emptymessage\">\n <tr>\n <td [attr.colspan]=\"previewColumns.length\" class=\"text-center py-4\">\n <div class=\"text-center py-8\">\n <i class=\"pi pi-inbox text-4xl text-gray-400 dark:text-gray-500 mb-4\"></i>\n <p class=\"text-gray-500 dark:text-gray-400\">{{ 'NO_PREVIEW_DATA' | translate }}</p>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div> -->\n</div>\n\n<!-- <div class=\"mt-4 p-3 bg-green-50 dark:bg-green-900/20 rounded-lg\">\n<p class=\"text-sm text-green-700 dark:text-green-300\">\n <i class=\"pi pi-info-circle mr-2\"></i>\n {{ 'PREVIEW_INFO' | translate }}\n</p>\n</div> -->\n</div>\n\n<!-- Footer -->\n<div class=\"border-t border-gray-200 dark:border-gray-700 px-2 py-2 bg-gray-50 dark:bg-gray-800\">\n <div class=\"flex justify-between items-center\">\n <button\n type=\"button\"\n (click)=\"onReset()\"\n class=\"flex items-center px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors\"\n [disabled]=\"loading\">\n <i class=\"pi pi-refresh mr-2\"></i>\n {{ 'RESET' | translate }}\n </button>\n\n <div class=\"flex gap-2\">\n <button\n type=\"button\"\n (click)=\"ref?.close()\"\n class=\"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors\"\n [disabled]=\"loading\">\n {{ 'CANCEL' | translate }}\n </button>\n\n <!-- SplitButton for Export -->\n <!-- || previewData.length === 0 -->\n <p-splitButton\n [label]=\"getExportButtonText()\"\n [icon]=\"getCurrentExportTypeIcon()\"\n [model]=\"exportMenuItems\"\n (onClick)=\"onExport()\"\n [disabled]=\"loading\"\n styleClass=\"p-button-primary\">\n </p-splitButton>\n </div>\n </div>\n</div>\n\n<!-- Filters Drawer -->\n@if(showFilters){\n <p-drawer\n [(visible)]=\"showFilters\"\n position=\"right\"\n [styleClass]=\"'!w-full md:!w-80 lg:!w-[40rem] !h-full' \"\n [modal]=\"true\"\n [dismissible]=\"true\"\n styleClass=\"p-4 w-full max-w-md max-h-[90vh] flex flex-col\">\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit(); showFilters=false\" class=\"flex flex-col flex-1\">\n <div class=\"flex-1 overflow-auto\">\n <formly-form\n [form]=\"form\"\n [fields]=\"fields_\"\n [model]=\"model\"\n [options]=\"options\">\n </formly-form>\n </div>\n </form>\n <ng-template pTemplate=\"footer\">\n <div class=\"flex justify-end mt-2 space-x-2 flex-none\">\n <button\n type=\"submit\"\n pButton size=\"small\"\n (click)=\" onSubmit(); showFilters=false\"\n label=\"{{ 'SEARCH' | translate }}\">\n </button>\n <button\n type=\"button\"\n pButton\n size=\"small\"\n class=\"p-button-text\"\n (click)=\"onReset(); showFilters=false\">\n {{ 'CLEAR' | translate }}\n </button>\n </div>\n </ng-template>\n </p-drawer>\n}\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAMa,mBAAmB,CAAA;uGAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAFpB,YAAY,CAAA,EAAA,CAAA;AAEX,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAFpB,YAAY,CAAA,EAAA,CAAA;;2FAEX,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;AACxB,iBAAA;;;ACLD;MAqDa,yBAAyB,CAAA;IACpC,QAAQ,GAAW,EAAE;AAErB,IAAA,GAAG,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC;AACpC,IAAA,SAAS,GAAG,MAAM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,IAAA,EAAA,UAAA,EAAA,IAAA,EACjB,aAAa,8XAVb,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA;;2FAcJ,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBApBlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAAA,OAAA,EAErB;wBACP,mBAAmB;wBACnB,WAAW;wBACX,aAAa;wBACb,YAAY;wBACZ,YAAY;wBACZ,eAAe;wBACf,iBAAiB;wBACjB,cAAc;wBACd,YAAY;wBACZ,UAAU;wBACV,WAAW;wBACX,iBAAiB;wBACjB;AACH,qBAAA,EAAA,SAAA,EACW,CAAC,aAAa,EAAC,WAAW,CAAC,EAAA,QAAA,EAAA,qvOAAA,EAAA;;sBAGpC,SAAS;uBAAC,kBAAkB;;sBAE5B;;sBAaA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;;AE9EH;;AAEG;;;;"}
|
|
@@ -1239,16 +1239,25 @@ class QueryBuilderComponent extends FieldType {
|
|
|
1239
1239
|
{ label: this.translate.instant('and'), value: 'and' },
|
|
1240
1240
|
{ label: this.translate.instant('or'), value: 'or' }
|
|
1241
1241
|
];
|
|
1242
|
-
|
|
1242
|
+
get showDefaultConditions() {
|
|
1243
|
+
return this.props['showDefaultConditions'] !== false;
|
|
1244
|
+
}
|
|
1243
1245
|
ngOnInit() {
|
|
1244
1246
|
// Initialize with existing value or default group with conditions
|
|
1245
|
-
if (this.formControl.value &&
|
|
1247
|
+
if (this.formControl.value && Array.isArray(this.formControl.value) && this.formControl.value.length > 0) {
|
|
1246
1248
|
this.initializeAppliedConditionsWithFieldConfigs();
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
if (this.showDefaultConditions) {
|
|
1247
1252
|
this.initializeDefaultConditions();
|
|
1248
1253
|
}
|
|
1249
1254
|
else {
|
|
1250
|
-
|
|
1251
|
-
|
|
1255
|
+
this.groups = [{
|
|
1256
|
+
logicalOperator: 'and',
|
|
1257
|
+
groupLogicalOperator: 'and',
|
|
1258
|
+
conditions: []
|
|
1259
|
+
}];
|
|
1260
|
+
this.formControl.setValue([], { emitEvent: false });
|
|
1252
1261
|
}
|
|
1253
1262
|
}
|
|
1254
1263
|
initializeAppliedConditionsWithFieldConfigs() {
|
|
@@ -1287,16 +1296,7 @@ class QueryBuilderComponent extends FieldType {
|
|
|
1287
1296
|
c.operator === dc.operator)))
|
|
1288
1297
|
}];
|
|
1289
1298
|
this.updateValue();
|
|
1290
|
-
|
|
1291
|
-
toggleAppliedFilters() {
|
|
1292
|
-
if (this.showAppliedFilters == true) {
|
|
1293
|
-
this.initializeAppliedConditionsWithFieldConfigs();
|
|
1294
|
-
this.initializeDefaultConditions();
|
|
1295
|
-
}
|
|
1296
|
-
else {
|
|
1297
|
-
this.initializeAppliedConditionsWithFieldConfigs();
|
|
1298
|
-
}
|
|
1299
|
-
this.showAppliedFilters = !this.showAppliedFilters;
|
|
1299
|
+
// debugger
|
|
1300
1300
|
}
|
|
1301
1301
|
onAndClick(group, event) {
|
|
1302
1302
|
group.logicalOperator = 'and';
|
|
@@ -1454,22 +1454,18 @@ class QueryBuilderComponent extends FieldType {
|
|
|
1454
1454
|
// this.updateValue();
|
|
1455
1455
|
// }
|
|
1456
1456
|
removeGroup(groupIndex) {
|
|
1457
|
-
if (this.groups[groupIndex]) {
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
}
|
|
1467
|
-
// Remove the group
|
|
1468
|
-
this.groups.splice(groupIndex, 1);
|
|
1469
|
-
// Remove all associated fields from model
|
|
1470
|
-
this.removeMultipleFromModel(fieldKeysToRemove);
|
|
1471
|
-
this.updateValue();
|
|
1457
|
+
if (!this.groups[groupIndex]) {
|
|
1458
|
+
return;
|
|
1459
|
+
}
|
|
1460
|
+
this.groups.splice(groupIndex, 1);
|
|
1461
|
+
if (this.groups.length === 0) {
|
|
1462
|
+
this.groups.push({
|
|
1463
|
+
logicalOperator: 'and',
|
|
1464
|
+
groupLogicalOperator: 'and',
|
|
1465
|
+
conditions: []
|
|
1466
|
+
});
|
|
1472
1467
|
}
|
|
1468
|
+
this.normalizeAfterStructureChange();
|
|
1473
1469
|
}
|
|
1474
1470
|
// Remove multiple fields from formly model
|
|
1475
1471
|
removeMultipleFromModel(fieldKeys) {
|
|
@@ -1512,23 +1508,15 @@ class QueryBuilderComponent extends FieldType {
|
|
|
1512
1508
|
}
|
|
1513
1509
|
}
|
|
1514
1510
|
removeCondition(groupIndex, conditionIndex) {
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
// Using delete operator (sets to undefined, then we filter)
|
|
1519
|
-
delete this.groups[groupIndex].conditions[conditionIndex];
|
|
1520
|
-
// Remove the undefined entries from conditions array
|
|
1521
|
-
this.groups[groupIndex].conditions = this.groups[groupIndex].conditions.filter((condition) => condition !== undefined);
|
|
1522
|
-
// Remove empty groups
|
|
1523
|
-
if (this.groups[groupIndex].conditions.length === 0 && this.groups.length > 1) {
|
|
1524
|
-
delete this.groups[groupIndex];
|
|
1525
|
-
// Remove undefined groups from array
|
|
1526
|
-
this.groups = this.groups.filter(group => group !== undefined);
|
|
1527
|
-
}
|
|
1528
|
-
// Remove from formly model
|
|
1529
|
-
this.removeFromModel(fieldKey);
|
|
1530
|
-
this.updateValue();
|
|
1511
|
+
const group = this.groups[groupIndex];
|
|
1512
|
+
if (!group) {
|
|
1513
|
+
return;
|
|
1531
1514
|
}
|
|
1515
|
+
group.conditions.splice(conditionIndex, 1);
|
|
1516
|
+
if (group.conditions.length === 0 && this.groups.length > 1) {
|
|
1517
|
+
this.groups.splice(groupIndex, 1);
|
|
1518
|
+
}
|
|
1519
|
+
this.normalizeAfterStructureChange();
|
|
1532
1520
|
}
|
|
1533
1521
|
// Remove the field from formly model
|
|
1534
1522
|
removeFromModel(fieldKey) {
|
|
@@ -1582,14 +1570,16 @@ class QueryBuilderComponent extends FieldType {
|
|
|
1582
1570
|
this.cdr.detectChanges();
|
|
1583
1571
|
}
|
|
1584
1572
|
clearAll() {
|
|
1585
|
-
this.groups = [
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
});
|
|
1592
|
-
this.
|
|
1573
|
+
this.groups = [{
|
|
1574
|
+
logicalOperator: 'and',
|
|
1575
|
+
groupLogicalOperator: 'and',
|
|
1576
|
+
conditions: []
|
|
1577
|
+
}];
|
|
1578
|
+
this.clearConditionValueKeysFromModel();
|
|
1579
|
+
this.formControl.setValue([], { emitEvent: false });
|
|
1580
|
+
this.formControl.markAsPristine();
|
|
1581
|
+
this.formControl.markAsUntouched();
|
|
1582
|
+
this.cdr.detectChanges();
|
|
1593
1583
|
}
|
|
1594
1584
|
// Helper methods
|
|
1595
1585
|
getQueryStructure() {
|
|
@@ -1605,6 +1595,39 @@ class QueryBuilderComponent extends FieldType {
|
|
|
1605
1595
|
this.updateValue();
|
|
1606
1596
|
}
|
|
1607
1597
|
}
|
|
1598
|
+
// Helpers
|
|
1599
|
+
isConditionValueKey(key) {
|
|
1600
|
+
return /^condition_\d+_\d+_value$/.test(key);
|
|
1601
|
+
}
|
|
1602
|
+
clearConditionValueKeysFromModel() {
|
|
1603
|
+
if (!this.model) {
|
|
1604
|
+
return;
|
|
1605
|
+
}
|
|
1606
|
+
Object.keys(this.model)
|
|
1607
|
+
.filter(key => this.isConditionValueKey(key))
|
|
1608
|
+
.forEach(key => delete this.model[key]);
|
|
1609
|
+
}
|
|
1610
|
+
rebuildConditionFieldConfigs() {
|
|
1611
|
+
for (let g = 0; g < this.groups.length; g++) {
|
|
1612
|
+
const group = this.groups[g];
|
|
1613
|
+
for (let c = 0; c < group.conditions.length; c++) {
|
|
1614
|
+
const condition = group.conditions[c];
|
|
1615
|
+
condition.operatorsForField = this.getOperatorsForField(condition.field);
|
|
1616
|
+
condition.valueFieldConfig = condition.field
|
|
1617
|
+
? this.generateValueFieldConfig(condition, g, c)
|
|
1618
|
+
: null;
|
|
1619
|
+
const fieldKey = this.getConditionValueKey(g, c);
|
|
1620
|
+
if (this.model) {
|
|
1621
|
+
this.model[fieldKey] = condition.value;
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
normalizeAfterStructureChange() {
|
|
1627
|
+
this.clearConditionValueKeysFromModel();
|
|
1628
|
+
this.rebuildConditionFieldConfigs();
|
|
1629
|
+
this.updateValue();
|
|
1630
|
+
}
|
|
1608
1631
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: QueryBuilderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1609
1632
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: QueryBuilderComponent, isStandalone: true, selector: "formly-query-builder", usesInheritance: true, ngImport: i0, template: "<div>\n\n <!-- Groups Container with Connecting Lines -->\n <div class=\"groups-container\" #groupsContainer>\n @for (group of groups; track group; let groupIndex = $index) {\n <div\n class=\"group-wrapper relative\"\n #groupElement>\n <!-- Vertical Connector Line from Previous Group -->\n @if (groupIndex > 0) {\n <div class=\"vertical-connector\">\n <div class=\"vertical-line\"></div>\n <!-- Operator Button -->\n <button\n type=\"button\"\n class=\"group-logical-operator-box\"\n [class.and]=\"group.groupLogicalOperator === 'and'\"\n [class.or]=\"group.groupLogicalOperator === 'or'\"\n (click)=\"opPopover.toggle($event)\">\n <span class=\"operator-text\">\n {{ getLogicalOperatorText(group.groupLogicalOperator || 'and') }}\n </span>\n <div class=\"connector-arrow\"></div>\n </button>\n <!-- Popover -->\n <p-popover #opPopover appendTo=\"body\">\n <div class=\"w-12rem\">\n <p-listbox\n [options]=\"logicalOperators\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [(ngModel)]=\"group.groupLogicalOperator\"\n (onChange)=\" opPopover.toggle($event)\"\n [style]=\"{ width: '100%' }\">\n </p-listbox>\n </div>\n </p-popover>\n </div>\n }\n <div class=\"group-container mb-6 p-1 bg-white rounded-lg border-l-4 border-t-1 border-b-1 border-r-1 shadow-sm transition-all duration-300 relative\"\n [class.border-blue-500]=\"group.logicalOperator === 'and'\"\n [class.border-or-500]=\"group.logicalOperator === 'or'\"\n [class.pulse]=\"groupIndex === 0\">\n <!-- Rounded Button for \"\u0631\u0628\u0637 \u0627\u0644\u0634\u0631\u0648\u0637\" on left border -->\n <div\n class=\"absolute -left-4 top-1/2 transform -translate-y-1/2 z-10 transition-all duration-300\"\n >\n <!-- Logical Operator Popover Button -->\n <p-button\n [severity]=\"group.logicalOperator === 'and' ? 'success' : 'info'\"\n [styleClass]=\"group.logicalOperator === 'and'\r\n ? 'p-button-icon-only p-button-rounded p-button-sm logical-and'\r\n : 'p-button-icon-only p-button-rounded p-button-sm logical-or'\"\r\n (click)=\"opPopover.toggle($event)\">\n {{group.logicalOperator === 'and' ? ('and' | translate) : ('or' | translate)}}\n </p-button>\n <!-- Popover for Operator Selection -->\n <p-popover #opPopover appendTo=\"body\">\n <div class=\"w-10rem\">\n <p-listbox\n [options]=\"[\r\n { label: 'and' | translate, value: 'and' },\r\n { label: 'or' | translate, value: 'or' }\r\n ]\"\r\n optionLabel=\"label\"\n optionValue=\"value\"\n [(ngModel)]=\"group.logicalOperator\"\n (onChange)=\"updateValue(); opPopover.toggle($event)\"\n [style]=\"{ width: '100%' }\">\n <ng-template let-item pTemplate=\"item\">\n {{ item.label }}\n </ng-template>\n </p-listbox>\n </div>\n </p-popover>\n </div>\n <!-- Group Header -->\n <div class=\"group-header-wrapper mb-4 pl-8\">\n <div class=\"group-header flex justify-between items-center\">\n <div class=\"flex gap-1\">\n <button\n pButton\n icon=\"pi pi-plus\"\n type=\"button\"\n class=\"p-button-success p-button p-button-sm !p-1.5 rounded-md transition-colors\"\n (click)=\"addCondition(groupIndex)\"\n pTooltip=\"{{ 'ADD_CONDITION' | translate }}\"\n tooltipPosition=\"top\">\n </button>\n <!-- @if (filterCount > 0) {\n <button\n pButton\n type=\"button\"\n icon=\"pi pi-filter\"\n class=\"p-button-outlined p-button-sm\"\n (click)=\"toggleAppliedFilters()\">\n {{ (showAppliedFilters ? 'SHOW_ALL' : 'SHOW_APPLIED') | translate }}\n </button>\n } -->\n @if (groups.length > 1) {\n <button\n pButton\n icon=\"pi pi-times\"\n type=\"button\"\n class=\"p-button-danger p-button p-button-sm !p-1.5 rounded-md transition-colors\"\n (click)=\"removeGroup(groupIndex)\"\n pTooltip=\"{{ 'DELETE_GROUP' | translate }}\"\n tooltipPosition=\"top\">\n </button>\n }\n </div>\n </div>\n </div>\n <!-- Conditions in this group -->\n @for (condition of group.conditions; track condition; let conditionIndex = $index) {\n <div\n class=\"p-1 bg-gray-50 \">\n <div class=\"grid grid-cols-1 gap-1 items-center\">\n <!-- Field Selector -->\n <div class=\"md:col-span-2\">\n <div class=\"flex w-full rounded-md overflow-hidden border border-gray-300 bg-white shadow-sm\">\n <!-- Field Selector Button -->\n <div style=\"align-items: center;display: flex; min-width: 130px;max-width: 130px;\" class=\"flex-shrink-0 \">\n <button\n type=\"button\"\n style=\"height: -webkit-fill-available;\"\n class=\"flex items-center justify-between w-full px-3 py-2 text-sm bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:z-10\"\n (click)=\"overlay.toggle($event)\">\n <span style=\"\r\n display: inline-block;\r\n max-width: 100px;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n white-space: nowrap;\r\n \">{{ getFieldLabel(condition.field) || ('SELECT_FIELD' | translate) }}</span>\r\n <i class=\"pi pi-chevron-down mr-2 ml-2 text-xs\"></i>\n </button>\n <!-- Overlay Content -->\n <p-popover #overlay appendTo=\"body\">\n <div class=\"w-60\">\n <p-listbox\n tabindex=\"0\"\n [options]=\"props['fields']\"\n optionLabel=\"label\"\n optionValue=\"key\"\n [(ngModel)]=\"condition.field\"\n (onChange)=\"onFieldChange(condition, groupIndex, conditionIndex); overlay.toggle($event)\"\n [style]=\"{ width: '100%' }\">\n </p-listbox>\n </div>\n </p-popover>\n </div>\n <!-- Operator Button -->\n <div style=\"align-items: center;display: flex;\" class=\"flex-shrink-0 border-l border-r border-gray-300\">\n <button\n type=\"button\"\n class=\"flex items-center justify-center w-full px-3 py-2 text-sm bg-gray-50 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:z-10\"\n style=\"height: -webkit-fill-available;\"\n pTooltip=\"{{ getOperatorLabel(condition.operator).label }}\"\n (click)=\"opPopover.toggle($event)\">\n <i [class]=\"getOperatorLabel(condition.operator).icon\"></i>\n </button>\n <p-popover #opPopover appendTo=\"body\">\n <div class=\"w-60\">\n <p-listbox\n [options]=\"condition.operatorsForField\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [(ngModel)]=\"condition.operator\"\n (onChange)=\"updateValue();opPopover.toggle($event)\"\n [style]=\"{ width: '100%' }\">\n </p-listbox>\n </div>\n </p-popover>\n </div>\n <!-- Form Field -->\n <div style=\"background: #f9fafb\" class=\"flex-grow p-1\">\n <formly-form\n [form]=\"form\"\n [fields]=\"[condition.valueFieldConfig]\"\n [model]=\"model\">\n </formly-form>\n </div>\n <!-- Delete Button -->\n <div style=\"align-items: center;display: flex;\" class=\"flex-shrink-0\">\n <button\n style=\"height: -webkit-fill-available;\"\n class=\"flex items-center justify-center w-full px-3 py-2 text-sm bg-red-50 text-red-600 hover:bg-red-100 focus:outline-none focus:ring-2 focus:ring-red-500 focus:z-10\"\n type=\"button\"\n (click)=\"removeCondition(groupIndex, conditionIndex)\"\n pTooltip=\"\u062D\u0630\u0641 \u0627\u0644\u0634\u0631\u0637\"\n tooltipPosition=\"top\">\n <i class=\"pi pi-times\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n <!-- Group Footer -->\n <div class=\"group-footer flex justify-between items-center mt-3 pt-3 border-t border-gray-200 \">\n <small class=\"text-gray-500\">\n {{ group.conditions.length }} \u0634\u0631\u0637 \u0641\u064A \u0647\u0630\u0647 \u0627\u0644\u0645\u062C\u0645\u0648\u0639\u0629\n </small>\n <small class=\"text-gray-500\">\n @if (groupIndex > 0) {\n <span>\n \u0645\u0631\u062A\u0628\u0637 \u0645\u0639 \u0627\u0644\u0633\u0627\u0628\u0642\u0629 \u0628\u0640 <strong [class.text-blue-600]=\"group.groupLogicalOperator === 'and'\"\n [class.text-amber-600]=\"group.groupLogicalOperator === 'or'\">\n {{ group.groupLogicalOperator === 'and' ? '\u0648' : '\u0623\u0648' }}\n </strong>\n </span>\n }\n </small>\n </div>\n </div>\n </div>\n }\n</div>\n\n<!-- Actions -->\n<div class=\"flex flex-wrap gap-3 mt-6\">\n <button\n pButton\n type=\"button\"\n icon=\"pi pi-plus\"\n [label]=\"'GROUP' | translate\"\n class=\"p-button-outlined p-button-sm !bg-white !border !border-blue-500 !text-blue-600 hover:!bg-blue-50 transition-colors flex items-center gap-2\"\n (click)=\"addGroup();\">\n </button>\n\n <button\n pButton\n type=\"button\"\n icon=\"pi pi-plus\"\n [label]=\"'CONDITION' | translate\"\n class=\"p-button-outlined p-button-sm !bg-white !border !border-blue-500 !text-blue-600 hover:!bg-blue-50 transition-colors flex items-center gap-2\"\n (click)=\"addConditionToLastGroup()\">\n </button>\n\n @if (groups.length > 0) {\n <button\n pButton\n type=\"button\"\n icon=\"pi pi-trash\"\n [label]=\"'CLEAR' | translate\"\n class=\"p-button-danger p-button-outlined p-button-sm !bg-white !border !border-red-500 !text-red-600 hover:!bg-red-50 transition-colors flex items-center gap-2\"\n (click)=\"clearAll()\">\n </button>\n }\n</div>\n\n<!-- Empty State -->\n@if (groups.length === 0) {\n <div class=\"empty-state text-center p-6 border-2 border-dashed border-gray-300 rounded-xl bg-gray-50\">\n <i class=\"pi pi-search text-4xl text-gray-400 mb-3\"></i>\n <p class=\"text-gray-500 mb-4\">{{ 'NO_SEARCH_CONDITIONS' | translate }}</p>\n <button\n pButton\n type=\"button\"\n icon=\"pi pi-plus\"\n [label]=\"'ADD_SEARCH_CONDITION' | translate\"\n class=\"p-button-outlined !px-4 !py-2\"\n (click)=\"addGroup()\">\n </button>\n </div>\n}\n</div>\n", styles: [".vertical-connector{position:relative;display:flex;justify-content:center;margin-bottom:1rem}.vertical-line{position:absolute;top:-1rem;height:1rem;width:2px;background-color:#d1d5db}.group-logical-operator-box{position:relative;padding:.25rem .75rem;border-radius:.375rem;font-weight:500;font-size:.75rem;z-index:10;transition:all .3s ease}.group-logical-operator-box.and{background-color:#dbeafe;color:#1d4ed8;border:1px solid #93c5fd}.group-logical-operator-box.or{background-color:#fef3c7;color:#92400e;border:1px solid #fcd34d}.connector-arrow{position:absolute;top:100%;left:50%;transform:translate(-50%);width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent}.group-logical-operator-box.and .connector-arrow{border-top:6px solid #93c5fd}.group-logical-operator-box.or .connector-arrow{border-top:6px solid #fcd34d}.border-blue-500{border-color:#93c5fd}.border-or-500{border-color:#fcd34d}.border-t-1{border-top-width:1px}.border-b-1{border-bottom-width:1px}.border-r-1{border-right-width:1px}.p-popover-content{padding:5px!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: SelectModule }, { kind: "directive", type: i1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i2.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "ngmodule", type: CheckboxModule }, { kind: "ngmodule", type: RadioButtonModule }, { kind: "component", type: FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i6$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip"] }, { kind: "ngmodule", type: MenuModule }, { kind: "ngmodule", type: InputGroupModule }, { kind: "ngmodule", type: InputGroupAddonModule }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i5$2.Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: ListboxModule }, { kind: "component", type: i6$2.Listbox, selector: "p-listbox, p-listBox, p-list-box", inputs: ["hostName", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "ariaLabel", "selectOnFocus", "searchLocale", "focusOnHover", "filterMessage", "filterFields", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "scrollHeight", "tabindex", "multiple", "styleClass", "listStyle", "listStyleClass", "readonly", "checkbox", "filter", "filterBy", "filterMatchMode", "filterLocale", "metaKeySelection", "dataKey", "showToggleAll", "optionLabel", "optionValue", "optionGroupChildren", "optionGroupLabel", "optionDisabled", "ariaFilterLabel", "filterPlaceHolder", "emptyFilterMessage", "emptyMessage", "group", "options", "filterValue", "selectAll", "striped", "highlightOnSelect", "checkmark", "dragdrop", "dropListData", "fluid"], outputs: ["onChange", "onClick", "onDblClick", "onFilter", "onFocus", "onBlur", "onSelectAllChange", "onLazyLoad", "onDrop"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
1610
1633
|
}
|