@elite.framework/ng.core 1.0.38 → 1.0.40

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.
@@ -1338,13 +1338,14 @@ class AttachmentTypeComponent extends FieldType {
1338
1338
  messageService;
1339
1339
  defaultAcceptTypes = '.pdf,application/pdf,image/*,.txt,text/plain,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel';
1340
1340
  maxFileSize = 1 * 1024 * 1024; // 1 MB
1341
- url = '';
1342
1341
  tenantId = 0;
1343
1342
  env = inject(ENVIRONMENT);
1344
1343
  constructor(messageService) {
1345
1344
  super();
1346
1345
  this.messageService = messageService;
1347
- this.url = this.env.apiUrl + (this.props['apiUrl'] ?? '/api/files');
1346
+ }
1347
+ get url() {
1348
+ return this.env.apiUrl + (this.props['apiUrl'] ?? '/api/files');
1348
1349
  }
1349
1350
  get attachments() {
1350
1351
  return Array.isArray(this.formControl.value)
@@ -2541,6 +2542,15 @@ class FormlyAvatarImageComponent extends FieldType {
2541
2542
  get type() {
2542
2543
  return this.field.type;
2543
2544
  }
2545
+ get displayValue() {
2546
+ const value = this.formControl?.value;
2547
+ const baseUrl = this.field.props['baseUrl'] || '';
2548
+ const defaultImage = this.field.props['defaultImage'] || '';
2549
+ if (value) {
2550
+ return baseUrl ? `${baseUrl}${value}` : value;
2551
+ }
2552
+ return defaultImage;
2553
+ }
2544
2554
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: FormlyAvatarImageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2545
2555
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: FormlyAvatarImageComponent, isStandalone: true, selector: "formly-field-avatar-image", usesInheritance: true, ngImport: i0, template: `
2546
2556
  <div [ngClass]="field.props['containerClass'] || ''">
@@ -2550,14 +2560,15 @@ class FormlyAvatarImageComponent extends FieldType {
2550
2560
  </label>
2551
2561
  <div class="mt-1 flex items-center">
2552
2562
  <p-avatar
2553
- [image]="(field.props['baseUrl'] || '' + field.formControl.value )|| field.props['defaultImage']"
2563
+ [image]="displayValue"
2554
2564
  [size]="field.props['size'] || 'large'"
2555
2565
  [shape]="field.props['shape'] || 'circle'"
2556
2566
  [style]="field.props['avatarStyle'] || ''"
2557
2567
  [styleClass]="field.props['avatarClass'] || ''"
2558
2568
  (onClick)="field.props['onClick'] && field.props['onClick']($event)"
2559
- (onImageError)="field.props['onImageError'] && field.props['onImageError']($event)"
2569
+
2560
2570
  ></p-avatar>
2571
+ <!-- (onImageError)="field.props['onImageError'] && field.props['onImageError']($event)" -->
2561
2572
  <div *ngIf="field.props['showPlaceholder']" class="ml-4">
2562
2573
  <span class="text-gray-500">{{ field.props['placeholderText'] || 'No image selected' }}</span>
2563
2574
  </div>
@@ -2567,7 +2578,7 @@ class FormlyAvatarImageComponent extends FieldType {
2567
2578
  </small>
2568
2579
  <small *ngIf="field.props.description" class="mt-1 text-sm text-gray-500">{{ field.props.description }}</small>
2569
2580
  </div>
2570
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i1$8.LegacyFormlyValidationMessage, selector: "formly-validation-message" }, { kind: "ngmodule", type: AvatarModule }, { kind: "component", type: i3$3.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2581
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i1$8.LegacyFormlyValidationMessage, selector: "formly-validation-message" }, { kind: "ngmodule", type: AvatarModule }, { kind: "component", type: i3$3.Avatar, selector: "p-avatar", inputs: ["label", "icon", "image", "size", "shape", "styleClass", "ariaLabel", "ariaLabelledBy"], outputs: ["onImageError"] }] });
2571
2582
  }
2572
2583
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: FormlyAvatarImageComponent, decorators: [{
2573
2584
  type: Component,
@@ -2588,14 +2599,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
2588
2599
  </label>
2589
2600
  <div class="mt-1 flex items-center">
2590
2601
  <p-avatar
2591
- [image]="(field.props['baseUrl'] || '' + field.formControl.value )|| field.props['defaultImage']"
2602
+ [image]="displayValue"
2592
2603
  [size]="field.props['size'] || 'large'"
2593
2604
  [shape]="field.props['shape'] || 'circle'"
2594
2605
  [style]="field.props['avatarStyle'] || ''"
2595
2606
  [styleClass]="field.props['avatarClass'] || ''"
2596
2607
  (onClick)="field.props['onClick'] && field.props['onClick']($event)"
2597
- (onImageError)="field.props['onImageError'] && field.props['onImageError']($event)"
2608
+
2598
2609
  ></p-avatar>
2610
+ <!-- (onImageError)="field.props['onImageError'] && field.props['onImageError']($event)" -->
2599
2611
  <div *ngIf="field.props['showPlaceholder']" class="ml-4">
2600
2612
  <span class="text-gray-500">{{ field.props['placeholderText'] || 'No image selected' }}</span>
2601
2613
  </div>
@@ -2606,7 +2618,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImpor
2606
2618
  <small *ngIf="field.props.description" class="mt-1 text-sm text-gray-500">{{ field.props.description }}</small>
2607
2619
  </div>
2608
2620
  `,
2609
- changeDetection: ChangeDetectionStrategy.OnPush,
2621
+ // changeDetection: ChangeDetectionStrategy.OnPush,
2610
2622
  }]
2611
2623
  }] });
2612
2624