@es.framework/ng.ui.core 2.0.63 → 2.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/fesm2022/es.framework-ng.ui.core-checkbox.mjs +72 -58
  2. package/fesm2022/es.framework-ng.ui.core-checkbox.mjs.map +1 -1
  3. package/fesm2022/es.framework-ng.ui.core-form-button.mjs +38 -27
  4. package/fesm2022/es.framework-ng.ui.core-form-button.mjs.map +1 -1
  5. package/fesm2022/es.framework-ng.ui.core-formly-ui-all.mjs +14 -1
  6. package/fesm2022/es.framework-ng.ui.core-formly-ui-all.mjs.map +1 -1
  7. package/fesm2022/es.framework-ng.ui.core-generic-crud-report.mjs +22 -0
  8. package/fesm2022/es.framework-ng.ui.core-generic-crud-report.mjs.map +1 -0
  9. package/fesm2022/es.framework-ng.ui.core-generic-crud-table.mjs +1 -1
  10. package/fesm2022/es.framework-ng.ui.core-generic-crud-table.mjs.map +1 -1
  11. package/fesm2022/es.framework-ng.ui.core-generic-listbox.mjs +291 -0
  12. package/fesm2022/es.framework-ng.ui.core-generic-listbox.mjs.map +1 -0
  13. package/fesm2022/es.framework-ng.ui.core-generic-view.mjs +111 -131
  14. package/fesm2022/es.framework-ng.ui.core-generic-view.mjs.map +1 -1
  15. package/fesm2022/es.framework-ng.ui.core-input.mjs +2 -0
  16. package/fesm2022/es.framework-ng.ui.core-input.mjs.map +1 -1
  17. package/fesm2022/es.framework-ng.ui.core-repeat.mjs +2 -0
  18. package/fesm2022/es.framework-ng.ui.core-repeat.mjs.map +1 -1
  19. package/generic-crud-report/README.md +3 -0
  20. package/generic-listbox/README.md +3 -0
  21. package/package.json +9 -1
  22. package/types/es.framework-ng.ui.core-checkbox.d.ts +1 -0
  23. package/types/es.framework-ng.ui.core-form-button.d.ts +11 -3
  24. package/types/es.framework-ng.ui.core-formly-ui-all.d.ts +2 -1
  25. package/types/es.framework-ng.ui.core-generic-crud-report.d.ts +10 -0
  26. package/types/es.framework-ng.ui.core-generic-listbox.d.ts +72 -0
  27. package/types/es.framework-ng.ui.core-generic-view.d.ts +17 -6
@@ -1,31 +1,37 @@
1
- import * as i7 from 'primeng/tooltip';
1
+ import * as i8 from 'primeng/tooltip';
2
2
  import { TooltipModule } from 'primeng/tooltip';
3
3
  import * as i0 from '@angular/core';
4
- import { inject, EventEmitter, Input, ViewChild, Output, Component, NgModule } from '@angular/core';
5
- import * as i1 from '@angular/common';
4
+ import { inject, EventEmitter, Input, ViewChild, Output, Optional, Component, NgModule } from '@angular/core';
5
+ import * as i2 from '@angular/common';
6
6
  import { Location, CommonModule } from '@angular/common';
7
- import * as i2 from 'primeng/toolbar';
7
+ import * as i3 from 'primeng/toolbar';
8
8
  import { ToolbarModule } from 'primeng/toolbar';
9
- import * as i4 from 'primeng/button';
9
+ import * as i5 from 'primeng/button';
10
10
  import { ButtonModule } from 'primeng/button';
11
11
  import { FormlyForm } from '@ngx-formly/core';
