@es.framework/ng.ui.core 2.0.58
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 +3 -0
- package/attachments/README.md +3 -0
- package/base-crud/README.md +3 -0
- package/breadcrumb/README.md +3 -0
- package/checkbox/README.md +3 -0
- package/collapsible/README.md +3 -0
- package/color-picker/README.md +3 -0
- package/column-settings-popover/README.md +3 -0
- package/custom-switch/README.md +3 -0
- package/datepicker/README.md +3 -0
- package/deactivation-reason/README.md +3 -0
- package/excel-import/README.md +3 -0
- package/fesm2022/es.framework-ng.ui.core-attachments.mjs +217 -0
- package/fesm2022/es.framework-ng.ui.core-attachments.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-base-crud.mjs +370 -0
- package/fesm2022/es.framework-ng.ui.core-base-crud.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-breadcrumb.mjs +145 -0
- package/fesm2022/es.framework-ng.ui.core-breadcrumb.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-checkbox.mjs +131 -0
- package/fesm2022/es.framework-ng.ui.core-checkbox.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-collapsible.mjs +90 -0
- package/fesm2022/es.framework-ng.ui.core-collapsible.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-color-picker.mjs +87 -0
- package/fesm2022/es.framework-ng.ui.core-color-picker.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-column-settings-popover.mjs +183 -0
- package/fesm2022/es.framework-ng.ui.core-column-settings-popover.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-custom-switch.mjs +119 -0
- package/fesm2022/es.framework-ng.ui.core-custom-switch.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-datepicker.mjs +519 -0
- package/fesm2022/es.framework-ng.ui.core-datepicker.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-deactivation-reason.mjs +144 -0
- package/fesm2022/es.framework-ng.ui.core-deactivation-reason.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-excel-import.mjs +566 -0
- package/fesm2022/es.framework-ng.ui.core-excel-import.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-filter-templates.mjs +386 -0
- package/fesm2022/es.framework-ng.ui.core-filter-templates.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-form-button.mjs +62 -0
- package/fesm2022/es.framework-ng.ui.core-form-button.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-form-field.mjs +155 -0
- package/fesm2022/es.framework-ng.ui.core-form-field.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-form-template.mjs +37 -0
- package/fesm2022/es.framework-ng.ui.core-form-template.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-formly-avatar-image.mjs +132 -0
- package/fesm2022/es.framework-ng.ui.core-formly-avatar-image.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-formly-avatar-label.mjs +89 -0
- package/fesm2022/es.framework-ng.ui.core-formly-avatar-label.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-formly-button-selector.mjs +195 -0
- package/fesm2022/es.framework-ng.ui.core-formly-button-selector.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-formly-button.mjs +73 -0
- package/fesm2022/es.framework-ng.ui.core-formly-button.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-formly-presets.mjs +201 -0
- package/fesm2022/es.framework-ng.ui.core-formly-presets.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-formly-prime-icon-picker.mjs +542 -0
- package/fesm2022/es.framework-ng.ui.core-formly-prime-icon-picker.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-formly-split-button.mjs +62 -0
- package/fesm2022/es.framework-ng.ui.core-formly-split-button.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-formly-ui-all.mjs +422 -0
- package/fesm2022/es.framework-ng.ui.core-formly-ui-all.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-formly-ui.mjs +48 -0
- package/fesm2022/es.framework-ng.ui.core-formly-ui.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-formly-username-with-domain.mjs +85 -0
- package/fesm2022/es.framework-ng.ui.core-formly-username-with-domain.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-assets.mjs +22 -0
- package/fesm2022/es.framework-ng.ui.core-generic-assets.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-autocomplete.mjs +173 -0
- package/fesm2022/es.framework-ng.ui.core-generic-autocomplete.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-button.mjs +150 -0
- package/fesm2022/es.framework-ng.ui.core-generic-button.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-card.mjs +218 -0
- package/fesm2022/es.framework-ng.ui.core-generic-card.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-crud-table.mjs +929 -0
- package/fesm2022/es.framework-ng.ui.core-generic-crud-table.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-dialog.mjs +321 -0
- package/fesm2022/es.framework-ng.ui.core-generic-dialog.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-errormessage.mjs +35 -0
- package/fesm2022/es.framework-ng.ui.core-generic-errormessage.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-formly-fields.mjs +63 -0
- package/fesm2022/es.framework-ng.ui.core-generic-formly-fields.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-loadingspinner.mjs +34 -0
- package/fesm2022/es.framework-ng.ui.core-generic-loadingspinner.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-report-tabs.mjs +196 -0
- package/fesm2022/es.framework-ng.ui.core-generic-report-tabs.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-report.mjs +556 -0
- package/fesm2022/es.framework-ng.ui.core-generic-report.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-search-advanced.mjs +2995 -0
- package/fesm2022/es.framework-ng.ui.core-generic-search-advanced.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-search.mjs +103 -0
- package/fesm2022/es.framework-ng.ui.core-generic-search.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-selector.mjs +684 -0
- package/fesm2022/es.framework-ng.ui.core-generic-selector.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-table.mjs +388 -0
- package/fesm2022/es.framework-ng.ui.core-generic-table.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-generic-view.mjs +465 -0
- package/fesm2022/es.framework-ng.ui.core-generic-view.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-header-wrapper.mjs +31 -0
- package/fesm2022/es.framework-ng.ui.core-header-wrapper.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-icon-picker.mjs +205 -0
- package/fesm2022/es.framework-ng.ui.core-icon-picker.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-input-switch.mjs +102 -0
- package/fesm2022/es.framework-ng.ui.core-input-switch.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-input-with-icon.mjs +67 -0
- package/fesm2022/es.framework-ng.ui.core-input-with-icon.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-input.mjs +250 -0
- package/fesm2022/es.framework-ng.ui.core-input.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-label-type.mjs +184 -0
- package/fesm2022/es.framework-ng.ui.core-label-type.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-loading-skeletons.mjs +66 -0
- package/fesm2022/es.framework-ng.ui.core-loading-skeletons.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-odata-query-builder.mjs +307 -0
- package/fesm2022/es.framework-ng.ui.core-odata-query-builder.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-query-type.mjs +162 -0
- package/fesm2022/es.framework-ng.ui.core-query-type.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-radio.mjs +120 -0
- package/fesm2022/es.framework-ng.ui.core-radio.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-repeat.mjs +290 -0
- package/fesm2022/es.framework-ng.ui.core-repeat.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-select.mjs +179 -0
- package/fesm2022/es.framework-ng.ui.core-select.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-sidebar-cards.mjs +52 -0
- package/fesm2022/es.framework-ng.ui.core-sidebar-cards.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-sidebar-toggles.mjs +53 -0
- package/fesm2022/es.framework-ng.ui.core-sidebar-toggles.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-tabs.mjs +57 -0
- package/fesm2022/es.framework-ng.ui.core-tabs.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-tag-type.mjs +209 -0
- package/fesm2022/es.framework-ng.ui.core-tag-type.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-text-editor.mjs +58 -0
- package/fesm2022/es.framework-ng.ui.core-text-editor.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-textarea.mjs +93 -0
- package/fesm2022/es.framework-ng.ui.core-textarea.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core-wrappers.mjs +245 -0
- package/fesm2022/es.framework-ng.ui.core-wrappers.mjs.map +1 -0
- package/fesm2022/es.framework-ng.ui.core.mjs +20 -0
- package/fesm2022/es.framework-ng.ui.core.mjs.map +1 -0
- package/filter-templates/README.md +3 -0
- package/form-button/README.md +3 -0
- package/form-field/README.md +3 -0
- package/form-template/README.md +3 -0
- package/formly-avatar-image/README.md +3 -0
- package/formly-avatar-label/README.md +3 -0
- package/formly-button/README.md +3 -0
- package/formly-button-selector/README.md +3 -0
- package/formly-presets/README.md +3 -0
- package/formly-prime-icon-picker/README.md +3 -0
- package/formly-split-button/README.md +3 -0
- package/formly-ui/README.md +3 -0
- package/formly-ui-all/README.md +3 -0
- package/formly-username-with-domain/README.md +3 -0
- package/generic-assets/README.md +3 -0
- package/generic-autocomplete/README.md +3 -0
- package/generic-button/README.md +3 -0
- package/generic-card/README.md +3 -0
- package/generic-crud-table/README.md +3 -0
- package/generic-dialog/README.md +3 -0
- package/generic-errormessage/README.md +3 -0
- package/generic-formly-fields/README.md +3 -0
- package/generic-loadingspinner/README.md +3 -0
- package/generic-report/README.md +3 -0
- package/generic-report-tabs/README.md +0 -0
- package/generic-search/README.md +3 -0
- package/generic-search-advanced/README.md +3 -0
- package/generic-selector/README.md +3 -0
- package/generic-table/README.md +3 -0
- package/generic-view/README.md +3 -0
- package/header-wrapper/README.md +3 -0
- package/icon-picker/README.md +3 -0
- package/input/README.md +3 -0
- package/input-switch/README.md +3 -0
- package/input-with-icon/README.md +3 -0
- package/label-type/README.md +3 -0
- package/loading-skeletons/README.md +3 -0
- package/odata-query-builder/README.md +3 -0
- package/package.json +264 -0
- package/query-type/README.md +3 -0
- package/radio/README.md +3 -0
- package/repeat/README.md +3 -0
- package/select/README.md +3 -0
- package/sidebar-cards/README.md +3 -0
- package/sidebar-toggles/README.md +3 -0
- package/styles.css +2 -0
- package/tabs/README.md +3 -0
- package/tag-type/README.md +3 -0
- package/text-editor/README.md +3 -0
- package/textarea/README.md +3 -0
- package/types/es.framework-ng.ui.core-attachments.d.ts +38 -0
- package/types/es.framework-ng.ui.core-base-crud.d.ts +74 -0
- package/types/es.framework-ng.ui.core-breadcrumb.d.ts +17 -0
- package/types/es.framework-ng.ui.core-checkbox.d.ts +33 -0
- package/types/es.framework-ng.ui.core-collapsible.d.ts +18 -0
- package/types/es.framework-ng.ui.core-color-picker.d.ts +16 -0
- package/types/es.framework-ng.ui.core-column-settings-popover.d.ts +46 -0
- package/types/es.framework-ng.ui.core-custom-switch.d.ts +19 -0
- package/types/es.framework-ng.ui.core-datepicker.d.ts +23 -0
- package/types/es.framework-ng.ui.core-deactivation-reason.d.ts +32 -0
- package/types/es.framework-ng.ui.core-excel-import.d.ts +69 -0
- package/types/es.framework-ng.ui.core-filter-templates.d.ts +57 -0
- package/types/es.framework-ng.ui.core-form-button.d.ts +17 -0
- package/types/es.framework-ng.ui.core-form-field.d.ts +30 -0
- package/types/es.framework-ng.ui.core-form-template.d.ts +16 -0
- package/types/es.framework-ng.ui.core-formly-avatar-image.d.ts +18 -0
- package/types/es.framework-ng.ui.core-formly-avatar-label.d.ts +36 -0
- package/types/es.framework-ng.ui.core-formly-button-selector.d.ts +35 -0
- package/types/es.framework-ng.ui.core-formly-button.d.ts +20 -0
- package/types/es.framework-ng.ui.core-formly-presets.d.ts +37 -0
- package/types/es.framework-ng.ui.core-formly-prime-icon-picker.d.ts +45 -0
- package/types/es.framework-ng.ui.core-formly-split-button.d.ts +23 -0
- package/types/es.framework-ng.ui.core-formly-ui-all.d.ts +40 -0
- package/types/es.framework-ng.ui.core-formly-ui.d.ts +13 -0
- package/types/es.framework-ng.ui.core-formly-username-with-domain.d.ts +19 -0
- package/types/es.framework-ng.ui.core-generic-assets.d.ts +10 -0
- package/types/es.framework-ng.ui.core-generic-autocomplete.d.ts +41 -0
- package/types/es.framework-ng.ui.core-generic-button.d.ts +39 -0
- package/types/es.framework-ng.ui.core-generic-card.d.ts +93 -0
- package/types/es.framework-ng.ui.core-generic-crud-table.d.ts +293 -0
- package/types/es.framework-ng.ui.core-generic-dialog.d.ts +93 -0
- package/types/es.framework-ng.ui.core-generic-errormessage.d.ts +17 -0
- package/types/es.framework-ng.ui.core-generic-formly-fields.d.ts +26 -0
- package/types/es.framework-ng.ui.core-generic-loadingspinner.d.ts +16 -0
- package/types/es.framework-ng.ui.core-generic-report-tabs.d.ts +21 -0
- package/types/es.framework-ng.ui.core-generic-report.d.ts +121 -0
- package/types/es.framework-ng.ui.core-generic-search-advanced.d.ts +305 -0
- package/types/es.framework-ng.ui.core-generic-search.d.ts +36 -0
- package/types/es.framework-ng.ui.core-generic-selector.d.ts +99 -0
- package/types/es.framework-ng.ui.core-generic-table.d.ts +84 -0
- package/types/es.framework-ng.ui.core-generic-view.d.ts +97 -0
- package/types/es.framework-ng.ui.core-header-wrapper.d.ts +15 -0
- package/types/es.framework-ng.ui.core-icon-picker.d.ts +30 -0
- package/types/es.framework-ng.ui.core-input-switch.d.ts +16 -0
- package/types/es.framework-ng.ui.core-input-with-icon.d.ts +17 -0
- package/types/es.framework-ng.ui.core-input.d.ts +47 -0
- package/types/es.framework-ng.ui.core-label-type.d.ts +38 -0
- package/types/es.framework-ng.ui.core-loading-skeletons.d.ts +17 -0
- package/types/es.framework-ng.ui.core-odata-query-builder.d.ts +87 -0
- package/types/es.framework-ng.ui.core-query-type.d.ts +37 -0
- package/types/es.framework-ng.ui.core-radio.d.ts +38 -0
- package/types/es.framework-ng.ui.core-repeat.d.ts +31 -0
- package/types/es.framework-ng.ui.core-select.d.ts +42 -0
- package/types/es.framework-ng.ui.core-sidebar-cards.d.ts +25 -0
- package/types/es.framework-ng.ui.core-sidebar-toggles.d.ts +25 -0
- package/types/es.framework-ng.ui.core-tabs.d.ts +17 -0
- package/types/es.framework-ng.ui.core-tag-type.d.ts +34 -0
- package/types/es.framework-ng.ui.core-text-editor.d.ts +16 -0
- package/types/es.framework-ng.ui.core-textarea.d.ts +36 -0
- package/types/es.framework-ng.ui.core-wrappers.d.ts +36 -0
- package/types/es.framework-ng.ui.core.d.ts +8 -0
- package/wrappers/README.md +3 -0
|
@@ -0,0 +1,929 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { NgModule, inject, EventEmitter, Output, Input, Component, ViewChild } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { GenericButtonModule, GenericButton } from '@es.framework/ng.ui.core/generic-button';
|
|
6
|
+
import * as i4 from 'primeng/divider';
|
|
7
|
+
import { DividerModule } from 'primeng/divider';
|
|
8
|
+
import { MessageModule } from 'primeng/message';
|
|
9
|
+
import * as i2 from 'primeng/button';
|
|
10
|
+
import { ButtonModule } from 'primeng/button';
|
|
11
|
+
import { TableModule } from 'primeng/table';
|
|
12
|
+
import { ToolbarModule } from 'primeng/toolbar';
|
|
13
|
+
import { TranslatePipe } from '@es.framework/ng.core/pipes';
|
|
14
|
+
import { IconFieldModule } from 'primeng/iconfield';
|
|
15
|
+
import { DrawerModule } from 'primeng/drawer';
|
|
16
|
+
import { DialogModule } from 'primeng/dialog';
|
|
17
|
+
import * as i5 from '@angular/forms';
|
|
18
|
+
import { FormsModule, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';
|
|
19
|
+
import { LocalizationService, SwalService, BaseService } from '@es.framework/ng.core/services';
|
|
20
|
+
import * as i6 from 'primeng/tooltip';
|
|
21
|
+
import { TooltipModule } from 'primeng/tooltip';
|
|
22
|
+
import { Menu } from 'primeng/menu';
|
|
23
|
+
import { DialogService } from 'primeng/dynamicdialog';
|
|
24
|
+
import { BreadcrumbComponent } from '@es.framework/ng.ui.core/breadcrumb';
|
|
25
|
+
import { GenericSearchAdvanced, QueryBuilderService } from '@es.framework/ng.ui.core/generic-search-advanced';
|
|
26
|
+
import { GenericReportComponent } from '@es.framework/ng.ui.core/generic-report';
|
|
27
|
+
import * as i7 from 'primeng/selectbutton';
|
|
28
|
+
import { SelectButtonModule } from 'primeng/selectbutton';
|
|
29
|
+
import { TabbedSearchComponent } from '@es.framework/ng.ui.core/generic-report-tabs';
|
|
30
|
+
import * as i3 from 'primeng/api';
|
|
31
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
32
|
+
import { GenericTable } from '@es.framework/ng.ui.core/generic-table';
|
|
33
|
+
import { GenericDialogComponent } from '@es.framework/ng.ui.core/generic-dialog';
|
|
34
|
+
import { GenericViewComponent } from '@es.framework/ng.ui.core/generic-view';
|
|
35
|
+
|
|
36
|
+
class GenericCrudTableModule {
|
|
37
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: GenericCrudTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
38
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: GenericCrudTableModule, imports: [CommonModule, GenericButtonModule] });
|
|
39
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: GenericCrudTableModule, imports: [CommonModule, GenericButtonModule] });
|
|
40
|
+
}
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: GenericCrudTableModule, decorators: [{
|
|
42
|
+
type: NgModule,
|
|
43
|
+
args: [{
|
|
44
|
+
imports: [CommonModule, GenericButtonModule],
|
|
45
|
+
}]
|
|
46
|
+
}] });
|
|
47
|
+
|
|
48
|
+
class GenericCrudHeaderComponent {
|
|
49
|
+
translate = inject(LocalizationService);
|
|
50
|
+
dialogService = inject(DialogService);
|
|
51
|
+
// 🟢 Inputs
|
|
52
|
+
mode = 'full';
|
|
53
|
+
breadcrumb;
|
|
54
|
+
isSingleItemSelected = false;
|
|
55
|
+
selectedItems = [];
|
|
56
|
+
singleActionButtons = [];
|
|
57
|
+
bulkActionButtons = [];
|
|
58
|
+
addButtonConfigs = [];
|
|
59
|
+
mergedButtonConfigs = [];
|
|
60
|
+
filters;
|
|
61
|
+
filterModel = {};
|
|
62
|
+
showSearch = true;
|
|
63
|
+
first = 0; // Add input for current 'first' index
|
|
64
|
+
rows = 10; // Add input for current 'rows' per page
|
|
65
|
+
totalRecords = 0; // Add input for total records
|
|
66
|
+
moduleName = '';
|
|
67
|
+
apiName = '';
|
|
68
|
+
actions = [
|
|
69
|
+
{
|
|
70
|
+
label: this.translate.instant('REPORT'),
|
|
71
|
+
icon: 'pi pi-file-export',
|
|
72
|
+
command: (e) => {
|
|
73
|
+
this.openReportDialog();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
];
|
|
77
|
+
// 🟢 Outputs
|
|
78
|
+
singleItemAction = new EventEmitter();
|
|
79
|
+
bulkAction = new EventEmitter();
|
|
80
|
+
search = new EventEmitter();
|
|
81
|
+
resetSearch = new EventEmitter();
|
|
82
|
+
action = new EventEmitter();
|
|
83
|
+
paginateChange = new EventEmitter(); // NEW OUTPUT
|
|
84
|
+
// 🟢 Inputs الجديدة
|
|
85
|
+
showAdvancedFilter = false; // متغير للتحكم في ظهور الزر
|
|
86
|
+
advancedFilterIcon = 'pi pi-filter-fill'; // أيقونة اختيارية
|
|
87
|
+
// 🟢 الحالة الخاصة بالفلتر المتقدم
|
|
88
|
+
isAdvancedFilterVisible = false; // لإخفاء وإظهار المكون عند الضغط
|
|
89
|
+
// أضف هذا الـ Input
|
|
90
|
+
searchTabs = []; // مصفوفة التبويبات
|
|
91
|
+
// 🟢 ميزة تبديل العرض
|
|
92
|
+
showViewMode = false;
|
|
93
|
+
viewMode = 'table';
|
|
94
|
+
viewModeChange = new EventEmitter();
|
|
95
|
+
// تعريف الخيارات
|
|
96
|
+
viewOptions = [
|
|
97
|
+
{ icon: 'pi pi-list', value: 'table', title: 'TABLE_VIEW' },
|
|
98
|
+
{ icon: 'pi pi-th-large', value: 'grid', title: 'GRID_VIEW' }
|
|
99
|
+
];
|
|
100
|
+
onViewChange(event) {
|
|
101
|
+
// PrimeNG SelectButton event.value يحتوي على القيمة المختارة
|
|
102
|
+
if (event.value) {
|
|
103
|
+
this.viewModeChange.emit(event.value);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// 🟢 Actions
|
|
107
|
+
toggleAdvancedFilter() {
|
|
108
|
+
this.isAdvancedFilterVisible = !this.isAdvancedFilterVisible;
|
|
109
|
+
}
|
|
110
|
+
// 🟢 Helpers
|
|
111
|
+
trackByIdx = (index) => index;
|
|
112
|
+
// 🟢 Actions
|
|
113
|
+
onSingleItemAction(btn) {
|
|
114
|
+
this.singleItemAction.emit(btn);
|
|
115
|
+
}
|
|
116
|
+
onInternalBulkAction(btn) {
|
|
117
|
+
this.bulkAction.emit(btn);
|
|
118
|
+
}
|
|
119
|
+
paginationChange(value) {
|
|
120
|
+
this.rows = value.top;
|
|
121
|
+
}
|
|
122
|
+
applySearch(value) {
|
|
123
|
+
this.search.emit(value);
|
|
124
|
+
}
|
|
125
|
+
reset() {
|
|
126
|
+
this.resetSearch.emit();
|
|
127
|
+
}
|
|
128
|
+
// Go to previous page
|
|
129
|
+
// 🟢 Actions (Keep or adapt your existing pagination logic)
|
|
130
|
+
totalPages() {
|
|
131
|
+
if (this.totalRecords === 0 || this.rows === 0)
|
|
132
|
+
return 0;
|
|
133
|
+
return Math.ceil(this.totalRecords / this.rows);
|
|
134
|
+
}
|
|
135
|
+
pageInput = null;
|
|
136
|
+
showPageMenu = false;
|
|
137
|
+
// Get current page number (1-based)
|
|
138
|
+
get currentPage() {
|
|
139
|
+
return Math.floor(this.first / this.rows) + 1;
|
|
140
|
+
}
|
|
141
|
+
// Go to specific page from menu
|
|
142
|
+
goToPageMenu() {
|
|
143
|
+
if (this.pageInput && this.pageInput >= 1 && this.pageInput <= this.totalPages()) {
|
|
144
|
+
const newFirst = (this.pageInput - 1) * this.rows;
|
|
145
|
+
this.paginateChange.emit({ first: newFirst, rows: this.rows });
|
|
146
|
+
this.pageInput = null;
|
|
147
|
+
this.showPageMenu = false; // Close menu after navigation
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// Go to specific page (original method)
|
|
151
|
+
goToPage() {
|
|
152
|
+
this.goToPageMenu(); // Reuse the same logic
|
|
153
|
+
}
|
|
154
|
+
// Go to first page
|
|
155
|
+
goFirst() {
|
|
156
|
+
this.paginateChange.emit({ first: 0, rows: this.rows }); // EMIT EVENT
|
|
157
|
+
}
|
|
158
|
+
// Go to last page
|
|
159
|
+
goLast() {
|
|
160
|
+
const maxFirst = Math.max(0, (this.totalPages() - 1) * this.rows);
|
|
161
|
+
this.paginateChange.emit({ first: maxFirst, rows: this.rows }); // EMIT EVENT
|
|
162
|
+
}
|
|
163
|
+
// Go to previous page
|
|
164
|
+
goPrev() {
|
|
165
|
+
const newFirst = Math.max(this.first - this.rows, 0);
|
|
166
|
+
this.paginateChange.emit({ first: newFirst, rows: this.rows }); // EMIT EVENT
|
|
167
|
+
}
|
|
168
|
+
// Go to next page
|
|
169
|
+
goNext() {
|
|
170
|
+
const maxFirst = Math.max(0, (this.totalPages() - 1) * this.rows);
|
|
171
|
+
const newFirst = Math.min(this.first + this.rows, maxFirst);
|
|
172
|
+
this.paginateChange.emit({ first: newFirst, rows: this.rows }); // EMIT EVENT
|
|
173
|
+
}
|
|
174
|
+
// Check first/last page
|
|
175
|
+
isFirstPage() {
|
|
176
|
+
return this.first === 0;
|
|
177
|
+
}
|
|
178
|
+
isLastPage() {
|
|
179
|
+
return this.first + this.rows >= this.totalRecords;
|
|
180
|
+
}
|
|
181
|
+
// Detect RTL direction
|
|
182
|
+
get isRTL() {
|
|
183
|
+
return document.documentElement.dir === 'rtl' ||
|
|
184
|
+
document.body.dir === 'rtl' ||
|
|
185
|
+
// this.translateService?.currentLang === 'ar' || // if using translation
|
|
186
|
+
false; // default to LTR
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Handles button click in a unified way.
|
|
190
|
+
* - If btn.action is defined, execute it.
|
|
191
|
+
* - Otherwise, emit event with actionName or default 'add'.
|
|
192
|
+
*/
|
|
193
|
+
async handleButtonClick(btn) {
|
|
194
|
+
try {
|
|
195
|
+
if (btn.action) {
|
|
196
|
+
// Execute the provided action
|
|
197
|
+
await btn.action(null); // You can pass row or context here
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
// Fallback to emitting event
|
|
201
|
+
this.action.emit({
|
|
202
|
+
name: btn.actionName ?? 'add',
|
|
203
|
+
row: null, // provide row if available
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
catch (err) {
|
|
208
|
+
console.error('Button action error', err);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
openReportDialog() {
|
|
212
|
+
const ref = this.dialogService.open(GenericReportComponent, {
|
|
213
|
+
header: this.translate.instant('REPORT'),
|
|
214
|
+
showHeader: false,
|
|
215
|
+
width: '90%',
|
|
216
|
+
height: 'auto',
|
|
217
|
+
modal: true,
|
|
218
|
+
focusOnShow: false,
|
|
219
|
+
data: {
|
|
220
|
+
apiName: this.apiName,
|
|
221
|
+
moduleName: this.moduleName,
|
|
222
|
+
filterFields: this.filters,
|
|
223
|
+
filterModel: { /* status: 'Active' */},
|
|
224
|
+
defaultFileName: this.translate.instant('REPORT') + ' ' + this.translate.instant(this.breadcrumb?.length ? this.breadcrumb[this.breadcrumb.length - 1].label ?? '' : '')
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
ref?.onClose.subscribe((exportConfig) => {
|
|
228
|
+
if (exportConfig) {
|
|
229
|
+
console.log('Export configuration:', exportConfig);
|
|
230
|
+
// Handle the export - call your API service here
|
|
231
|
+
this.handleExport(exportConfig);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
handleExport(config) {
|
|
236
|
+
// Your export logic here
|
|
237
|
+
// if (config.exportType === 'EXCEL') {
|
|
238
|
+
// this.exportToExcel(config);
|
|
239
|
+
// } else if (config.exportType === 'PDF') {
|
|
240
|
+
// this.exportToPdf(config);
|
|
241
|
+
// }
|
|
242
|
+
// etc.
|
|
243
|
+
}
|
|
244
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: GenericCrudHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
245
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: GenericCrudHeaderComponent, isStandalone: true, selector: "app-generic-crud-header", inputs: { mode: "mode", breadcrumb: "breadcrumb", isSingleItemSelected: "isSingleItemSelected", selectedItems: "selectedItems", singleActionButtons: "singleActionButtons", bulkActionButtons: "bulkActionButtons", addButtonConfigs: "addButtonConfigs", mergedButtonConfigs: "mergedButtonConfigs", filters: "filters", filterModel: "filterModel", showSearch: "showSearch", first: "first", rows: "rows", totalRecords: "totalRecords", moduleName: "moduleName", apiName: "apiName", actions: "actions", showAdvancedFilter: "showAdvancedFilter", advancedFilterIcon: "advancedFilterIcon", searchTabs: "searchTabs", showViewMode: "showViewMode", viewMode: "viewMode" }, outputs: { singleItemAction: "singleItemAction", bulkAction: "bulkAction", search: "search", resetSearch: "resetSearch", action: "action", paginateChange: "paginateChange", viewModeChange: "viewModeChange" }, providers: [DialogService], ngImport: i0, template: "@if (mode !== 'form-only' && mode !== 'detail') {\r\n<div class=\"flex items-start gap-2 justify-between\">\r\n <div>\r\n <app-breadcrumb\r\n class=\"xs:block hidden\"\r\n [breadcrumb]=\"breadcrumb\"\r\n ></app-breadcrumb>\r\n </div>\r\n\r\n <div class=\"flex items-center gap-2 justify-end flex-wrap\">\r\n @if (mode === 'full') {\r\n <!-- \u0623\u0632\u0631\u0627\u0631 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u0641\u0631\u062F\u0629 -->\r\n @if (isSingleItemSelected) {\r\n @for (btn of singleActionButtons; track trackByIdx($index)) {\r\n @if (!btn.visible || (btn.visible && btn.visible === true)) {\r\n <lib-generic-button\r\n [icon]=\"btn.icon\"\r\n [label]=\"btn.label | translate\"\r\n [variant]=\"btn.variant\"\r\n [size]=\"btn.size\"\r\n [severity]=\"btn.severity\"\r\n [model]=\"btn.splitActions\"\r\n [permission]=\"btn.permission\"\r\n (clicked)=\"onSingleItemAction(btn)\"\r\n ></lib-generic-button>\r\n }\r\n }\r\n }\r\n\r\n <!-- \u0623\u0632\u0631\u0627\u0631 \u0645\u062A\u0639\u062F\u062F\u0629 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 -->\r\n @if (selectedItems.length > 0) {\r\n @for (btn of bulkActionButtons; track trackByIdx($index)) {\r\n @if (!btn.visible || (btn.visible && btn.visible === true)) {\r\n <lib-generic-button\r\n [icon]=\"btn.icon\"\r\n [label]=\"btn.label | translate\"\r\n [variant]=\"btn.variant\"\r\n [size]=\"btn.size\"\r\n [severity]=\"btn.severity\"\r\n [model]=\"btn.splitActions\"\r\n [permission]=\"btn.permission\"\r\n (clicked)=\"onInternalBulkAction(btn)\"\r\n ></lib-generic-button>\r\n }\r\n }\r\n }\r\n\r\n <!-- \u0623\u0632\u0631\u0627\u0631 \u0627\u0644\u0625\u0636\u0627\u0641\u0629 -->\r\n @for (btn of mergedButtonConfigs; track trackByIdx($index)) {\r\n @if (!btn.visible || (btn.visible && btn.visible === true)) {\r\n <lib-generic-button\r\n [icon]=\"btn.icon\"\r\n [label]=\"btn.label | translate\"\r\n [variant]=\"btn.variant\"\r\n [size]=\"btn.size\"\r\n [severity]=\"btn.severity\"\r\n [model]=\"btn.splitActions\"\r\n [permission]=\"btn.permission\"\r\n (clicked)=\"handleButtonClick(btn)\"\r\n ></lib-generic-button>\r\n }\r\n }\r\n }\r\n </div>\r\n</div>\r\n}\r\n\r\n@if (mode !== 'form-only' && mode !== 'detail') {\r\n<div class=\"mt-2 mb-4 flex items-center justify-between\">\r\n <!-- \u0627\u0644\u0628\u062D\u062B -->\r\n @if (showSearch && filters) {\r\n <lib-generic-search-advanced\r\n [model]=\"filterModel\"\r\n [fields]=\"filters\"\r\n (search)=\"applySearch($event)\"\r\n (paginationChange)=\"paginationChange($event)\"\r\n >\r\n</lib-generic-search-advanced>\r\n } @else {\r\n <div></div>\r\n }\r\n\r\n <!-- \u0623\u062F\u0648\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629 -->\r\n <div class=\"flex items-center gap-3 rtl:space-x-reverse\">\r\n\r\n @if (showAdvancedFilter && searchTabs.length > 0) {\r\n <p-button\r\n [icon]=\"advancedFilterIcon\"\r\n [outlined]=\"!isAdvancedFilterVisible\"\r\n severity=\"secondary\"\r\n [pTooltip]=\"'ADVANCED_FILTER' | translate\"\r\n tooltipPosition=\"top\"\r\n (onClick)=\"toggleAdvancedFilter()\"\r\n class=\"hidden sm:inline-flex\"\r\n />\r\n}\r\n <!-- Refresh Button -->\r\n <p-button\r\n icon=\"pi pi-refresh\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"hidden xs:block\"\r\n (onClick)=\"reset()\"\r\n />\r\n\r\n <p-divider layout=\"vertical\" class=\"m-0 p-0 hidden xs:block\" />\r\n\r\n\r\n <!-- <p-button (click)=\"menu.toggle($event)\" class=\"xs:block\" severity=\"secondary\" outlined icon=\"pi pi-ellipsis-v\"/>\r\n <p-menu #menu [model]=\"actions\" [popup]=\"true\" /> -->\r\n\r\n\r\n <!-- Pagination Controls -->\r\n <div class=\"flex items-center gap-1 rtl:space-x-reverse\">\r\n\r\n @if ( showViewMode ) {\r\n<p-selectButton\r\n [options]=\"viewOptions\"\r\n [(ngModel)]=\"viewMode\"\r\n (onChange)=\"onViewChange($event)\"\r\n [unselectable]=\"false\"\r\n optionLabel=\"icon\"\r\n optionValue=\"value\"\r\n\r\n styleClass=\"inline-flex bg-slate-100 dark:bg-slate-800 p-1 rounded-xl border border-slate-200 dark:border-slate-700 shadow-inner\"\r\n>\r\n\r\n <ng-template let-item pTemplate=\"item\">\r\n <div\r\n class=\"flex items-center justify-center rounded-lg transition-all duration-200\"\r\n [ngClass]=\"{\r\n ' dark:bg-slate-600 shadow-sm': viewMode === item.value,\r\n 'text-slate-500 hover:bg-slate-200 dark:hover:bg-slate-700': viewMode !== item.value\r\n }\"\r\n [pTooltip]=\"item.title | translate\"\r\n tooltipPosition=\"top\"\r\n >\r\n <i [class]=\"item.icon\" class=\"text-base\"></i>\r\n </div>\r\n </ng-template>\r\n\r\n</p-selectButton>\r\n }\r\n <p-divider layout=\"vertical\" class=\"m-0 p-0 hidden xs:block\" />\r\n\r\n <!-- First Page Button -->\r\n <p-button\r\n [icon]=\"isRTL ? 'pi pi-angle-double-right' : 'pi pi-angle-double-left'\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"hidden xs:block\"\r\n (click)=\"goFirst()\"\r\n [disabled]=\"isFirstPage()\"\r\n ></p-button>\r\n\r\n <!-- Previous Page Button -->\r\n <p-button\r\n [icon]=\"isRTL ? 'pi pi-chevron-right' : 'pi pi-chevron-left'\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"xs:block\"\r\n (click)=\"goPrev()\"\r\n [disabled]=\"isFirstPage()\"\r\n ></p-button>\r\n\r\n\r\n <!-- Current Page Display with Dropdown -->\r\n <div class=\"relative\">\r\n\r\n <p-button\r\n [label]=\"currentPage + ' / ' + totalPages()\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"hidden xs:block\"\r\n (click)=\"showPageMenu = !showPageMenu\"\r\n pTooltip=\"{{totalRecords}}\"\r\n tooltipPosition=\"top\"\r\n />\r\n\r\n\r\n </div>\r\n <!-- Next Page Button -->\r\n <p-button\r\n [icon]=\"isRTL ? 'pi pi-chevron-left' : 'pi pi-chevron-right'\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"xs:block\"\r\n (click)=\"goNext()\"\r\n [disabled]=\"isLastPage()\"\r\n ></p-button>\r\n\r\n <!-- Last Page Button -->\r\n <p-button\r\n [icon]=\"isRTL ? 'pi pi-angle-double-left' : 'pi pi-angle-double-right'\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"hidden xs:block\"\r\n (click)=\"goLast()\"\r\n [disabled]=\"isLastPage()\"\r\n ></p-button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n @if (showSearch && showAdvancedFilter && searchTabs.length > 0) {\r\n <div\r\n [ngClass]=\"{\r\n 'block': true,\r\n 'sm:hidden': !isAdvancedFilterVisible,\r\n 'sm:block': isAdvancedFilterVisible\r\n }\"\r\n class=\"animate-fade-in\"\r\n >\r\n <app-tabbed-search\r\n [fields]=\"searchTabs\"\r\n [model]=\"filterModel\"\r\n (onSearch)=\"applySearch($event)\"\r\n (onReset)=\"reset()\"\r\n (paginationChange)=\"paginationChange($event)\">\r\n </app-tabbed-search>\r\n </div>\r\n}\r\n}\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: GenericButton, selector: "lib-generic-button", inputs: ["model", "type", "icon", "label", "variant", "severity", "size", "iconPosition", "disabled", "loading", "ariaLabel", "extraClasses", "permission"], outputs: ["clicked", "itemClick"] }, { kind: "component", type: BreadcrumbComponent, selector: "app-breadcrumb", inputs: ["breadcrumb"] }, { kind: "ngmodule", type: ButtonModule }, { 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: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: DividerModule }, { kind: "component", type: i4.Divider, selector: "p-divider", inputs: ["styleClass", "layout", "type", "align"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i6.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip"] }, { kind: "component", type: GenericSearchAdvanced, selector: "lib-generic-search-advanced", inputs: ["model", "fields", "enableSelect", "enableGroup", "odataConfig"], outputs: ["search", "paginationChange", "odataSearch"] }, { kind: "ngmodule", type: SelectButtonModule }, { kind: "component", type: i7.SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "styleClass", "ariaLabelledBy", "dataKey", "autofocus", "size", "fluid"], outputs: ["onOptionClick", "onChange"] }, { kind: "component", type: TabbedSearchComponent, selector: "app-tabbed-search", inputs: ["fields", "model", "form"], outputs: ["onSearch", "onReset", "paginationChange"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
246
|
+
}
|
|
247
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: GenericCrudHeaderComponent, decorators: [{
|
|
248
|
+
type: Component,
|
|
249
|
+
args: [{ selector: 'app-generic-crud-header', standalone: true, imports: [
|
|
250
|
+
CommonModule,
|
|
251
|
+
GenericButton,
|
|
252
|
+
TranslatePipe,
|
|
253
|
+
BreadcrumbComponent,
|
|
254
|
+
ButtonModule,
|
|
255
|
+
DividerModule,
|
|
256
|
+
FormsModule,
|
|
257
|
+
ReactiveFormsModule,
|
|
258
|
+
TooltipModule,
|
|
259
|
+
Menu,
|
|
260
|
+
GenericSearchAdvanced,
|
|
261
|
+
SelectButtonModule,
|
|
262
|
+
TabbedSearchComponent,
|
|
263
|
+
], providers: [DialogService], template: "@if (mode !== 'form-only' && mode !== 'detail') {\r\n<div class=\"flex items-start gap-2 justify-between\">\r\n <div>\r\n <app-breadcrumb\r\n class=\"xs:block hidden\"\r\n [breadcrumb]=\"breadcrumb\"\r\n ></app-breadcrumb>\r\n </div>\r\n\r\n <div class=\"flex items-center gap-2 justify-end flex-wrap\">\r\n @if (mode === 'full') {\r\n <!-- \u0623\u0632\u0631\u0627\u0631 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 \u0627\u0644\u0645\u0641\u0631\u062F\u0629 -->\r\n @if (isSingleItemSelected) {\r\n @for (btn of singleActionButtons; track trackByIdx($index)) {\r\n @if (!btn.visible || (btn.visible && btn.visible === true)) {\r\n <lib-generic-button\r\n [icon]=\"btn.icon\"\r\n [label]=\"btn.label | translate\"\r\n [variant]=\"btn.variant\"\r\n [size]=\"btn.size\"\r\n [severity]=\"btn.severity\"\r\n [model]=\"btn.splitActions\"\r\n [permission]=\"btn.permission\"\r\n (clicked)=\"onSingleItemAction(btn)\"\r\n ></lib-generic-button>\r\n }\r\n }\r\n }\r\n\r\n <!-- \u0623\u0632\u0631\u0627\u0631 \u0645\u062A\u0639\u062F\u062F\u0629 \u0627\u0644\u0639\u0646\u0627\u0635\u0631 -->\r\n @if (selectedItems.length > 0) {\r\n @for (btn of bulkActionButtons; track trackByIdx($index)) {\r\n @if (!btn.visible || (btn.visible && btn.visible === true)) {\r\n <lib-generic-button\r\n [icon]=\"btn.icon\"\r\n [label]=\"btn.label | translate\"\r\n [variant]=\"btn.variant\"\r\n [size]=\"btn.size\"\r\n [severity]=\"btn.severity\"\r\n [model]=\"btn.splitActions\"\r\n [permission]=\"btn.permission\"\r\n (clicked)=\"onInternalBulkAction(btn)\"\r\n ></lib-generic-button>\r\n }\r\n }\r\n }\r\n\r\n <!-- \u0623\u0632\u0631\u0627\u0631 \u0627\u0644\u0625\u0636\u0627\u0641\u0629 -->\r\n @for (btn of mergedButtonConfigs; track trackByIdx($index)) {\r\n @if (!btn.visible || (btn.visible && btn.visible === true)) {\r\n <lib-generic-button\r\n [icon]=\"btn.icon\"\r\n [label]=\"btn.label | translate\"\r\n [variant]=\"btn.variant\"\r\n [size]=\"btn.size\"\r\n [severity]=\"btn.severity\"\r\n [model]=\"btn.splitActions\"\r\n [permission]=\"btn.permission\"\r\n (clicked)=\"handleButtonClick(btn)\"\r\n ></lib-generic-button>\r\n }\r\n }\r\n }\r\n </div>\r\n</div>\r\n}\r\n\r\n@if (mode !== 'form-only' && mode !== 'detail') {\r\n<div class=\"mt-2 mb-4 flex items-center justify-between\">\r\n <!-- \u0627\u0644\u0628\u062D\u062B -->\r\n @if (showSearch && filters) {\r\n <lib-generic-search-advanced\r\n [model]=\"filterModel\"\r\n [fields]=\"filters\"\r\n (search)=\"applySearch($event)\"\r\n (paginationChange)=\"paginationChange($event)\"\r\n >\r\n</lib-generic-search-advanced>\r\n } @else {\r\n <div></div>\r\n }\r\n\r\n <!-- \u0623\u062F\u0648\u0627\u062A \u0625\u0636\u0627\u0641\u064A\u0629 -->\r\n <div class=\"flex items-center gap-3 rtl:space-x-reverse\">\r\n\r\n @if (showAdvancedFilter && searchTabs.length > 0) {\r\n <p-button\r\n [icon]=\"advancedFilterIcon\"\r\n [outlined]=\"!isAdvancedFilterVisible\"\r\n severity=\"secondary\"\r\n [pTooltip]=\"'ADVANCED_FILTER' | translate\"\r\n tooltipPosition=\"top\"\r\n (onClick)=\"toggleAdvancedFilter()\"\r\n class=\"hidden sm:inline-flex\"\r\n />\r\n}\r\n <!-- Refresh Button -->\r\n <p-button\r\n icon=\"pi pi-refresh\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"hidden xs:block\"\r\n (onClick)=\"reset()\"\r\n />\r\n\r\n <p-divider layout=\"vertical\" class=\"m-0 p-0 hidden xs:block\" />\r\n\r\n\r\n <!-- <p-button (click)=\"menu.toggle($event)\" class=\"xs:block\" severity=\"secondary\" outlined icon=\"pi pi-ellipsis-v\"/>\r\n <p-menu #menu [model]=\"actions\" [popup]=\"true\" /> -->\r\n\r\n\r\n <!-- Pagination Controls -->\r\n <div class=\"flex items-center gap-1 rtl:space-x-reverse\">\r\n\r\n @if ( showViewMode ) {\r\n<p-selectButton\r\n [options]=\"viewOptions\"\r\n [(ngModel)]=\"viewMode\"\r\n (onChange)=\"onViewChange($event)\"\r\n [unselectable]=\"false\"\r\n optionLabel=\"icon\"\r\n optionValue=\"value\"\r\n\r\n styleClass=\"inline-flex bg-slate-100 dark:bg-slate-800 p-1 rounded-xl border border-slate-200 dark:border-slate-700 shadow-inner\"\r\n>\r\n\r\n <ng-template let-item pTemplate=\"item\">\r\n <div\r\n class=\"flex items-center justify-center rounded-lg transition-all duration-200\"\r\n [ngClass]=\"{\r\n ' dark:bg-slate-600 shadow-sm': viewMode === item.value,\r\n 'text-slate-500 hover:bg-slate-200 dark:hover:bg-slate-700': viewMode !== item.value\r\n }\"\r\n [pTooltip]=\"item.title | translate\"\r\n tooltipPosition=\"top\"\r\n >\r\n <i [class]=\"item.icon\" class=\"text-base\"></i>\r\n </div>\r\n </ng-template>\r\n\r\n</p-selectButton>\r\n }\r\n <p-divider layout=\"vertical\" class=\"m-0 p-0 hidden xs:block\" />\r\n\r\n <!-- First Page Button -->\r\n <p-button\r\n [icon]=\"isRTL ? 'pi pi-angle-double-right' : 'pi pi-angle-double-left'\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"hidden xs:block\"\r\n (click)=\"goFirst()\"\r\n [disabled]=\"isFirstPage()\"\r\n ></p-button>\r\n\r\n <!-- Previous Page Button -->\r\n <p-button\r\n [icon]=\"isRTL ? 'pi pi-chevron-right' : 'pi pi-chevron-left'\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"xs:block\"\r\n (click)=\"goPrev()\"\r\n [disabled]=\"isFirstPage()\"\r\n ></p-button>\r\n\r\n\r\n <!-- Current Page Display with Dropdown -->\r\n <div class=\"relative\">\r\n\r\n <p-button\r\n [label]=\"currentPage + ' / ' + totalPages()\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"hidden xs:block\"\r\n (click)=\"showPageMenu = !showPageMenu\"\r\n pTooltip=\"{{totalRecords}}\"\r\n tooltipPosition=\"top\"\r\n />\r\n\r\n\r\n </div>\r\n <!-- Next Page Button -->\r\n <p-button\r\n [icon]=\"isRTL ? 'pi pi-chevron-left' : 'pi pi-chevron-right'\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"xs:block\"\r\n (click)=\"goNext()\"\r\n [disabled]=\"isLastPage()\"\r\n ></p-button>\r\n\r\n <!-- Last Page Button -->\r\n <p-button\r\n [icon]=\"isRTL ? 'pi pi-angle-double-left' : 'pi pi-angle-double-right'\"\r\n outlined\r\n severity=\"secondary\"\r\n class=\"hidden xs:block\"\r\n (click)=\"goLast()\"\r\n [disabled]=\"isLastPage()\"\r\n ></p-button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n @if (showSearch && showAdvancedFilter && searchTabs.length > 0) {\r\n <div\r\n [ngClass]=\"{\r\n 'block': true,\r\n 'sm:hidden': !isAdvancedFilterVisible,\r\n 'sm:block': isAdvancedFilterVisible\r\n }\"\r\n class=\"animate-fade-in\"\r\n >\r\n <app-tabbed-search\r\n [fields]=\"searchTabs\"\r\n [model]=\"filterModel\"\r\n (onSearch)=\"applySearch($event)\"\r\n (onReset)=\"reset()\"\r\n (paginationChange)=\"paginationChange($event)\">\r\n </app-tabbed-search>\r\n </div>\r\n}\r\n}\r\n" }]
|
|
264
|
+
}], propDecorators: { mode: [{
|
|
265
|
+
type: Input
|
|
266
|
+
}], breadcrumb: [{
|
|
267
|
+
type: Input
|
|
268
|
+
}], isSingleItemSelected: [{
|
|
269
|
+
type: Input
|
|
270
|
+
}], selectedItems: [{
|
|
271
|
+
type: Input
|
|
272
|
+
}], singleActionButtons: [{
|
|
273
|
+
type: Input
|
|
274
|
+
}], bulkActionButtons: [{
|
|
275
|
+
type: Input
|
|
276
|
+
}], addButtonConfigs: [{
|
|
277
|
+
type: Input
|
|
278
|
+
}], mergedButtonConfigs: [{
|
|
279
|
+
type: Input
|
|
280
|
+
}], filters: [{
|
|
281
|
+
type: Input
|
|
282
|
+
}], filterModel: [{
|
|
283
|
+
type: Input
|
|
284
|
+
}], showSearch: [{
|
|
285
|
+
type: Input
|
|
286
|
+
}], first: [{
|
|
287
|
+
type: Input
|
|
288
|
+
}], rows: [{
|
|
289
|
+
type: Input
|
|
290
|
+
}], totalRecords: [{
|
|
291
|
+
type: Input
|
|
292
|
+
}], moduleName: [{
|
|
293
|
+
type: Input
|
|
294
|
+
}], apiName: [{
|
|
295
|
+
type: Input
|
|
296
|
+
}], actions: [{
|
|
297
|
+
type: Input
|
|
298
|
+
}], singleItemAction: [{
|
|
299
|
+
type: Output
|
|
300
|
+
}], bulkAction: [{
|
|
301
|
+
type: Output
|
|
302
|
+
}], search: [{
|
|
303
|
+
type: Output
|
|
304
|
+
}], resetSearch: [{
|
|
305
|
+
type: Output
|
|
306
|
+
}], action: [{
|
|
307
|
+
type: Output
|
|
308
|
+
}], paginateChange: [{
|
|
309
|
+
type: Output
|
|
310
|
+
}], showAdvancedFilter: [{
|
|
311
|
+
type: Input
|
|
312
|
+
}], advancedFilterIcon: [{
|
|
313
|
+
type: Input
|
|
314
|
+
}], searchTabs: [{
|
|
315
|
+
type: Input
|
|
316
|
+
}], showViewMode: [{
|
|
317
|
+
type: Input
|
|
318
|
+
}], viewMode: [{
|
|
319
|
+
type: Input
|
|
320
|
+
}], viewModeChange: [{
|
|
321
|
+
type: Output
|
|
322
|
+
}] } });
|
|
323
|
+
|
|
324
|
+
/* eslint-disable @angular-eslint/no-output-on-prefix */
|
|
325
|
+
/* eslint-disable @angular-eslint/no-output-native */
|
|
326
|
+
/**
|
|
327
|
+
* مكون جدول CRUD عام يمكن إعادة استخدامه
|
|
328
|
+
* يدعم العمليات الأساسية: إنشاء، قراءة، تحديث، حذف
|
|
329
|
+
* مع إمكانية التخصيص عبر عدة أوضاع وعرض
|
|
330
|
+
*/
|
|
331
|
+
class GenericCrudTableComponent {
|
|
332
|
+
genericTable;
|
|
333
|
+
dialog;
|
|
334
|
+
translate = inject(LocalizationService);
|
|
335
|
+
swalService = inject(SwalService);
|
|
336
|
+
queryBuilder = inject(QueryBuilderService);
|
|
337
|
+
dialogService = inject(DialogService);
|
|
338
|
+
home = { icon: 'pi pi-home', routerLink: '/' };
|
|
339
|
+
data = [];
|
|
340
|
+
formFields_ = []; // <-- هنا
|
|
341
|
+
formFields = []; // <-- هنا
|
|
342
|
+
columnFormFields = [];
|
|
343
|
+
columns = []; // <-- هنا
|
|
344
|
+
dialogMaxWidth = '40rem'; // unset , fit-content
|
|
345
|
+
isViewMode = false;
|
|
346
|
+
displayMode = 'drawer';
|
|
347
|
+
useConfirmOnSave = false;
|
|
348
|
+
isEditMode = false;
|
|
349
|
+
drawerVisible = false;
|
|
350
|
+
dialogVisible = false;
|
|
351
|
+
form = new UntypedFormGroup({});
|
|
352
|
+
model;
|
|
353
|
+
model_ = {};
|
|
354
|
+
loading = false;
|
|
355
|
+
errorMsg = '';
|
|
356
|
+
errorMessage = '';
|
|
357
|
+
options = {};
|
|
358
|
+
actions = [];
|
|
359
|
+
/** تحدد طريقة العرض: 'buttons' أو 'menu' */
|
|
360
|
+
actionsMode = 'buttons';
|
|
361
|
+
action = new EventEmitter();
|
|
362
|
+
bulkAction = new EventEmitter();
|
|
363
|
+
singleAction = new EventEmitter();
|
|
364
|
+
beforeSaveTransform; // ⚡ دوال مخصصة قبل الحفظ
|
|
365
|
+
afterSave = new EventEmitter();
|
|
366
|
+
afterDelete = new EventEmitter();
|
|
367
|
+
beforeSave = new EventEmitter();
|
|
368
|
+
beforeDelete = new EventEmitter();
|
|
369
|
+
formCancel = new EventEmitter();
|
|
370
|
+
formInit = new EventEmitter();
|
|
371
|
+
dataLoaded = new EventEmitter();
|
|
372
|
+
selectionChange = new EventEmitter();
|
|
373
|
+
error = new EventEmitter();
|
|
374
|
+
// البحث
|
|
375
|
+
// Search
|
|
376
|
+
filters;
|
|
377
|
+
filterModel = {};
|
|
378
|
+
search = new EventEmitter();
|
|
379
|
+
/** للتحكم بإظهار/إخفاء قسم البحث */
|
|
380
|
+
showSearch = true;
|
|
381
|
+
/** Pagination Inputs */
|
|
382
|
+
first = 0;
|
|
383
|
+
rows = 10;
|
|
384
|
+
totalRecords = 0;
|
|
385
|
+
pageChange = new EventEmitter();
|
|
386
|
+
onSearch = new EventEmitter();
|
|
387
|
+
visibleChange = new EventEmitter();
|
|
388
|
+
;
|
|
389
|
+
// @Output() visibleChange = new EventEmitter<boolean>();
|
|
390
|
+
/** لجعل الجدول قابل لتعديل الصفوف (افتراضي false) */
|
|
391
|
+
rowEditable = false;
|
|
392
|
+
// @Output() visibleChange = new EventEmitter<boolean>();
|
|
393
|
+
/** لجعل الجدول قابل لاختيار الصفوف (افتراضي false) */
|
|
394
|
+
rowSelectable = false;
|
|
395
|
+
/** حدث يخرج الصف المحدّد */
|
|
396
|
+
rowSelect = new EventEmitter();
|
|
397
|
+
selection = null;
|
|
398
|
+
// الفرز
|
|
399
|
+
sortField;
|
|
400
|
+
sortOrder = 1;
|
|
401
|
+
scrollHeight = '400px';
|
|
402
|
+
paginator = true;
|
|
403
|
+
service = inject(BaseService);
|
|
404
|
+
apiName = '';
|
|
405
|
+
moduleName = '';
|
|
406
|
+
idField = 'id';
|
|
407
|
+
showRowSelectionCheckbox = false;
|
|
408
|
+
showAddButton = true;
|
|
409
|
+
showPrintButton = true;
|
|
410
|
+
PermissionName;
|
|
411
|
+
mergedButtonConfigs = [];
|
|
412
|
+
addButtonConfigs = [];
|
|
413
|
+
buildButtons() {
|
|
414
|
+
const fixedButtons = [
|
|
415
|
+
{
|
|
416
|
+
icon: 'pi pi-plus',
|
|
417
|
+
label: 'ADD',
|
|
418
|
+
variant: 'raised',
|
|
419
|
+
severity: 'primary',
|
|
420
|
+
size: 'small',
|
|
421
|
+
actionName: 'add',
|
|
422
|
+
visible: this.showAddButton,
|
|
423
|
+
permission: `${this.PermissionName}:AD`,
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
icon: 'pi pi-print',
|
|
427
|
+
label: 'PRINT',
|
|
428
|
+
variant: 'raised',
|
|
429
|
+
severity: 'secondary',
|
|
430
|
+
size: 'small',
|
|
431
|
+
actionName: 'print',
|
|
432
|
+
visible: this.showPrintButton,
|
|
433
|
+
permission: `${this.PermissionName}:PR`,
|
|
434
|
+
action: async () => {
|
|
435
|
+
this.openReportDialog();
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
];
|
|
439
|
+
this.mergedButtonConfigs = [
|
|
440
|
+
...fixedButtons,
|
|
441
|
+
...(this.addButtonConfigs || []),
|
|
442
|
+
];
|
|
443
|
+
}
|
|
444
|
+
createEditActions = [
|
|
445
|
+
{
|
|
446
|
+
icon: 'pi pi-check',
|
|
447
|
+
label: 'SAVE',
|
|
448
|
+
variant: 'raised',
|
|
449
|
+
severity: 'primary',
|
|
450
|
+
size: 'small',
|
|
451
|
+
actionName: 'save',
|
|
452
|
+
type: 'submit',
|
|
453
|
+
splitActions: [
|
|
454
|
+
{
|
|
455
|
+
label: this.translate.instant('SAVE_AND_ADD'),
|
|
456
|
+
icon: 'pi pi-save',
|
|
457
|
+
actionName: 'saveAndAdd'
|
|
458
|
+
}
|
|
459
|
+
]
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
icon: 'pi pi-times',
|
|
463
|
+
label: 'CANCEL',
|
|
464
|
+
variant: 'raised',
|
|
465
|
+
severity: 'danger',
|
|
466
|
+
size: 'small',
|
|
467
|
+
actionName: 'cancel',
|
|
468
|
+
type: 'button',
|
|
469
|
+
},
|
|
470
|
+
];
|
|
471
|
+
supportSubPage = true;
|
|
472
|
+
tabs = [];
|
|
473
|
+
bulkActionButtons = [];
|
|
474
|
+
singleActionButtons = [];
|
|
475
|
+
_selectedRows = [];
|
|
476
|
+
get isSingleItemSelected() {
|
|
477
|
+
return this._selectedRows.length === 1;
|
|
478
|
+
}
|
|
479
|
+
get isMultipleItemSelected() {
|
|
480
|
+
return this._selectedRows.length > 1;
|
|
481
|
+
}
|
|
482
|
+
get selectedItems() {
|
|
483
|
+
return this._selectedRows;
|
|
484
|
+
}
|
|
485
|
+
breadcrumb;
|
|
486
|
+
get breadcrumb_() {
|
|
487
|
+
return this.breadcrumb?.map(v => ({
|
|
488
|
+
...v,
|
|
489
|
+
label: this.translate.instant(v.label ?? '')
|
|
490
|
+
}));
|
|
491
|
+
}
|
|
492
|
+
get rtl() {
|
|
493
|
+
try {
|
|
494
|
+
return document?.documentElement?.dir === 'rtl';
|
|
495
|
+
}
|
|
496
|
+
catch (error) {
|
|
497
|
+
return true;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Modes to control what parts of the component are visible
|
|
502
|
+
* - 'full': Table + CRUD operations (default)
|
|
503
|
+
* - 'form-only': Only show form (for create/edit/view)
|
|
504
|
+
* - 'table-only': Only show table (read-only mode)
|
|
505
|
+
*/
|
|
506
|
+
mode = 'full';
|
|
507
|
+
/** Force the component to show specific state */
|
|
508
|
+
forceState = null;
|
|
509
|
+
/** Hide table completely when in form-only mode */
|
|
510
|
+
get hideTable() {
|
|
511
|
+
return (this.mode === 'form-only' || this.mode === 'detail' || (this.forceState && this.mode !== 'table-only')) ?? false;
|
|
512
|
+
}
|
|
513
|
+
/** Auto-show form when in form-only mode with forceState */
|
|
514
|
+
get autoShowForm() {
|
|
515
|
+
return this.mode === 'form-only' && !!this.forceState;
|
|
516
|
+
}
|
|
517
|
+
//لتغيير لون صف معيّن
|
|
518
|
+
rowStyleFn;
|
|
519
|
+
// ✅ لتعيين كلاس CSS أو Tailwind على الصف
|
|
520
|
+
rowClassFn;
|
|
521
|
+
//آخر لتجميد / تعطيل checkbox الاختيار
|
|
522
|
+
disableRowCheckboxFn;
|
|
523
|
+
tableClass = 'h-full flex-1 flex flex-col overflow-y-auto border border-surface rounded-2xl xs:rounded-2xl p-4 bg-white';
|
|
524
|
+
// 🟢 Inputs الجديدة
|
|
525
|
+
showAdvancedFilter = false; // متغير للتحكم في ظهور الزر
|
|
526
|
+
advancedFilterIcon = 'pi pi-filter-fill'; // أيقونة اختيارية
|
|
527
|
+
// 🟢 الحالة الخاصة بالفلتر المتقدم
|
|
528
|
+
// أضف هذا الـ Input
|
|
529
|
+
searchTabs = []; // مصفوفة التبويبات
|
|
530
|
+
// 🟢 ميزة تبديل العرض
|
|
531
|
+
showViewMode = false;
|
|
532
|
+
viewMode = 'table';
|
|
533
|
+
viewModeChange = new EventEmitter();
|
|
534
|
+
// 🟢 Outputs
|
|
535
|
+
templateSelected = new EventEmitter();
|
|
536
|
+
templateDrawerVisible = false;
|
|
537
|
+
templateDrawerVisibleChange = new EventEmitter();
|
|
538
|
+
category = '';
|
|
539
|
+
feature = '';
|
|
540
|
+
onViewModeChange(mode) {
|
|
541
|
+
this.viewMode = mode;
|
|
542
|
+
this.viewModeChange.emit(mode);
|
|
543
|
+
// هنا يمكنك إضافة منطق إضافي إذا أردت تغيير طريقة عرض البيانات فوراً
|
|
544
|
+
}
|
|
545
|
+
route = inject(ActivatedRoute);
|
|
546
|
+
router = inject(Router);
|
|
547
|
+
currentId;
|
|
548
|
+
ngOnInit() {
|
|
549
|
+
if (this.moduleName) {
|
|
550
|
+
this.service.moduleName = this.moduleName;
|
|
551
|
+
}
|
|
552
|
+
if (this.apiName && this.apiName != '') {
|
|
553
|
+
this.service.apiName = this.apiName;
|
|
554
|
+
}
|
|
555
|
+
if (this.tabs.length == 0) {
|
|
556
|
+
this.formFields_ = this.formFields;
|
|
557
|
+
this.tabs.push({ header: 'التفاصيل', icon: 'pi pi-info-circle', fields: this.formFields_, model: this.model });
|
|
558
|
+
}
|
|
559
|
+
if (this.supportSubPage) {
|
|
560
|
+
this.route.paramMap.subscribe(params => {
|
|
561
|
+
const id = params.get(this.idField);
|
|
562
|
+
if (id && id !== 'new' && id !== 'create' && id !== 'add') {
|
|
563
|
+
this.currentId = id;
|
|
564
|
+
this.mode = 'detail';
|
|
565
|
+
this.loadDetail(id);
|
|
566
|
+
}
|
|
567
|
+
else if (id == 'new' || id == 'create' || id == 'add') {
|
|
568
|
+
this.mode = 'detail';
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
this.currentId = undefined;
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
this.buildButtons();
|
|
576
|
+
}
|
|
577
|
+
// 3. Handle Header's Paginate Change Event
|
|
578
|
+
onHeaderPaginateChange(event) {
|
|
579
|
+
this.first = event.first; // Update the 'first' index
|
|
580
|
+
this.rows = event.rows;
|
|
581
|
+
const lazyLoadEvent = {
|
|
582
|
+
first: this.first,
|
|
583
|
+
rows: this.rows,
|
|
584
|
+
// You'd typically include current sorting and filtering state here
|
|
585
|
+
sortField: this.sortField,
|
|
586
|
+
sortOrder: 1,
|
|
587
|
+
filters: this.filters,
|
|
588
|
+
globalFilter: null, // or your current global filter value
|
|
589
|
+
};
|
|
590
|
+
this.onLazyLoad(lazyLoadEvent);
|
|
591
|
+
}
|
|
592
|
+
loadDetail(id) {
|
|
593
|
+
this.service.get(id).subscribe({
|
|
594
|
+
next: res => {
|
|
595
|
+
this.model = res;
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
// Helper method to open form programmatically
|
|
600
|
+
openForm(mode, model) {
|
|
601
|
+
this.dialog.openForm(mode, model);
|
|
602
|
+
}
|
|
603
|
+
// private destroy$ = new Subject<void>();
|
|
604
|
+
/** الآن يتلقّى pagination + sort في حدث واحد */
|
|
605
|
+
onLazyLoad(event) {
|
|
606
|
+
// this.model_= this.model ?? {};
|
|
607
|
+
this.model = this.model ?? {};
|
|
608
|
+
this.formFields_ = this.formFields;
|
|
609
|
+
const first = event.first ?? this.first;
|
|
610
|
+
const rows = event.rows ?? this.rows;
|
|
611
|
+
const sortField = typeof event.sortField === 'string'
|
|
612
|
+
? event.sortField
|
|
613
|
+
: this.sortField;
|
|
614
|
+
const sortOrder = event.sortOrder === -1 ? -1 : 1;
|
|
615
|
+
const filters = {};
|
|
616
|
+
if (event.filters) {
|
|
617
|
+
Object.entries(event.filters).forEach(([field, meta]) => {
|
|
618
|
+
const value = meta.value;
|
|
619
|
+
if (value != null && value !== '') {
|
|
620
|
+
filters[field] = value;
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
var queryString = '';
|
|
625
|
+
// Default query
|
|
626
|
+
if (!filters['query']) {
|
|
627
|
+
// Use the new QueryBuilderService methods
|
|
628
|
+
const odataParams = this.queryBuilder.buildODataFromQueryModel(this.filterModel, this.formFields_);
|
|
629
|
+
// this.odataSearch.emit(odataParams);
|
|
630
|
+
// Generate query string using the unified method
|
|
631
|
+
queryString = this.queryBuilder.toODataQueryString(odataParams);
|
|
632
|
+
// console.log('OData Query String:', queryString);
|
|
633
|
+
}
|
|
634
|
+
this.first = first;
|
|
635
|
+
this.rows = rows;
|
|
636
|
+
this.sortField = sortField;
|
|
637
|
+
this.sortOrder = sortOrder;
|
|
638
|
+
const dir = sortOrder === 1 ? 'asc' : 'desc';
|
|
639
|
+
const sort = sortField ? `${sortField} ${dir}` : undefined;
|
|
640
|
+
// this.pageChange.emit({ first, rows ,sort, filters });
|
|
641
|
+
this.applySearch({
|
|
642
|
+
filter: this.model['filter'],
|
|
643
|
+
query: queryString,
|
|
644
|
+
sorting: sort,
|
|
645
|
+
skipCount: first,
|
|
646
|
+
maxResultCount: rows,
|
|
647
|
+
});
|
|
648
|
+
// يبني النص وإرساله
|
|
649
|
+
}
|
|
650
|
+
/** تصيير البيانات حسب الصفحة */
|
|
651
|
+
get pagedData() {
|
|
652
|
+
// return this.data ? this.data.slice(this.first, this.first + this.rows) : [];
|
|
653
|
+
return this.data;
|
|
654
|
+
}
|
|
655
|
+
get globalFilterFields() {
|
|
656
|
+
return this.columns.map(c => String(c.key));
|
|
657
|
+
}
|
|
658
|
+
/** أرسل إلى الأب لأتمتة شكل البحث إذا يحتاج */
|
|
659
|
+
// from generic-crud-table.component.ts
|
|
660
|
+
/** بدّل applySearch لتبث pageChange مباشرةً */
|
|
661
|
+
resetPage(filters) {
|
|
662
|
+
// this.genericTable.applyFilter(global);
|
|
663
|
+
this.first = 0;
|
|
664
|
+
this.rows = 10;
|
|
665
|
+
}
|
|
666
|
+
/** بدّل applySearch لتبث pageChange مباشرةً */
|
|
667
|
+
applySearch(filters) {
|
|
668
|
+
// this.genericTable.applyFilter(global);
|
|
669
|
+
this.onSearch.emit(filters);
|
|
670
|
+
}
|
|
671
|
+
/** دالة تنفّذ عند النقر على صف */
|
|
672
|
+
onRowClick(row) {
|
|
673
|
+
if (this.rowSelectable) {
|
|
674
|
+
this.rowSelect.emit(row);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
onSubmit() {
|
|
678
|
+
if (this.mode != 'form-only') {
|
|
679
|
+
this.applySearch('');
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
trackByIdx(index, item) {
|
|
683
|
+
return index;
|
|
684
|
+
}
|
|
685
|
+
onSingleItemAction(btn) {
|
|
686
|
+
if (!this.isSingleItemSelected)
|
|
687
|
+
return;
|
|
688
|
+
const selectedItem = this._selectedRows[0];
|
|
689
|
+
this.singleAction.emit({
|
|
690
|
+
name: btn.actionName ?? 'singleAction',
|
|
691
|
+
item: selectedItem
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
onInternalBulkAction(btn) {
|
|
695
|
+
if (!this.isMultipleItemSelected)
|
|
696
|
+
return;
|
|
697
|
+
this.bulkAction.emit({
|
|
698
|
+
name: btn.actionName ?? 'bulkAction',
|
|
699
|
+
items: [...this._selectedRows] // نرسل نسخة من المصفوفة
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
openReportDialog() {
|
|
703
|
+
const ref = this.dialogService.open(GenericReportComponent, {
|
|
704
|
+
header: this.translate.instant('REPORT'),
|
|
705
|
+
showHeader: false,
|
|
706
|
+
width: '90%',
|
|
707
|
+
height: 'auto',
|
|
708
|
+
modal: true,
|
|
709
|
+
focusOnShow: false,
|
|
710
|
+
data: {
|
|
711
|
+
apiName: this.apiName,
|
|
712
|
+
moduleName: this.moduleName,
|
|
713
|
+
filterFields: this.filters,
|
|
714
|
+
filterModel: { /* status: 'Active' */},
|
|
715
|
+
defaultFileName: this.translate.instant('REPORT') + ' ' + this.translate.instant(this.breadcrumb?.length ? this.breadcrumb[this.breadcrumb.length - 1].label ?? '' : '')
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
ref?.onClose.subscribe((exportConfig) => {
|
|
719
|
+
if (exportConfig) {
|
|
720
|
+
console.log('Export configuration:', exportConfig);
|
|
721
|
+
// Handle the export - call your API service here
|
|
722
|
+
this.handleExport(exportConfig);
|
|
723
|
+
}
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
handleExport(config) {
|
|
727
|
+
// Your export logic here
|
|
728
|
+
// if (config.exportType === 'EXCEL') {
|
|
729
|
+
// this.exportToExcel(config);
|
|
730
|
+
// } else if (config.exportType === 'PDF') {
|
|
731
|
+
// this.exportToPdf(config);
|
|
732
|
+
// }
|
|
733
|
+
// etc.
|
|
734
|
+
}
|
|
735
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: GenericCrudTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
736
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: GenericCrudTableComponent, isStandalone: true, selector: "app-generic-crud-table", inputs: { data: "data", formFields: "formFields", columnFormFields: "columnFormFields", columns: "columns", dialogMaxWidth: "dialogMaxWidth", isViewMode: "isViewMode", displayMode: "displayMode", useConfirmOnSave: "useConfirmOnSave", isEditMode: "isEditMode", drawerVisible: "drawerVisible", dialogVisible: "dialogVisible", model: "model", loading: "loading", errorMsg: "errorMsg", errorMessage: "errorMessage", actions: "actions", actionsMode: "actionsMode", beforeSaveTransform: "beforeSaveTransform", filters: "filters", filterModel: "filterModel", showSearch: "showSearch", first: "first", rows: "rows", totalRecords: "totalRecords", rowEditable: "rowEditable", rowSelectable: "rowSelectable", scrollHeight: "scrollHeight", paginator: "paginator", service: "service", apiName: "apiName", moduleName: "moduleName", idField: "idField", showRowSelectionCheckbox: "showRowSelectionCheckbox", showAddButton: "showAddButton", showPrintButton: "showPrintButton", PermissionName: "PermissionName", addButtonConfigs: "addButtonConfigs", createEditActions: "createEditActions", supportSubPage: "supportSubPage", tabs: "tabs", bulkActionButtons: "bulkActionButtons", singleActionButtons: "singleActionButtons", breadcrumb: "breadcrumb", mode: "mode", forceState: "forceState", hideTable: "hideTable", autoShowForm: "autoShowForm", rowStyleFn: "rowStyleFn", rowClassFn: "rowClassFn", disableRowCheckboxFn: "disableRowCheckboxFn", showAdvancedFilter: "showAdvancedFilter", advancedFilterIcon: "advancedFilterIcon", searchTabs: "searchTabs", showViewMode: "showViewMode", viewMode: "viewMode", templateDrawerVisible: "templateDrawerVisible", category: "category", feature: "feature" }, outputs: { action: "action", bulkAction: "bulkAction", singleAction: "singleAction", afterSave: "afterSave", afterDelete: "afterDelete", beforeSave: "beforeSave", beforeDelete: "beforeDelete", formCancel: "formCancel", formInit: "formInit", dataLoaded: "dataLoaded", selectionChange: "selectionChange", error: "error", search: "search", pageChange: "pageChange", onSearch: "onSearch", visibleChange: "visibleChange", rowSelect: "rowSelect", viewModeChange: "viewModeChange", templateSelected: "templateSelected", templateDrawerVisibleChange: "templateDrawerVisibleChange" }, viewQueries: [{ propertyName: "genericTable", first: true, predicate: ["genericTable"], descendants: true }, { propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true }], ngImport: i0, template: "<div\r\n [class]=\"mode !== 'form-only' && mode !== 'detail' ? tableClass : ''\"\r\n>\r\n <app-generic-crud-header\r\n [mode]=\"mode\"\r\n [breadcrumb]=\"breadcrumb_\"\r\n [isSingleItemSelected]=\"isSingleItemSelected\"\r\n [selectedItems]=\"_selectedRows\"\r\n [singleActionButtons]=\"singleActionButtons\"\r\n [bulkActionButtons]=\"bulkActionButtons\"\r\n [addButtonConfigs]=\"addButtonConfigs\"\r\n [mergedButtonConfigs]=\"mergedButtonConfigs\"\r\n [apiName]=\"service.apiName\"\r\n [moduleName]=\"service.moduleName\"\r\n [filters]=\"filters\"\r\n [filterModel]=\"filterModel\"\r\n [showSearch]=\"showSearch\"\r\n (singleItemAction)=\"onSingleItemAction($event)\"\r\n (bulkAction)=\"onInternalBulkAction($event)\"\r\n (action)=\"action.emit($event)\"\r\n (search)=\"resetPage($event);applySearch($event);\"\r\n (resetSearch)=\"resetPage($event);applySearch('');\"\r\n (paginateChange)=\"onHeaderPaginateChange($event)\"\r\n [first]=\"first\"\r\n [rows]=\"rows\"\r\n [totalRecords]=\"totalRecords\"\r\n [searchTabs]=\"searchTabs\"\r\n [showAdvancedFilter]=\"showAdvancedFilter\"\r\n [advancedFilterIcon]=\"advancedFilterIcon\"\r\n [showViewMode]=\"showViewMode\"\r\n [viewMode]=\"viewMode\"\r\n (viewModeChange)=\"onViewModeChange($event)\"\r\n/>\r\n\r\n @if (!hideTable) {\r\n <lib-generic-table\r\n [data]=\"data\"\r\n [columns]=\"columns\"\r\n [columnFormFields]=\"columnFormFields\"\r\n [paginator]=\"paginator\"\r\n [loading]=\"loading\"\r\n [actions]=\"actions\"\r\n [actionsMode]=\"actionsMode\"\r\n [first]=\"first\"\r\n [rows]=\"rows\"\r\n [totalRecords]=\"totalRecords\"\r\n [sortField]=\"sortField\"\r\n [sortOrder]=\"sortOrder\"\r\n [addButtonConfigs]=\"addButtonConfigs\"\r\n [globalFilterFields]=\"globalFilterFields\"\r\n [scrollHeight]=\"scrollHeight\"\r\n [showRowSelectionCheckbox]=\"showRowSelectionCheckbox\"\r\n (action)=\"action.emit($event)\"\r\n (onAddNew)=\"action.emit($event)\"\r\n (pageChange)=\"onLazyLoad($event)\"\r\n [rowSelectable]=\"rowSelectable\"\r\n [rowEditable]=\"rowEditable\"\r\n (rowSelect)=\"onRowClick($event)\"\r\n [(selection)]=\"_selectedRows\"\r\n #genericTable\r\n ></lib-generic-table>\r\n\r\n }\r\n\r\n <app-generic-dialog\r\n #dialog\r\n [service]=\"service\"\r\n [formFields]=\"formFields\"\r\n [model]=\"model\"\r\n [apiName]=\"service.apiName\"\r\n [moduleName]=\"service.moduleName\"\r\n [idField]=\"idField\"\r\n [dialogMaxWidth]=\"dialogMaxWidth\"\r\n [displayMode]=\"displayMode\"\r\n [mode]=\"mode\"\r\n [forceState]=\"forceState\"\r\n [drawerVisible]=\"drawerVisible\"\r\n [dialogVisible]=\"dialogVisible\"\r\n [isViewMode]=\"isViewMode\"\r\n [isEditMode]=\"isEditMode\"\r\n [useConfirmOnSave]=\"useConfirmOnSave\"\r\n [loading]=\"loading\"\r\n [errorMsg]=\"errorMsg\"\r\n [errorMessage]=\"errorMessage\"\r\n [beforeSaveTransform]=\"beforeSaveTransform\"\r\n (action)=\"action.emit($event)\"\r\n (afterSave)=\"afterSave.emit($event);onSubmit();\"\r\n (afterDelete)=\"afterDelete.emit($event)\"\r\n (beforeSave)=\"beforeSave.emit($event)\"\r\n (beforeDelete)=\"beforeDelete.emit($event)\"\r\n (formCancel)=\"formCancel.emit()\"\r\n (formInit)=\"formInit.emit($event)\"\r\n (dataLoaded)=\"dataLoaded.emit($event)\"\r\n (selectionChange)=\"selectionChange.emit($event)\"\r\n (error)=\"error.emit($event)\"\r\n (visibleChange)=\"visibleChange.emit($event)\"\r\n >\r\n </app-generic-dialog>\r\n\r\n <app-detail-view\r\n [displayMode]=\"displayMode\"\r\n [mode]=\"mode\"\r\n [title]=\"breadcrumb_?.[0]?.label || 'Detail'\"\r\n [service]=\"service\"\r\n [apiName]=\"service.apiName\"\r\n [moduleName]=\"service.moduleName\"\r\n [idField]=\"idField\"\r\n [actions]=\"actions\"\r\n [formFields]=\"formFields\"\r\n [model]=\"model\"\r\n [tabs]=\"tabs\"\r\n [loading]=\"loading\"\r\n [breadcrumb]=\"breadcrumb_\"\r\n [createEditActions]=\"createEditActions\"\r\n (action)=\"action.emit($event)\"\r\n >\r\n </app-detail-view>\r\n\r\n <!-- \uD83D\uDFE2 \u0645\u0643\u0648\u0646 \u062F\u0631\u062C \u0627\u0644\u0642\u0648\u0627\u0644\u0628 \u0627\u0644\u0645\u062D\u0641\u0648\u0638\u0629 -->\r\n<!-- <saved-report-templates-drawer\r\n [(visible)]=\"templateDrawerVisible\"\r\n (visibleChange)=\"templateDrawerVisibleChange.emit($event)\"\r\n [filterFields]=\"filters\"\r\n [service]=\"service.moduleName\"\r\n [category]=\"category\"\r\n [feature]=\"feature\"\r\n (templateSelected)=\"templateSelected.emit($event)\">\r\n</saved-report-templates-drawer> -->\r\n\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: TableModule }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: GenericTable, selector: "lib-generic-table", inputs: ["data", "columns", "columnFormFields", "loading", "actions", "actionsPosition", "actionsMode", "first", "rows", "totalRecords", "sortField", "sortOrder", "globalFilterFields", "addButtonConfigs", "scrollHeight", "rowEditable", "rowSelectable", "selection", "dataKey", "paginator", "showRowSelectionCheckbox"], outputs: ["action", "pageChange", "onAddNew", "rowSelect", "selectionChange"] }, { kind: "ngmodule", type: ToolbarModule }, { kind: "ngmodule", type: DividerModule }, { kind: "ngmodule", type: IconFieldModule }, { kind: "ngmodule", type: DrawerModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: MessageModule }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: GenericDialogComponent, selector: "app-generic-dialog", inputs: ["form", "service", "formFields", "model", "apiName", "moduleName", "idField", "dialogMaxWidth", "displayMode", "mode", "forceState", "drawerVisible", "dialogVisible", "isViewMode", "isEditMode", "useConfirmOnSave", "loading", "errorMsg", "errorMessage", "beforeSaveTransform", "hideTable", "autoShowForm"], outputs: ["action", "afterSave", "afterDelete", "beforeSave", "beforeDelete", "formCancel", "formInit", "dataLoaded", "selectionChange", "error", "visibleChange"] }, { kind: "component", type: GenericCrudHeaderComponent, selector: "app-generic-crud-header", inputs: ["mode", "breadcrumb", "isSingleItemSelected", "selectedItems", "singleActionButtons", "bulkActionButtons", "addButtonConfigs", "mergedButtonConfigs", "filters", "filterModel", "showSearch", "first", "rows", "totalRecords", "moduleName", "apiName", "actions", "showAdvancedFilter", "advancedFilterIcon", "searchTabs", "showViewMode", "viewMode"], outputs: ["singleItemAction", "bulkAction", "search", "resetSearch", "action", "paginateChange", "viewModeChange"] }, { kind: "component", type: GenericViewComponent, selector: "app-detail-view", inputs: ["title", "actions", "createEditActions", "tabs", "viewMode", "breadcrumb", "service", "formFields", "apiName", "moduleName", "idField", "standaloneMode", "isViewMode", "isCreateMode", "isEditMode", "model", "displayMode", "mode", "loading"], outputs: ["action", "afterDelete"] }] });
|
|
737
|
+
}
|
|
738
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: GenericCrudTableComponent, decorators: [{
|
|
739
|
+
type: Component,
|
|
740
|
+
args: [{ selector: 'app-generic-crud-table', standalone: true, imports: [
|
|
741
|
+
TableModule,
|
|
742
|
+
ButtonModule,
|
|
743
|
+
GenericTable,
|
|
744
|
+
ToolbarModule,
|
|
745
|
+
TranslatePipe,
|
|
746
|
+
DividerModule,
|
|
747
|
+
IconFieldModule,
|
|
748
|
+
DrawerModule,
|
|
749
|
+
ReactiveFormsModule,
|
|
750
|
+
FormsModule,
|
|
751
|
+
MessageModule,
|
|
752
|
+
DialogModule,
|
|
753
|
+
GenericDialogComponent,
|
|
754
|
+
GenericCrudHeaderComponent,
|
|
755
|
+
GenericViewComponent,
|
|
756
|
+
// SavedReportTemplatesDrawerComponent
|
|
757
|
+
], host: {
|
|
758
|
+
class: ''
|
|
759
|
+
}, template: "<div\r\n [class]=\"mode !== 'form-only' && mode !== 'detail' ? tableClass : ''\"\r\n>\r\n <app-generic-crud-header\r\n [mode]=\"mode\"\r\n [breadcrumb]=\"breadcrumb_\"\r\n [isSingleItemSelected]=\"isSingleItemSelected\"\r\n [selectedItems]=\"_selectedRows\"\r\n [singleActionButtons]=\"singleActionButtons\"\r\n [bulkActionButtons]=\"bulkActionButtons\"\r\n [addButtonConfigs]=\"addButtonConfigs\"\r\n [mergedButtonConfigs]=\"mergedButtonConfigs\"\r\n [apiName]=\"service.apiName\"\r\n [moduleName]=\"service.moduleName\"\r\n [filters]=\"filters\"\r\n [filterModel]=\"filterModel\"\r\n [showSearch]=\"showSearch\"\r\n (singleItemAction)=\"onSingleItemAction($event)\"\r\n (bulkAction)=\"onInternalBulkAction($event)\"\r\n (action)=\"action.emit($event)\"\r\n (search)=\"resetPage($event);applySearch($event);\"\r\n (resetSearch)=\"resetPage($event);applySearch('');\"\r\n (paginateChange)=\"onHeaderPaginateChange($event)\"\r\n [first]=\"first\"\r\n [rows]=\"rows\"\r\n [totalRecords]=\"totalRecords\"\r\n [searchTabs]=\"searchTabs\"\r\n [showAdvancedFilter]=\"showAdvancedFilter\"\r\n [advancedFilterIcon]=\"advancedFilterIcon\"\r\n [showViewMode]=\"showViewMode\"\r\n [viewMode]=\"viewMode\"\r\n (viewModeChange)=\"onViewModeChange($event)\"\r\n/>\r\n\r\n @if (!hideTable) {\r\n <lib-generic-table\r\n [data]=\"data\"\r\n [columns]=\"columns\"\r\n [columnFormFields]=\"columnFormFields\"\r\n [paginator]=\"paginator\"\r\n [loading]=\"loading\"\r\n [actions]=\"actions\"\r\n [actionsMode]=\"actionsMode\"\r\n [first]=\"first\"\r\n [rows]=\"rows\"\r\n [totalRecords]=\"totalRecords\"\r\n [sortField]=\"sortField\"\r\n [sortOrder]=\"sortOrder\"\r\n [addButtonConfigs]=\"addButtonConfigs\"\r\n [globalFilterFields]=\"globalFilterFields\"\r\n [scrollHeight]=\"scrollHeight\"\r\n [showRowSelectionCheckbox]=\"showRowSelectionCheckbox\"\r\n (action)=\"action.emit($event)\"\r\n (onAddNew)=\"action.emit($event)\"\r\n (pageChange)=\"onLazyLoad($event)\"\r\n [rowSelectable]=\"rowSelectable\"\r\n [rowEditable]=\"rowEditable\"\r\n (rowSelect)=\"onRowClick($event)\"\r\n [(selection)]=\"_selectedRows\"\r\n #genericTable\r\n ></lib-generic-table>\r\n\r\n }\r\n\r\n <app-generic-dialog\r\n #dialog\r\n [service]=\"service\"\r\n [formFields]=\"formFields\"\r\n [model]=\"model\"\r\n [apiName]=\"service.apiName\"\r\n [moduleName]=\"service.moduleName\"\r\n [idField]=\"idField\"\r\n [dialogMaxWidth]=\"dialogMaxWidth\"\r\n [displayMode]=\"displayMode\"\r\n [mode]=\"mode\"\r\n [forceState]=\"forceState\"\r\n [drawerVisible]=\"drawerVisible\"\r\n [dialogVisible]=\"dialogVisible\"\r\n [isViewMode]=\"isViewMode\"\r\n [isEditMode]=\"isEditMode\"\r\n [useConfirmOnSave]=\"useConfirmOnSave\"\r\n [loading]=\"loading\"\r\n [errorMsg]=\"errorMsg\"\r\n [errorMessage]=\"errorMessage\"\r\n [beforeSaveTransform]=\"beforeSaveTransform\"\r\n (action)=\"action.emit($event)\"\r\n (afterSave)=\"afterSave.emit($event);onSubmit();\"\r\n (afterDelete)=\"afterDelete.emit($event)\"\r\n (beforeSave)=\"beforeSave.emit($event)\"\r\n (beforeDelete)=\"beforeDelete.emit($event)\"\r\n (formCancel)=\"formCancel.emit()\"\r\n (formInit)=\"formInit.emit($event)\"\r\n (dataLoaded)=\"dataLoaded.emit($event)\"\r\n (selectionChange)=\"selectionChange.emit($event)\"\r\n (error)=\"error.emit($event)\"\r\n (visibleChange)=\"visibleChange.emit($event)\"\r\n >\r\n </app-generic-dialog>\r\n\r\n <app-detail-view\r\n [displayMode]=\"displayMode\"\r\n [mode]=\"mode\"\r\n [title]=\"breadcrumb_?.[0]?.label || 'Detail'\"\r\n [service]=\"service\"\r\n [apiName]=\"service.apiName\"\r\n [moduleName]=\"service.moduleName\"\r\n [idField]=\"idField\"\r\n [actions]=\"actions\"\r\n [formFields]=\"formFields\"\r\n [model]=\"model\"\r\n [tabs]=\"tabs\"\r\n [loading]=\"loading\"\r\n [breadcrumb]=\"breadcrumb_\"\r\n [createEditActions]=\"createEditActions\"\r\n (action)=\"action.emit($event)\"\r\n >\r\n </app-detail-view>\r\n\r\n <!-- \uD83D\uDFE2 \u0645\u0643\u0648\u0646 \u062F\u0631\u062C \u0627\u0644\u0642\u0648\u0627\u0644\u0628 \u0627\u0644\u0645\u062D\u0641\u0648\u0638\u0629 -->\r\n<!-- <saved-report-templates-drawer\r\n [(visible)]=\"templateDrawerVisible\"\r\n (visibleChange)=\"templateDrawerVisibleChange.emit($event)\"\r\n [filterFields]=\"filters\"\r\n [service]=\"service.moduleName\"\r\n [category]=\"category\"\r\n [feature]=\"feature\"\r\n (templateSelected)=\"templateSelected.emit($event)\">\r\n</saved-report-templates-drawer> -->\r\n\r\n</div>\r\n" }]
|
|
760
|
+
}], propDecorators: { genericTable: [{
|
|
761
|
+
type: ViewChild,
|
|
762
|
+
args: ['genericTable']
|
|
763
|
+
}], dialog: [{
|
|
764
|
+
type: ViewChild,
|
|
765
|
+
args: ['dialog']
|
|
766
|
+
}], data: [{
|
|
767
|
+
type: Input
|
|
768
|
+
}], formFields: [{
|
|
769
|
+
type: Input
|
|
770
|
+
}], columnFormFields: [{
|
|
771
|
+
type: Input
|
|
772
|
+
}], columns: [{
|
|
773
|
+
type: Input
|
|
774
|
+
}], dialogMaxWidth: [{
|
|
775
|
+
type: Input
|
|
776
|
+
}], isViewMode: [{
|
|
777
|
+
type: Input
|
|
778
|
+
}], displayMode: [{
|
|
779
|
+
type: Input
|
|
780
|
+
}], useConfirmOnSave: [{
|
|
781
|
+
type: Input
|
|
782
|
+
}], isEditMode: [{
|
|
783
|
+
type: Input
|
|
784
|
+
}], drawerVisible: [{
|
|
785
|
+
type: Input
|
|
786
|
+
}], dialogVisible: [{
|
|
787
|
+
type: Input
|
|
788
|
+
}], model: [{
|
|
789
|
+
type: Input
|
|
790
|
+
}], loading: [{
|
|
791
|
+
type: Input
|
|
792
|
+
}], errorMsg: [{
|
|
793
|
+
type: Input
|
|
794
|
+
}], errorMessage: [{
|
|
795
|
+
type: Input
|
|
796
|
+
}], actions: [{
|
|
797
|
+
type: Input
|
|
798
|
+
}], actionsMode: [{
|
|
799
|
+
type: Input
|
|
800
|
+
}], action: [{
|
|
801
|
+
type: Output
|
|
802
|
+
}], bulkAction: [{
|
|
803
|
+
type: Output
|
|
804
|
+
}], singleAction: [{
|
|
805
|
+
type: Output
|
|
806
|
+
}], beforeSaveTransform: [{
|
|
807
|
+
type: Input
|
|
808
|
+
}], afterSave: [{
|
|
809
|
+
type: Output
|
|
810
|
+
}], afterDelete: [{
|
|
811
|
+
type: Output
|
|
812
|
+
}], beforeSave: [{
|
|
813
|
+
type: Output
|
|
814
|
+
}], beforeDelete: [{
|
|
815
|
+
type: Output
|
|
816
|
+
}], formCancel: [{
|
|
817
|
+
type: Output
|
|
818
|
+
}], formInit: [{
|
|
819
|
+
type: Output
|
|
820
|
+
}], dataLoaded: [{
|
|
821
|
+
type: Output
|
|
822
|
+
}], selectionChange: [{
|
|
823
|
+
type: Output
|
|
824
|
+
}], error: [{
|
|
825
|
+
type: Output
|
|
826
|
+
}], filters: [{
|
|
827
|
+
type: Input
|
|
828
|
+
}], filterModel: [{
|
|
829
|
+
type: Input
|
|
830
|
+
}], search: [{
|
|
831
|
+
type: Output
|
|
832
|
+
}], showSearch: [{
|
|
833
|
+
type: Input
|
|
834
|
+
}], first: [{
|
|
835
|
+
type: Input
|
|
836
|
+
}], rows: [{
|
|
837
|
+
type: Input
|
|
838
|
+
}], totalRecords: [{
|
|
839
|
+
type: Input
|
|
840
|
+
}], pageChange: [{
|
|
841
|
+
type: Output
|
|
842
|
+
}], onSearch: [{
|
|
843
|
+
type: Output
|
|
844
|
+
}], visibleChange: [{
|
|
845
|
+
type: Output
|
|
846
|
+
}], rowEditable: [{
|
|
847
|
+
type: Input
|
|
848
|
+
}], rowSelectable: [{
|
|
849
|
+
type: Input
|
|
850
|
+
}], rowSelect: [{
|
|
851
|
+
type: Output
|
|
852
|
+
}], scrollHeight: [{
|
|
853
|
+
type: Input
|
|
854
|
+
}], paginator: [{
|
|
855
|
+
type: Input
|
|
856
|
+
}], service: [{
|
|
857
|
+
type: Input
|
|
858
|
+
}], apiName: [{
|
|
859
|
+
type: Input
|
|
860
|
+
}], moduleName: [{
|
|
861
|
+
type: Input
|
|
862
|
+
}], idField: [{
|
|
863
|
+
type: Input
|
|
864
|
+
}], showRowSelectionCheckbox: [{
|
|
865
|
+
type: Input
|
|
866
|
+
}], showAddButton: [{
|
|
867
|
+
type: Input
|
|
868
|
+
}], showPrintButton: [{
|
|
869
|
+
type: Input
|
|
870
|
+
}], PermissionName: [{
|
|
871
|
+
type: Input
|
|
872
|
+
}], addButtonConfigs: [{
|
|
873
|
+
type: Input
|
|
874
|
+
}], createEditActions: [{
|
|
875
|
+
type: Input
|
|
876
|
+
}], supportSubPage: [{
|
|
877
|
+
type: Input
|
|
878
|
+
}], tabs: [{
|
|
879
|
+
type: Input
|
|
880
|
+
}], bulkActionButtons: [{
|
|
881
|
+
type: Input
|
|
882
|
+
}], singleActionButtons: [{
|
|
883
|
+
type: Input
|
|
884
|
+
}], breadcrumb: [{
|
|
885
|
+
type: Input
|
|
886
|
+
}], mode: [{
|
|
887
|
+
type: Input
|
|
888
|
+
}], forceState: [{
|
|
889
|
+
type: Input
|
|
890
|
+
}], hideTable: [{
|
|
891
|
+
type: Input
|
|
892
|
+
}], autoShowForm: [{
|
|
893
|
+
type: Input
|
|
894
|
+
}], rowStyleFn: [{
|
|
895
|
+
type: Input
|
|
896
|
+
}], rowClassFn: [{
|
|
897
|
+
type: Input
|
|
898
|
+
}], disableRowCheckboxFn: [{
|
|
899
|
+
type: Input
|
|
900
|
+
}], showAdvancedFilter: [{
|
|
901
|
+
type: Input
|
|
902
|
+
}], advancedFilterIcon: [{
|
|
903
|
+
type: Input
|
|
904
|
+
}], searchTabs: [{
|
|
905
|
+
type: Input
|
|
906
|
+
}], showViewMode: [{
|
|
907
|
+
type: Input
|
|
908
|
+
}], viewMode: [{
|
|
909
|
+
type: Input
|
|
910
|
+
}], viewModeChange: [{
|
|
911
|
+
type: Output
|
|
912
|
+
}], templateSelected: [{
|
|
913
|
+
type: Output
|
|
914
|
+
}], templateDrawerVisible: [{
|
|
915
|
+
type: Input
|
|
916
|
+
}], templateDrawerVisibleChange: [{
|
|
917
|
+
type: Output
|
|
918
|
+
}], category: [{
|
|
919
|
+
type: Input
|
|
920
|
+
}], feature: [{
|
|
921
|
+
type: Input
|
|
922
|
+
}] } });
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* Generated bundle index. Do not edit.
|
|
926
|
+
*/
|
|
927
|
+
|
|
928
|
+
export { GenericCrudHeaderComponent, GenericCrudTableComponent, GenericCrudTableModule };
|
|
929
|
+
//# sourceMappingURL=es.framework-ng.ui.core-generic-crud-table.mjs.map
|