@elite.framework/ng.core 1.0.18 → 1.0.20

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.
@@ -762,6 +762,7 @@ class ConditionExpressionBuilderType extends FieldType {
762
762
  /**
763
763
  *
764
764
  */
765
+ valueChangeSubscription;
765
766
  constructor(svc, cdr) {
766
767
  super();
767
768
  this.svc = svc;
@@ -772,6 +773,18 @@ class ConditionExpressionBuilderType extends FieldType {
772
773
  const to = this.props;
773
774
  this.api.apiName = to['serviceName'];
774
775
  this.displayMode = to['displayMode'] ?? 'full';
776
+ this.initTokens();
777
+ this.valueChangeSubscription = this.formControl.valueChanges
778
+ .subscribe(() => {
779
+ this.initTokens();
780
+ });
781
+ }
782
+ ngOnDestroy() {
783
+ if (this.valueChangeSubscription) {
784
+ this.valueChangeSubscription.unsubscribe();
785
+ }
786
+ }
787
+ initTokens() {
775
788
  const existing = this.formControl.value || '';
776
789
  if (existing) {
777
790
  const tokens = existing.split(' ').filter((x) => x);
@@ -4415,20 +4428,18 @@ class RepeatTypeComponent extends FieldArrayType {
4415
4428
  }
4416
4429
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: RepeatTypeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
4417
4430
  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">
4431
+ <div class="overflow-auto bg-gray-100 border border-gray-300">
4419
4432
  <table *ngIf="(field.fieldGroup ?? []).length > 0" class="table-auto w-full border border-gray-300">
4420
- <!-- Header Row -->
4421
4433
  <thead>
4422
4434
  <tr class="bg-gray-100 text-gray-700 text-sm">
4423
4435
  <th class="w-8"></th>
4424
4436
  <ng-container *ngFor="let col of getFirstRowColumns()">
4425
- <th class="text-center border">{{ (col.props?.label ?? '') | translate}}</th>
4437
+ <th class="text-center border">{{ (col.props?.label ?? '') | translate }}</th>
4426
4438
  </ng-container>
4427
4439
  <th class="w-10"></th>
4428
4440
  </tr>
4429
4441
  </thead>
4430
4442
 
4431
- <!-- Data Rows -->
4432
4443
  <tbody>
4433
4444
  <tr *ngFor="let row of field.fieldGroup; let rowIndex = index" class="border-t">
4434
4445
  <td class="bg-[#fffbea] text-center text-gray-400 px-2"><i class="pi pi-bars"></i></td>
@@ -4440,24 +4451,24 @@ class RepeatTypeComponent extends FieldArrayType {
4440
4451
  </ng-container>
4441
4452
 
4442
4453
  <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>
4454
+ <ng-container *ngIf="rowIndex !== 0 || field.props?.['canDeleteFirstRow']">
4455
+ <button type="button" (click)="remove(rowIndex)" class="text-red-600 hover:text-red-800">
4456
+ <i class="pi pi-trash"></i>
4457
+ </button>
4458
+ </ng-container>
4446
4459
  </td>
4447
4460
  </tr>
4448
4461
  </tbody>
4449
4462
  </table>
4450
4463
 
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
-
4464
+ <div class="flex justify-end">
4465
+ <button
4466
+ type="button"
4467
+ 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"
4468
+ (click)="add()"
4469
+ >
4470
+ <span class="text-lg">+</span>
4471
+ </button>
4461
4472
  </div>
4462
4473
  </div>
4463
4474
  `, 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 +4480,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
4469
4480
  standalone: true,
4470
4481
  imports: [CommonModule, FormlyField, TranslateModule],
4471
4482
  template: `
4472
- <div class="overflow-auto">
4483
+ <div class="overflow-auto bg-gray-100 border border-gray-300">
4473
4484
  <table *ngIf="(field.fieldGroup ?? []).length > 0" class="table-auto w-full border border-gray-300">
4474
- <!-- Header Row -->
4475
4485
  <thead>
4476
4486
  <tr class="bg-gray-100 text-gray-700 text-sm">
4477
4487
  <th class="w-8"></th>
4478
4488
  <ng-container *ngFor="let col of getFirstRowColumns()">
4479
- <th class="text-center border">{{ (col.props?.label ?? '') | translate}}</th>
4489
+ <th class="text-center border">{{ (col.props?.label ?? '') | translate }}</th>
4480
4490
  </ng-container>
4481
4491
  <th class="w-10"></th>
4482
4492
  </tr>
4483
4493
  </thead>
4484
4494
 
4485
- <!-- Data Rows -->
4486
4495
  <tbody>
4487
4496
  <tr *ngFor="let row of field.fieldGroup; let rowIndex = index" class="border-t">
4488
4497
  <td class="bg-[#fffbea] text-center text-gray-400 px-2"><i class="pi pi-bars"></i></td>
@@ -4494,24 +4503,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
4494
4503
  </ng-container>
4495
4504
 
4496
4505
  <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>
4506
+ <ng-container *ngIf="rowIndex !== 0 || field.props?.['canDeleteFirstRow']">
4507
+ <button type="button" (click)="remove(rowIndex)" class="text-red-600 hover:text-red-800">
4508
+ <i class="pi pi-trash"></i>
4509
+ </button>
4510
+ </ng-container>
4500
4511
  </td>
4501
4512
  </tr>
4502
4513
  </tbody>
4503
4514
  </table>
4504
4515
 
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
-
4516
+ <div class="flex justify-end">
4517
+ <button
4518
+ type="button"
4519
+ 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"
4520
+ (click)="add()"
4521
+ >
4522
+ <span class="text-lg">+</span>
4523
+ </button>
4515
4524
  </div>
4516
4525
  </div>
4517
4526
  `,