12
- import * as i6 from '@angular/forms';
12
+ import * as i7 from '@angular/forms';
13
13
  import { UntypedFormGroup, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';
14
- import * as i5 from 'primeng/tabs';
14
+ import * as i6 from 'primeng/tabs';
15
15
  import { TabsModule } from 'primeng/tabs';
16
16
  import { TranslatePipe } from '@es.framework/ng.core/pipes';
17
17
  import { BreadcrumbComponent } from '@es.framework/ng.ui.core/breadcrumb';
18
- import { BaseService, SwalService } from '@es.framework/ng.core/services';
18
+ import { SchemaService, BaseService, SwalService, RestService } from '@es.framework/ng.core/services';
19
19
  import { ActivatedRoute, Router } from '@angular/router';
20
- import * as i8 from 'primeng/progressspinner';
20
+ import * as i9 from 'primeng/progressspinner';
21
21
  import { ProgressSpinnerModule } from 'primeng/progressspinner';
22
+ import * as i1 from 'primeng/dynamicdialog';
23
+ import { DialogService } from 'primeng/dynamicdialog';
22
24
  import { GenericDialogComponent } from '@es.framework/ng.ui.core/generic-dialog';
23
25
  import { GenericButton } from '@es.framework/ng.ui.core/generic-button';
24
- import * as i3 from 'primeng/api';
26
+ import * as i4 from 'primeng/api';
25
27
 
26
28
  class GenericViewComponent {
29
+ cdr;
30
+ ref;
31
+ config;
27
32
  route = inject(ActivatedRoute);
28
33
  router = inject(Router);
34
+ schemaService = inject(SchemaService);
29
35
  form = new UntypedFormGroup({});
30
36
  title = '';
31
37
  actions = [];
@@ -40,22 +46,26 @@ class GenericViewComponent {
40
46
  moduleName = '';
41
47
  idField = 'id';
42
48
  standaloneMode = false;
49
+ useRouteParams = true;
50
+ query;
51
+ currentId;
52
+ useTabs = true;
43
53
  isViewMode = true; // وضع المشاهدة فقط
44
54
  isCreateMode = false; // وضع الاضافة فقط
45
55
  isEditMode = false; // وضع التعديل
46
56
  model = {};
47
57
  displayMode = 'drawer';
48
- mode = 'full';
58
+ mode = 'detail';
49
59
  action = new EventEmitter();
50
60
  afterDelete = new EventEmitter();
51
61
  dialog;
52
62
  inlineForm;
53
63
  tabs_ = [];
54
64
  model_ = {};
55
- currentId;
56
65
  list = [];
57
66
  totalRecords = 0;
58
67
  loading = false;
68
+ showToolbar = true;
59
69
  // pagination state
60
70
  pageSize = 10;
61
71
  pageIndex = 0;
@@ -63,25 +73,57 @@ class GenericViewComponent {
63
73
  currentFilters = {};
64
74
  pageFilters = {};
65
75
  searchGlobal = '';
76
+ dialogService = inject(DialogService);
66
77
  swalService = inject(SwalService);
67
78
  _location = inject(Location);
68
79
  ngOnInit() {
69
- this.loading = true;
80
+ this.init();
81
+ }
82
+ constructor(cdr, ref, config) {
83
+ this.cdr = cdr;
84
+ this.ref = ref;
85
+ this.config = config;
86
+ if (config && config.data) {
87
+ const data = config?.data ?? {};
88
+ this.currentId = data.currentId ?? this.currentId;
89
+ this.isViewMode = data.isViewMode ?? this.isViewMode;
90
+ this.apiName = data.apiName ?? this.apiName;
91
+ this.moduleName = data.moduleName ?? this.moduleName;
92
+ this.useRouteParams = data.useRouteParams ?? this.useRouteParams;
93
+ this.standaloneMode = data.standaloneMode ?? this.standaloneMode;
94
+ this.useTabs = data.useTabs ?? this.useTabs;
95
+ this.formFields = data.formFields ?? this.formFields;
96
+ this.tabs = data.tabs ?? this.tabs;
97
+ this.breadcrumb = data.breadcrumb ?? this.breadcrumb;
98
+ this.showToolbar = data.showToolbar ?? this.showToolbar;
99
+ this.mode = data.mode ?? this.mode;
100
+ }
101
+ this.init();
102
+ }
103
+ init() {
70
104
  if (this.apiName) {
105
+ this.service.moduleName = this.service.moduleName || this.moduleName;
71
106
  this.service.apiName = this.apiName;
72
- this.service.moduleName = this.moduleName;
73
107
  }
74
108
  this.actions_ = this.actions.filter(c => c.name != 'view');
75
- this.route.paramMap.subscribe(params => {
76
- const id = params.get(this.idField);
77
- if (id) {
78
- this.currentId = id;
79
- if (this.standaloneMode) {
80
- this.loadList();
109
+ if (this.useRouteParams) {
110
+ this.route.paramMap.subscribe(params => {
111
+ const id = params.get(this.idField);
112
+ if (id) {
113
+ this.currentId = id;
114
+ if (this.standaloneMode) {
115
+ this.loadList();
116
+ }
81
117
  }
118
+ this.refresh();
119
+ });
120
+ }
121
+ else {
122
+ if (this.standaloneMode && (this.currentId || this.query)) {
123
+ this.loadList();
124
+ this.initTabs();
82
125
  }
83
- this.refresh();
84
- });
126
+ }
85
127
  }
86
128
  refresh() {
87
129
  // detect mode based on route
@@ -89,7 +131,16 @@ class GenericViewComponent {
89
131
  this.isViewMode = url.includes('/view');
90
132
  this.isEditMode = url.includes('/edit');
91
133
  this.isCreateMode = url.includes('/create') || url.endsWith('/new') || url.endsWith('/add');
134
+ this.initTabs();
135
+ }
136
+ initTabs() {
92
137
  this.tabs_ = [];
138
+ if (this.tabs.length == 0) {
139
+ this.tabs.push({
140
+ header: 'Details',
141
+ fields: []
142
+ });
143
+ }
93
144
  for (let i = 0; i < this.tabs.length; i++) {
94
145
  const t = this.tabs[i];
95
146
  this.tabs_.push({
@@ -97,113 +148,17 @@ class GenericViewComponent {
97
148
  fields: [
98
149
  {
99
150
  props: { label: '' },
100
- // fieldGroupClassName: 'grid grid-cols-1 md:grid-cols-2 gap-3', // TODO
151
+ // fieldGroupClassName: 'grid grid-cols-1 md:grid-cols-2 gap-3', // TODO
101
152
  fieldGroupClassName: '',
102
153
  fieldGroup: this.isCreateMode || this.isEditMode
103
- ? this.getCreateEditFields(i == 0 ? this.formFields : t.fields)
104
- : this.getViewFields(i == 0 ? this.formFields : t.fields),
154
+ ? this.schemaService.getCreateEditFields(i == 0 ? this.formFields : t.fields, this.isViewMode)
155
+ : this.schemaService.getViewFields(i == 0 ? this.formFields : t.fields, this.isViewMode),
105
156
  },
106
157
  ],
107
158
  });
108
159
  }
109
- this.loading = false;
160
+ // this.loading = false;
110
161
  }
111
- // as form
112
- getCreateEditFields(fields = []) {
113
- return fields.map(f => ({
114
- ...f,
115
- props: { ...f.props, readonly: this.viewMode, disabled: this.viewMode },
116
- }));
117
- }
118
- getViewFields(fields = []) {
119
- const flatten = (fields) => fields.flatMap((field) => {
120
- /* 1. GROUP / PANEL / WRAPPER */
121
- if (field.fieldGroup?.length) {
122
- const children = flatten(field.fieldGroup);
123
- if (!children.length)
124
- return [];
125
- return [{
126
- ...field,
127
- wrappers: field.wrappers,
128
- props: { ...field.props },
129
- fieldGroupClassName: field.fieldGroupClassName,
130
- fieldGroup: children
131
- }];
132
- }
133
- /* 2. FIELD ARRAY (REPEAT / TABLE / MULTI) */
134
- const fieldArrayConfig = typeof field.fieldArray === 'function'
135
- ? field.fieldArray(field)
136
- : field.fieldArray;
137
- if (field.fieldArray) {
138
- if (field.props?.['view']?.hidden)
139
- return [];
140
- const children = flatten(fieldArrayConfig?.fieldGroup || []);
141
- if (!children.length)
142
- return [];
143
- return [{
144
- ...field,
145
- type: field.props?.['view']?.type || field.type,
146
- readonly: this.viewMode,
147
- disabled: this.viewMode,
148
- fieldArray: {
149
- ...fieldArrayConfig,
150
- fieldGroup: children
151
- }
152
- }];
153
- }
154
- /* 3. SINGLE FIELD */
155
- if (!field.props || field.props['view']?.hidden)
156
- return [];
157
- const type = field.props['view']?.type ||
158
- field.props['table']?.type ||
159
- field.props['filter']?.type ||
160
- 'custom-label-type';
161
- return [{
162
- type,
163
- key: field.key,
164
- readonly: this.viewMode,
165
- disabled: this.viewMode,
166
- wrappers: field.wrappers ?? ['field-wrapper'],
167
- className: field.className,
168
- props: {
169
- ...field.props,
170
- ...(field.props['view']?.props ||
171
- field.props['table']?.props ||
172
- field.props['filter']?.props ||
173
- {}),
174
- },
175
- expressions: field.props['view']?.expressions ||
176
- field.props['table']?.expressions ||
177
- field.props['filter']?.expressions
178
- }];
179
- });
180
- return flatten(fields);
181
- }
182
- // getViewFields(fields: FormlyFieldConfig[] = []): FormlyFieldConfig[] {
183
- // const flatten = (fields: FormlyFieldConfig[]): FormlyFieldConfig[] =>
184
- // fields.flatMap(field => {
185
- // if (field.fieldGroup?.length) return flatten(field.fieldGroup);
186
- // if (!field.props
187
- // || field.props['view']?.hidden
188
- // // || field.props['table']?.hidden
189
- // ) return [];
190
- // const type = field.props['view']?.type || field.props['table']?.type || 'custom-label-type';
191
- // return [{
192
- // type,
193
- // key: field['key'],
194
- // readonly: this.viewMode,
195
- // disabled: this.viewMode,
196
- // wrappers: field.wrappers ?? ['field-wrapper'],
197
- // props: {
198
- // ...field.props,
199
- // ...(field.props['view']?.props || field.props['table']?.props),
200
- // },
201
- // expressions: field.props['view']?.expressions || field.props['view']?.expressions,
202
- // }];
203
- // });
204
- // return flatten(fields);
205
- // }
206
- // Use a map to store form groups for each row and column
207
162
  cellForms = new Map();
208
163
  getForm(rowIndex) {
209
164
  const key = `${rowIndex}_`;
@@ -249,7 +204,8 @@ class GenericViewComponent {
249
204
  emitAction(event) {
250
205
  switch (event.name) {
251
206
  case 'edit':
252
- this.dialog.openForm("edit", event.row);
207
+ // this.dialog.openForm("edit",event.row);
208
+ this.goToMode('edit');
253
209
  break;
254
210
  case 'delete':
255
211
  this.onDelete(event.row);
@@ -337,16 +293,26 @@ class GenericViewComponent {
337
293
  ...this.pageFilters,
338
294
  ...(this.searchGlobal ? { filter: this.searchGlobal } : {}),
339
295
  };
296
+ if (this.query) {
297
+ filters['query'] = this.query;
298
+ }
299
+ if (this.currentId) {
300
+ filters[this.idField] = this.currentId;
301
+ }
340
302
  this.service.getList(filters).subscribe({
341
303
  next: (res) => {
342
304
  this.list = res.items;
343
305
  this.totalRecords = res.totalCount;
344
306
  this.loading = false;
345
- // set model_ to current id item
346
- const found = this.list.find(x => x[this.idField] == this.currentId);
347
- if (found) {
348
- this.model_ = found;
307
+ if (this.list.length > 0) {
308
+ this.model = this.list[0];
309
+ this.model_ = this.list[0];
349
310
  }
311
+ // set model_ to current id item
312
+ // const found = this.list.find(x => x[this.idField] == this.currentId);
313
+ // if (found) {
314
+ // this.model_ = found;
315
+ // }
350
316
  },
351
317
  error: err => {
352
318
  console.error('Error loading list', err);
@@ -375,8 +341,8 @@ class GenericViewComponent {
375
341
  const currentMode = this.isEditMode ? 'edit' : 'view';
376
342
  // this.goToMode(currentMode);
377
343
  }
378
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: GenericViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
379
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: GenericViewComponent, isStandalone: true, selector: "app-detail-view", inputs: { title: "title", actions: "actions", createEditActions: "createEditActions", tabs: "tabs", viewMode: "viewMode", breadcrumb: "breadcrumb", service: "service", formFields: "formFields", apiName: "apiName", moduleName: "moduleName", idField: "idField", standaloneMode: "standaloneMode", isViewMode: "isViewMode", isCreateMode: "isCreateMode", isEditMode: "isEditMode", model: "model", displayMode: "displayMode", mode: "mode", loading: "loading" }, outputs: { action: "action", afterDelete: "afterDelete" }, viewQueries: [{ propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true }, { propertyName: "inlineForm", first: true, predicate: ["inlineForm"], descendants: true }], ngImport: i0, template: "\n@if (mode === 'detail') {\n <div class=\"w-full flex flex-col gap-3\">\n <!-- overlay -->\n @if (loading) {\n <div\n class=\"absolute inset-0 bg-white/70 flex items-center justify-center z-50\">\n <p-progress-spinner/>\n </div>\n }\n\n <!-- actual content -->\n <!-- Toolbar -->\n <p-toolbar style=\"background: transparent;border: 0px;box-shadow: none;\" class=\"bg-transparent shadow-none border-none rounded-md px-3\">\n <ng-template pTemplate=\"left\">\n <!-- <span class=\"font-semibold text-lg xs:hidden block\">{{ title }}</span> -->\n <app-breadcrumb class=\"xs:block\" [breadcrumb]=\"breadcrumb\"></app-breadcrumb> <!-- xs:block hidden -->\n </ng-template>\n <ng-template pTemplate=\"right\">\n <div class=\"flex gap-2\">\n\n <button\n pButton pRipple\n icon=\"pi pi-chevron-right\"\n class=\"p-button-text p-button-sm fd-btn\"\n pTooltip=\"\u0627\u0644\u062A\u0627\u0644\u064A\"\n (click)=\"next()\"\n ></button>\n <button\n pButton pRipple\n icon=\"pi pi-chevron-left\"\n class=\"p-button-text p-button-sm fd-btn\"\n pTooltip=\"\u0627\u0644\u0633\u0627\u0628\u0642\"\n (click)=\"previous()\"\n ></button>\n </div>\n </ng-template>\n </p-toolbar>\n <p-toolbar class=\"bg-white shadow rounded-md px-3\">\n\n <ng-template pTemplate=\"left\">\n @if (isViewMode) {\n <div class=\"flex gap-1\">\n @for (action of actions_; track $index) {\n <button\n pButton pRipple\n [icon]=\"action.icon ?? ''\"\n [label]=\"(action.label ?? '') | translate\"\n class=\"fd-btn\"\n (click)=\"onAction(action,model)\"\n ></button>\n }\n </div>\n }\n </ng-template>\n <ng-template pTemplate=\"right\">\n @if (isEditMode || isCreateMode) {\n <div class=\"flex gap-1\">\n @for (btn of createEditActions; track $index) {\n @if (!btn.visible || (btn.visible && btn.visible === true)) {\n @if (btn.type === 'submit' && inlineForm) {\n <lib-generic-button\n [type]=\"'submit'\"\n [loading]=\"inlineForm.loading\"\n [disabled]=\"inlineForm.loading || form.invalid\"\n [icon]=\"btn.icon\"\n [label]=\"btn.label | translate\"\n [variant]=\"btn.variant\"\n [severity]=\"btn.severity\"\n [size]=\"btn.size\"\n [model]=\"btn.splitActions\"\n [permission]=\"btn.permission\"\n (clicked)=\"inlineForm.onSubmit()\"\n ></lib-generic-button>\n }\n @else{\n <lib-generic-button\n [icon]=\"btn.icon\"\n [label]=\"btn.label | translate\"\n [variant]=\"btn.variant\"\n [severity]=\"btn.severity\"\n [size]=\"btn.size\"\n [model]=\"btn.splitActions\"\n [permission]=\"btn.permission\"\n (clicked)=\"handleCreateEditAction(btn)\"\n ></lib-generic-button>\n }\n }\n }\n </div>\n }\n </ng-template>\n\n </p-toolbar>\n\n <!-- Tabs -->\n <p-tabs value=\"0\">\n <p-tablist>\n @for (tab of tabs_; track $index) {\n <p-tab value=\"{{$index}}\">\n <i [class]=\"tab.icon\"></i>\n <span class=\"mr-1 ml-1\">{{ tab.header }}</span>\n </p-tab>\n }\n </p-tablist>\n <p-tabpanels>\n @for (tab of tabs_; track $index) {\n <p-tabpanel value=\"{{$index}}\">\n\n <!-- Formly fields -->\n <!-- border border-surface p-4-->\n <div class=\"\">\n @if (tab.fields.length && $index === 0) {\n\n @if (form) {\n <form [formGroup]=\"form\">\n @if (tab.fields.length && $index === 0 ) {\n @if (isEditMode || isCreateMode) {\n <app-generic-dialog\n #inlineForm\n [form]=\"form\"\n [model]=\"model\"\n [formFields]=\"formFields ?? []\"\n [apiName]=\"apiName\"\n [moduleName]=\"moduleName\"\n [idField]=\"idField ??'id'\"\n [displayMode]=\"'inline'\"\n [mode]=\"'form-only'\"\n [forceState]=\"isCreateMode ? 'create':'edit'\"\n (afterSave)=\"afterSave($event)\"\n >\n </app-generic-dialog>\n }\n @else if(isViewMode){\n <formly-form\n [form]=\"form\"\n [fields]=\"tab.fields\"\n [model]=\"model\"\n ></formly-form>\n }\n }\n </form>\n }\n\n }\n @if (tab.fields.length && $index > 0) {\n\n\n <formly-form\n [form]=\"getForm($index)\"\n [fields]=\"tab.fields\"\n [model]=\"tab.model || model\"\n ></formly-form>\n\n }\n\n <!-- Custom template -->\n @if (tab.content) {\n <ng-container\n *ngTemplateOutlet=\"tab.content; context: { model: model }\">\n </ng-container>\n }\n </div>\n </p-tabpanel>\n }\n </p-tabpanels>\n</p-tabs>\n</div>\n\n<!-- [model]=\"model\" -->\n<app-generic-dialog\n #dialog\n [formFields]=\"formFields ?? []\"\n [apiName]=\"apiName\"\n [moduleName]=\"moduleName\"\n [idField]=\"idField ??'id'\"\n [displayMode]=\"displayMode ?? 'dialog'\"\n (afterSave)=\"afterSave($event)\"\n >\n</app-generic-dialog>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ToolbarModule }, { kind: "component", type: i2.Toolbar, selector: "p-toolbar", inputs: ["styleClass", "ariaLabelledBy"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i5.Tabs, selector: "p-tabs", inputs: ["value", "scrollable", "lazy", "selectOnFocus", "showNavigators", "tabindex"], outputs: ["valueChange"] }, { kind: "component", type: i5.TabPanels, selector: "p-tabpanels" }, { kind: "component", type: i5.TabPanel, selector: "p-tabpanel", inputs: ["lazy", "value"], outputs: ["valueChange"] }, { kind: "component", type: i5.TabList, selector: "p-tablist" }, { kind: "component", type: i5.Tab, selector: "p-tab", inputs: ["value", "disabled"], outputs: ["valueChange"] }, { kind: "component", type: FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i6.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i6.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: BreadcrumbComponent, selector: "app-breadcrumb", inputs: ["breadcrumb"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i7.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: 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: GenericButton, selector: "lib-generic-button", inputs: ["model", "type", "icon", "label", "variant", "severity", "size", "iconPosition", "disabled", "loading", "ariaLabel", "extraClasses", "permission"], outputs: ["clicked", "itemClick"] }, { kind: "ngmodule", type: ProgressSpinnerModule }, { kind: "component", type: i8.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
344
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: GenericViewComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.DynamicDialogRef, optional: true }, { token: i1.DynamicDialogConfig, optional: true }], target: i0.ɵɵFactoryTarget.Component });
345
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: GenericViewComponent, isStandalone: true, selector: "app-detail-view", inputs: { title: "title", actions: "actions", createEditActions: "createEditActions", tabs: "tabs", viewMode: "viewMode", breadcrumb: "breadcrumb", service: "service", formFields: "formFields", apiName: "apiName", moduleName: "moduleName", idField: "idField", standaloneMode: "standaloneMode", useRouteParams: "useRouteParams", query: "query", currentId: "currentId", useTabs: "useTabs", isViewMode: "isViewMode", isCreateMode: "isCreateMode", isEditMode: "isEditMode", model: "model", displayMode: "displayMode", mode: "mode", loading: "loading", showToolbar: "showToolbar" }, outputs: { action: "action", afterDelete: "afterDelete" }, providers: [DialogService, BaseService, RestService], viewQueries: [{ propertyName: "dialog", first: true, predicate: ["dialog"], descendants: true }, { propertyName: "inlineForm", first: true, predicate: ["inlineForm"], descendants: true }], ngImport: i0, template: "@if (mode === 'detail') {\n<div class=\"w-full flex flex-col gap-3\">\n <!-- overlay -->\n @if (loading) {\n <div \n class=\"absolute inset-0 bg-white/70 flex items-center justify-center z-50\">\n <p-progress-spinner/>\n </div>\n}\n\n <!-- actual content -->\n <!-- Toolbar -->\n @if (showToolbar) {\n <!-- background: transparent; -->\n <p-toolbar style=\"border: 0px;box-shadow: none;\" class=\"toolbar-top bg-white shadow-none border-none rounded-md px-3\">\n <ng-template pTemplate=\"left\">\n <!-- <span class=\"font-semibold text-lg xs:hidden block\">{{ title }}</span> -->\n <app-breadcrumb class=\"xs:block\" [breadcrumb]=\"breadcrumb\"></app-breadcrumb> <!-- xs:block hidden -->\n </ng-template>\n <ng-template pTemplate=\"right\">\n <div class=\"flex gap-2\">\n\n <button\n pButton pRipple\n icon=\"pi pi-chevron-right\"\n class=\"p-button-text p-button-sm fd-btn\"\n pTooltip=\"\u0627\u0644\u062A\u0627\u0644\u064A\"\n (click)=\"next()\"\n ></button>\n <button\n pButton pRipple\n icon=\"pi pi-chevron-left\"\n class=\"p-button-text p-button-sm fd-btn\"\n pTooltip=\"\u0627\u0644\u0633\u0627\u0628\u0642\"\n (click)=\"previous()\"\n ></button>\n </div>\n </ng-template>\n </p-toolbar>\n\n <p-toolbar class=\"toolbar-bottom bg-white shadow rounded-md px-3\">\n\n <ng-template pTemplate=\"left\">\n @if (isViewMode) {\n <div class=\"flex gap-1\">\n @for (action of actions_; track $index) {\n <button\n pButton pRipple\n [icon]=\"action.icon ?? ''\"\n [label]=\"(action.label ?? '') | translate\"\n class=\"fd-btn\"\n (click)=\"onAction(action,model)\"\n ></button>\n }\n </div>\n }\n </ng-template>\n <ng-template pTemplate=\"right\">\n @if (isEditMode || isCreateMode) {\n <div class=\"flex gap-1\">\n @for (btn of createEditActions; track $index) {\n @if (!btn.visible || (btn.visible && btn.visible === true)) {\n @if (btn.type === 'submit' && inlineForm) {\n <lib-generic-button\n [type]=\"'submit'\"\n [loading]=\"inlineForm.loading\"\n [disabled]=\"inlineForm.loading || form.invalid\"\n [icon]=\"btn.icon\"\n [label]=\"btn.label | translate\"\n [variant]=\"btn.variant\"\n [severity]=\"btn.severity\"\n [size]=\"btn.size\"\n [model]=\"btn.splitActions\"\n [permission]=\"btn.permission\"\n (clicked)=\"inlineForm.onSubmit()\"\n ></lib-generic-button>\n }\n @else{\n <lib-generic-button\n [icon]=\"btn.icon\"\n [label]=\"btn.label | translate\"\n [variant]=\"btn.variant\"\n [severity]=\"btn.severity\"\n [size]=\"btn.size\"\n [model]=\"btn.splitActions\"\n [permission]=\"btn.permission\"\n (clicked)=\"handleCreateEditAction(btn)\"\n ></lib-generic-button>\n }\n }\n }\n </div>\n }\n </ng-template>\n\n </p-toolbar>\n}\n\n <!-- Tabs -->\n <ng-template #tabContent let-tab let-i=\"index\">\n <div>\n \n <!-- First tab special handling -->\n @if (tab.fields.length && i === 0) {\n @if(form){\n\n \n <form [formGroup]=\"form\">\n\n @if (isEditMode || isCreateMode) {\n <app-generic-dialog\n #inlineForm\n [form]=\"form\"\n [model]=\"model\"\n [formFields]=\"formFields ?? []\"\n [apiName]=\"apiName\"\n [idField]=\"idField ?? 'id'\"\n [moduleName]=\"moduleName\"\n [displayMode]=\"'inline'\"\n [mode]=\"'form-only'\"\n [forceState]=\"isCreateMode ? 'create':'edit'\"\n (afterSave)=\"afterSave($event)\">\n </app-generic-dialog>\n }\n @else if (isViewMode) {\n <formly-form\n [form]=\"form\"\n [fields]=\"tab.fields\"\n [model]=\"model\">\n </formly-form>\n }\n\n </form>\n }\n }\n\n <!-- \u0628\u0627\u0642\u064A \u0627\u0644\u062A\u0627\u0628\u0627\u062A -->\n @if (tab.fields.length && i > 0) {\n <formly-form\n [form]=\"getForm(i)\"\n [fields]=\"tab.fields\"\n [model]=\"tab.model || model\">\n </formly-form>\n }\n\n <!-- Custom template -->\n @if (tab.content) {\n <ng-container\n *ngTemplateOutlet=\"tab.content; context: { model: model }\">\n </ng-container>\n }\n\n </div>\n</ng-template>\n@if (useTabs) {\n <p-tabs value=\"0\">\n <p-tablist>\n @for (tab of tabs_; track $index) {\n <p-tab value=\"{{$index}}\">\n <i [class]=\"tab.icon\"></i>\n <span class=\"mr-1 ml-1\">{{ tab.header | translate }}</span>\n </p-tab>\n }\n </p-tablist>\n\n <p-tabpanels>\n @for (tab of tabs_; track $index) {\n <p-tabpanel value=\"{{$index}}\">\n <ng-container\n *ngTemplateOutlet=\"tabContent; context: { $implicit: tab, index: $index }\">\n </ng-container>\n </p-tabpanel>\n }\n </p-tabpanels>\n </p-tabs>\n}\n@else {\n <div class=\"flex flex-column gap-4\">\n @for (tab of tabs_; track $index) {\n\n <!-- Optional header -->\n <!-- <div class=\"font-bold text-lg\">\n <i [class]=\"tab.icon\"></i>\n <span class=\"ml-2\">{{ tab.header | translate }}</span>\n </div> -->\n\n <ng-container\n *ngTemplateOutlet=\"tabContent; context: { $implicit: tab, index: $index }\">\n </ng-container>\n\n }\n </div>\n}\n</div>\n\n<!-- [model]=\"model\" -->\n <app-generic-dialog\n #dialog\n [formFields]=\"formFields ?? []\"\n [apiName]=\"apiName\"\n [idField]=\"idField ??'id'\"\n [moduleName]=\"moduleName\"\n [displayMode]=\"displayMode ?? 'dialog'\"\n (afterSave)=\"afterSave($event)\"\n >\n </app-generic-dialog>\n}\n", styles: [".toolbar-top{position:sticky;top:0;z-index:1000}.toolbar-bottom{position:sticky;top:48px;z-index:999}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ToolbarModule }, { kind: "component", type: i3.Toolbar, selector: "p-toolbar", inputs: ["styleClass", "ariaLabelledBy"] }, { kind: "directive", type: i4.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i6.Tabs, selector: "p-tabs", inputs: ["value", "scrollable", "lazy", "selectOnFocus", "showNavigators", "tabindex"], outputs: ["valueChange"] }, { kind: "component", type: i6.TabPanels, selector: "p-tabpanels" }, { kind: "component", type: i6.TabPanel, selector: "p-tabpanel", inputs: ["lazy", "value"], outputs: ["valueChange"] }, { kind: "component", type: i6.TabList, selector: "p-tablist" }, { kind: "component", type: i6.Tab, selector: "p-tab", inputs: ["value", "disabled"], outputs: ["valueChange"] }, { kind: "component", type: FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: BreadcrumbComponent, selector: "app-breadcrumb", inputs: ["breadcrumb"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.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: 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: GenericButton, selector: "lib-generic-button", inputs: ["model", "type", "icon", "label", "variant", "severity", "size", "iconPosition", "disabled", "loading", "ariaLabel", "extraClasses", "permission"], outputs: ["clicked", "itemClick"] }, { kind: "ngmodule", type: ProgressSpinnerModule }, { kind: "component", type: i9.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
380
346
  }
381
347
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: GenericViewComponent, decorators: [{
382
348
  type: Component,
@@ -394,8 +360,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
394
360
  GenericDialogComponent,
395
361
  GenericButton,
396
362
  ProgressSpinnerModule
397
- ], template: "\n@if (mode === 'detail') {\n <div class=\"w-full flex flex-col gap-3\">\n <!-- overlay -->\n @if (loading) {\n <div\n class=\"absolute inset-0 bg-white/70 flex items-center justify-center z-50\">\n <p-progress-spinner/>\n </div>\n }\n\n <!-- actual content -->\n <!-- Toolbar -->\n <p-toolbar style=\"background: transparent;border: 0px;box-shadow: none;\" class=\"bg-transparent shadow-none border-none rounded-md px-3\">\n <ng-template pTemplate=\"left\">\n <!-- <span class=\"font-semibold text-lg xs:hidden block\">{{ title }}</span> -->\n <app-breadcrumb class=\"xs:block\" [breadcrumb]=\"breadcrumb\"></app-breadcrumb> <!-- xs:block hidden -->\n </ng-template>\n <ng-template pTemplate=\"right\">\n <div class=\"flex gap-2\">\n\n <button\n pButton pRipple\n icon=\"pi pi-chevron-right\"\n class=\"p-button-text p-button-sm fd-btn\"\n pTooltip=\"\u0627\u0644\u062A\u0627\u0644\u064A\"\n (click)=\"next()\"\n ></button>\n <button\n pButton pRipple\n icon=\"pi pi-chevron-left\"\n class=\"p-button-text p-button-sm fd-btn\"\n pTooltip=\"\u0627\u0644\u0633\u0627\u0628\u0642\"\n (click)=\"previous()\"\n ></button>\n </div>\n </ng-template>\n </p-toolbar>\n <p-toolbar class=\"bg-white shadow rounded-md px-3\">\n\n <ng-template pTemplate=\"left\">\n @if (isViewMode) {\n <div class=\"flex gap-1\">\n @for (action of actions_; track $index) {\n <button\n pButton pRipple\n [icon]=\"action.icon ?? ''\"\n [label]=\"(action.label ?? '') | translate\"\n class=\"fd-btn\"\n (click)=\"onAction(action,model)\"\n ></button>\n }\n </div>\n }\n </ng-template>\n <ng-template pTemplate=\"right\">\n @if (isEditMode || isCreateMode) {\n <div class=\"flex gap-1\">\n @for (btn of createEditActions; track $index) {\n @if (!btn.visible || (btn.visible && btn.visible === true)) {\n @if (btn.type === 'submit' && inlineForm) {\n <lib-generic-button\n [type]=\"'submit'\"\n [loading]=\"inlineForm.loading\"\n [disabled]=\"inlineForm.loading || form.invalid\"\n [icon]=\"btn.icon\"\n [label]=\"btn.label | translate\"\n [variant]=\"btn.variant\"\n [severity]=\"btn.severity\"\n [size]=\"btn.size\"\n [model]=\"btn.splitActions\"\n [permission]=\"btn.permission\"\n (clicked)=\"inlineForm.onSubmit()\"\n ></lib-generic-button>\n }\n @else{\n <lib-generic-button\n [icon]=\"btn.icon\"\n [label]=\"btn.label | translate\"\n [variant]=\"btn.variant\"\n [severity]=\"btn.severity\"\n [size]=\"btn.size\"\n [model]=\"btn.splitActions\"\n [permission]=\"btn.permission\"\n (clicked)=\"handleCreateEditAction(btn)\"\n ></lib-generic-button>\n }\n }\n }\n </div>\n }\n </ng-template>\n\n </p-toolbar>\n\n <!-- Tabs -->\n <p-tabs value=\"0\">\n <p-tablist>\n @for (tab of tabs_; track $index) {\n <p-tab value=\"{{$index}}\">\n <i [class]=\"tab.icon\"></i>\n <span class=\"mr-1 ml-1\">{{ tab.header }}</span>\n </p-tab>\n }\n </p-tablist>\n <p-tabpanels>\n @for (tab of tabs_; track $index) {\n <p-tabpanel value=\"{{$index}}\">\n\n <!-- Formly fields -->\n <!-- border border-surface p-4-->\n <div class=\"\">\n @if (tab.fields.length && $index === 0) {\n\n @if (form) {\n <form [formGroup]=\"form\">\n @if (tab.fields.length && $index === 0 ) {\n @if (isEditMode || isCreateMode) {\n <app-generic-dialog\n #inlineForm\n [form]=\"form\"\n [model]=\"model\"\n [formFields]=\"formFields ?? []\"\n [apiName]=\"apiName\"\n [moduleName]=\"moduleName\"\n [idField]=\"idField ??'id'\"\n [displayMode]=\"'inline'\"\n [mode]=\"'form-only'\"\n [forceState]=\"isCreateMode ? 'create':'edit'\"\n (afterSave)=\"afterSave($event)\"\n >\n </app-generic-dialog>\n }\n @else if(isViewMode){\n <formly-form\n [form]=\"form\"\n [fields]=\"tab.fields\"\n [model]=\"model\"\n ></formly-form>\n }\n }\n </form>\n }\n\n }\n @if (tab.fields.length && $index > 0) {\n\n\n <formly-form\n [form]=\"getForm($index)\"\n [fields]=\"tab.fields\"\n [model]=\"tab.model || model\"\n ></formly-form>\n\n }\n\n <!-- Custom template -->\n @if (tab.content) {\n <ng-container\n *ngTemplateOutlet=\"tab.content; context: { model: model }\">\n </ng-container>\n }\n </div>\n </p-tabpanel>\n }\n </p-tabpanels>\n</p-tabs>\n</div>\n\n<!-- [model]=\"model\" -->\n<app-generic-dialog\n #dialog\n [formFields]=\"formFields ?? []\"\n [apiName]=\"apiName\"\n [moduleName]=\"moduleName\"\n [idField]=\"idField ??'id'\"\n [displayMode]=\"displayMode ?? 'dialog'\"\n (afterSave)=\"afterSave($event)\"\n >\n</app-generic-dialog>\n}\n" }]
398
- }], propDecorators: { title: [{
363
+ ], providers: [DialogService, BaseService, RestService], template: "@if (mode === 'detail') {\n<div class=\"w-full flex flex-col gap-3\">\n <!-- overlay -->\n @if (loading) {\n <div \n class=\"absolute inset-0 bg-white/70 flex items-center justify-center z-50\">\n <p-progress-spinner/>\n </div>\n}\n\n <!-- actual content -->\n <!-- Toolbar -->\n @if (showToolbar) {\n <!-- background: transparent; -->\n <p-toolbar style=\"border: 0px;box-shadow: none;\" class=\"toolbar-top bg-white shadow-none border-none rounded-md px-3\">\n <ng-template pTemplate=\"left\">\n <!-- <span class=\"font-semibold text-lg xs:hidden block\">{{ title }}</span> -->\n <app-breadcrumb class=\"xs:block\" [breadcrumb]=\"breadcrumb\"></app-breadcrumb> <!-- xs:block hidden -->\n </ng-template>\n <ng-template pTemplate=\"right\">\n <div class=\"flex gap-2\">\n\n <button\n pButton pRipple\n icon=\"pi pi-chevron-right\"\n class=\"p-button-text p-button-sm fd-btn\"\n pTooltip=\"\u0627\u0644\u062A\u0627\u0644\u064A\"\n (click)=\"next()\"\n ></button>\n <button\n pButton pRipple\n icon=\"pi pi-chevron-left\"\n class=\"p-button-text p-button-sm fd-btn\"\n pTooltip=\"\u0627\u0644\u0633\u0627\u0628\u0642\"\n (click)=\"previous()\"\n ></button>\n </div>\n </ng-template>\n </p-toolbar>\n\n <p-toolbar class=\"toolbar-bottom bg-white shadow rounded-md px-3\">\n\n <ng-template pTemplate=\"left\">\n @if (isViewMode) {\n <div class=\"flex gap-1\">\n @for (action of actions_; track $index) {\n <button\n pButton pRipple\n [icon]=\"action.icon ?? ''\"\n [label]=\"(action.label ?? '') | translate\"\n class=\"fd-btn\"\n (click)=\"onAction(action,model)\"\n ></button>\n }\n </div>\n }\n </ng-template>\n <ng-template pTemplate=\"right\">\n @if (isEditMode || isCreateMode) {\n <div class=\"flex gap-1\">\n @for (btn of createEditActions; track $index) {\n @if (!btn.visible || (btn.visible && btn.visible === true)) {\n @if (btn.type === 'submit' && inlineForm) {\n <lib-generic-button\n [type]=\"'submit'\"\n [loading]=\"inlineForm.loading\"\n [disabled]=\"inlineForm.loading || form.invalid\"\n [icon]=\"btn.icon\"\n [label]=\"btn.label | translate\"\n [variant]=\"btn.variant\"\n [severity]=\"btn.severity\"\n [size]=\"btn.size\"\n [model]=\"btn.splitActions\"\n [permission]=\"btn.permission\"\n (clicked)=\"inlineForm.onSubmit()\"\n ></lib-generic-button>\n }\n @else{\n <lib-generic-button\n [icon]=\"btn.icon\"\n [label]=\"btn.label | translate\"\n [variant]=\"btn.variant\"\n [severity]=\"btn.severity\"\n [size]=\"btn.size\"\n [model]=\"btn.splitActions\"\n [permission]=\"btn.permission\"\n (clicked)=\"handleCreateEditAction(btn)\"\n ></lib-generic-button>\n }\n }\n }\n </div>\n }\n </ng-template>\n\n </p-toolbar>\n}\n\n <!-- Tabs -->\n <ng-template #tabContent let-tab let-i=\"index\">\n <div>\n \n <!-- First tab special handling -->\n @if (tab.fields.length && i === 0) {\n @if(form){\n\n \n <form [formGroup]=\"form\">\n\n @if (isEditMode || isCreateMode) {\n <app-generic-dialog\n #inlineForm\n [form]=\"form\"\n [model]=\"model\"\n [formFields]=\"formFields ?? []\"\n [apiName]=\"apiName\"\n [idField]=\"idField ?? 'id'\"\n [moduleName]=\"moduleName\"\n [displayMode]=\"'inline'\"\n [mode]=\"'form-only'\"\n [forceState]=\"isCreateMode ? 'create':'edit'\"\n (afterSave)=\"afterSave($event)\">\n </app-generic-dialog>\n }\n @else if (isViewMode) {\n <formly-form\n [form]=\"form\"\n [fields]=\"tab.fields\"\n [model]=\"model\">\n </formly-form>\n }\n\n </form>\n }\n }\n\n <!-- \u0628\u0627\u0642\u064A \u0627\u0644\u062A\u0627\u0628\u0627\u062A -->\n @if (tab.fields.length && i > 0) {\n <formly-form\n [form]=\"getForm(i)\"\n [fields]=\"tab.fields\"\n [model]=\"tab.model || model\">\n </formly-form>\n }\n\n <!-- Custom template -->\n @if (tab.content) {\n <ng-container\n *ngTemplateOutlet=\"tab.content; context: { model: model }\">\n </ng-container>\n }\n\n </div>\n</ng-template>\n@if (useTabs) {\n <p-tabs value=\"0\">\n <p-tablist>\n @for (tab of tabs_; track $index) {\n <p-tab value=\"{{$index}}\">\n <i [class]=\"tab.icon\"></i>\n <span class=\"mr-1 ml-1\">{{ tab.header | translate }}</span>\n </p-tab>\n }\n </p-tablist>\n\n <p-tabpanels>\n @for (tab of tabs_; track $index) {\n <p-tabpanel value=\"{{$index}}\">\n <ng-container\n *ngTemplateOutlet=\"tabContent; context: { $implicit: tab, index: $index }\">\n </ng-container>\n </p-tabpanel>\n }\n </p-tabpanels>\n </p-tabs>\n}\n@else {\n <div class=\"flex flex-column gap-4\">\n @for (tab of tabs_; track $index) {\n\n <!-- Optional header -->\n <!-- <div class=\"font-bold text-lg\">\n <i [class]=\"tab.icon\"></i>\n <span class=\"ml-2\">{{ tab.header | translate }}</span>\n </div> -->\n\n <ng-container\n *ngTemplateOutlet=\"tabContent; context: { $implicit: tab, index: $index }\">\n </ng-container>\n\n }\n </div>\n}\n</div>\n\n<!-- [model]=\"model\" -->\n <app-generic-dialog\n #dialog\n [formFields]=\"formFields ?? []\"\n [apiName]=\"apiName\"\n [idField]=\"idField ??'id'\"\n [moduleName]=\"moduleName\"\n [displayMode]=\"displayMode ?? 'dialog'\"\n (afterSave)=\"afterSave($event)\"\n >\n </app-generic-dialog>\n}\n", styles: [".toolbar-top{position:sticky;top:0;z-index:1000}.toolbar-bottom{position:sticky;top:48px;z-index:999}\n"] }]
364
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.DynamicDialogRef, decorators: [{
365
+ type: Optional
366
+ }] }, { type: i1.DynamicDialogConfig, decorators: [{
367
+ type: Optional
368
+ }] }], propDecorators: { title: [{
399
369
  type: Input
400
370
  }], actions: [{
401
371
  type: Input
@@ -419,6 +389,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
419
389
  type: Input
420
390
  }], standaloneMode: [{
421
391
  type: Input
392
+ }], useRouteParams: [{
393
+ type: Input
394
+ }], query: [{
395
+ type: Input
396
+ }], currentId: [{
397
+ type: Input
398
+ }], useTabs: [{
399
+ type: Input
422
400
  }], isViewMode: [{
423
401
  type: Input
424
402
  }], isCreateMode: [{
@@ -443,6 +421,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
443
421
  args: ['inlineForm']
444
422
  }], loading: [{
445
423
  type: Input
424
+ }], showToolbar: [{
425
+ type: Input
446
426
  }] } });
447
427
 
448
428
  class GenericViewModule {