@elite.framework/ng.core 1.0.17 → 1.0.19

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.
@@ -4415,20 +4415,18 @@ class RepeatTypeComponent extends FieldArrayType {
4415
4415
  }
4416
4416
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: RepeatTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4417
4417
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: RepeatTypeComponent, isStandalone: true, selector: "formly-repeat-section", usesInheritance: true, ngImport: i0, template: `
4418
- <div class="overflow-auto">
4418
+ <div class="overflow-auto bg-gray-100 border border-gray-300">
4419
4419
  <table *ngIf="(field.fieldGroup ?? []).length > 0" class="table-auto w-full border border-gray-300">
4420
- <!-- Header Row -->
4421
4420
  <thead>
4422
4421
  <tr class="bg-gray-100 text-gray-700 text-sm">
4423
4422
  <th class="w-8"></th>
4424
4423
  <ng-container *ngFor="let col of getFirstRowColumns()">
4425
- <th class="text-center border">{{ (col.props?.label ?? '') | translate}}</th>
4424
+ <th class="text-center border">{{ (col.props?.label ?? '') | translate }}</th>
4426
4425
  </ng-container>
4427
4426
  <th class="w-10"></th>
4428
4427
  </tr>
4429
4428
  </thead>
4430
4429
 
4431
- <!-- Data Rows -->
4432
4430
  <tbody>
4433
4431
  <tr *ngFor="let row of field.fieldGroup; let rowIndex = index" class="border-t">
4434
4432
  <td class="bg-[#fffbea] text-center text-gray-400 px-2"><i class="pi pi-bars"></i></td>
@@ -4440,24 +4438,24 @@ class RepeatTypeComponent extends FieldArrayType {
4440
4438
  </ng-container>
4441
4439
 
4442
4440
  <td class="text-center px-2 bg-[#fffbea]">
4443
- <button type="button" (click)="remove(rowIndex)" class="text-red-600 hover:text-red-800">
4444
- <i class="pi pi-trash"></i>
4445
- </button>
4441
+ <ng-container *ngIf="rowIndex !== 0 || field.props?.['canDeleteFirstRow']">
4442
+ <button type="button" (click)="remove(rowIndex)" class="text-red-600 hover:text-red-800">
4443
+ <i class="pi pi-trash"></i>
4444
+ </button>
4445
+ </ng-container>
4446
4446
  </td>
4447
4447
  </tr>
4448
4448
  </tbody>
4449
4449
  </table>
4450
4450
 
4451
- <!-- Add Button -->
4452
- <div class="flex justify-end mt-2">
4453
- <button
4454
- type="button"
4455
- class="inline-flex items-center gap-1 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-lg hover:bg-blue-700 transition-colors duration-200 shadow-sm"
4456
- (click)="add()"
4457
- >
4458
- <span class="text-lg">+</span>
4459
- </button>
4460
-
4451
+ <div class="flex justify-end">
4452
+ <button
4453
+ type="button"
4454
+ class="inline-flex items-center gap-1 px-4 py-2 bg-primary-600 text-white text-sm font-medium hover:bg-primary-500 transition-colors duration-200 shadow-sm"
4455
+ (click)="add()"
4456
+ >
4457
+ <span class="text-lg">+</span>
4458
+ </button>
4461
4459
  </div>
4462
4460
  </div>
4463
4461
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FormlyField, selector: "formly-field", inputs: ["field"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$3.TranslatePipe, name: "translate" }] });
@@ -4469,20 +4467,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
4469
4467
  standalone: true,
4470
4468
  imports: [CommonModule, FormlyField, TranslateModule],
4471
4469
  template: `
4472
- <div class="overflow-auto">
4470
+ <div class="overflow-auto bg-gray-100 border border-gray-300">
4473
4471
  <table *ngIf="(field.fieldGroup ?? []).length > 0" class="table-auto w-full border border-gray-300">
4474
- <!-- Header Row -->
4475
4472
  <thead>
4476
4473
  <tr class="bg-gray-100 text-gray-700 text-sm">
4477
4474
  <th class="w-8"></th>
4478
4475
  <ng-container *ngFor="let col of getFirstRowColumns()">
4479
- <th class="text-center border">{{ (col.props?.label ?? '') | translate}}</th>
4476
+ <th class="text-center border">{{ (col.props?.label ?? '') | translate }}</th>
4480
4477
  </ng-container>
4481
4478
  <th class="w-10"></th>
4482
4479
  </tr>
4483
4480
  </thead>
4484
4481
 
4485
- <!-- Data Rows -->
4486
4482
  <tbody>
4487
4483
  <tr *ngFor="let row of field.fieldGroup; let rowIndex = index" class="border-t">
4488
4484
  <td class="bg-[#fffbea] text-center text-gray-400 px-2"><i class="pi pi-bars"></i></td>
@@ -4494,24 +4490,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
4494
4490
  </ng-container>
4495
4491
 
4496
4492
  <td class="text-center px-2 bg-[#fffbea]">
4497
- <button type="button" (click)="remove(rowIndex)" class="text-red-600 hover:text-red-800">
4498
- <i class="pi pi-trash"></i>
4499
- </button>
4493
+ <ng-container *ngIf="rowIndex !== 0 || field.props?.['canDeleteFirstRow']">
4494
+ <button type="button" (click)="remove(rowIndex)" class="text-red-600 hover:text-red-800">
4495
+ <i class="pi pi-trash"></i>
4496
+ </button>
4497
+ </ng-container>
4500
4498
  </td>
4501
4499
  </tr>
4502
4500
  </tbody>
4503
4501
  </table>
4504
4502
 
4505
- <!-- Add Button -->
4506
- <div class="flex justify-end mt-2">
4507
- <button
4508
- type="button"
4509
- class="inline-flex items-center gap-1 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-lg hover:bg-blue-700 transition-colors duration-200 shadow-sm"
4510
- (click)="add()"
4511
- >
4512
- <span class="text-lg">+</span>
4513
- </button>
4514
-
4503
+ <div class="flex justify-end">
4504
+ <button
4505
+ type="button"
4506
+ class="inline-flex items-center gap-1 px-4 py-2 bg-primary-600 text-white text-sm font-medium hover:bg-primary-500 transition-colors duration-200 shadow-sm"
4507
+ (click)="add()"
4508
+ >
4509
+ <span class="text-lg">+</span>
4510
+ </button>
4515
4511
  </div>
4516
4512
  </div>
4517
4513
  `,
@@ -5865,6 +5861,7 @@ class BaseCrud {
5865
5861
  dialogVisible = false;
5866
5862
  drawerVisible = false;
5867
5863
  selectedItem = null;
5864
+ defaultModel = null;
5868
5865
  // selectedItem: T | any = {};
5869
5866
  isViewMode = false;
5870
5867
  isEditMode = false;
@@ -5963,7 +5960,7 @@ class BaseCrud {
5963
5960
  this.mode = mode;
5964
5961
  // this.drawerVisible = !this.drawerVisible;
5965
5962
  if (item == null) {
5966
- this.selectedItem = {};
5963
+ this.selectedItem = this.defaultModel || {};
5967
5964
  }
5968
5965
  else {
5969
5966
  this.selectedItem = item;