@smartsoft001/angular 2.183.0 → 2.185.0

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 CHANGED
@@ -93,6 +93,8 @@ Abstract base class for details components. Computes `fields` from model decorat
93
93
 
94
94
  The `<smart-details>` component renders a list of model fields decorated with `@Field({ details: true })`. It is a wrapper that delegates to `DetailsStandardComponent` by default and supports an InjectionToken (`DETAILS_STANDARD_COMPONENT_TOKEN`) to replace the default rendering with a custom implementation.
95
95
 
96
+ Text fields (`DetailTextComponent` and `DetailTextPresetComponent`) render their HTML through Angular's sanitizer: scripts, event handlers, iframes, SVG, `javascript:` links and inline `style` attributes (for example from the rich-text editor) are removed. To render raw HTML for a field you trust, return `SafeHtml` from your own `cellPipe` (`DomSanitizer.bypassSecurityTrustHtml(html) as unknown as string`, since `ICellPipe.transform` is typed as `string`).
97
+
96
98
  **Wrapper:** `DetailsComponent` (selector: `smart-details`)
97
99
  **Default:** `DetailsStandardComponent` (selector: `smart-details-standard`)
98
100
  **Token:** `DETAILS_STANDARD_COMPONENT_TOKEN` — provide a `Type<DetailsBaseComponent<T>>` to override the default.
@@ -8461,11 +8461,11 @@ class DetailTextComponent extends DetailBaseComponent {
8461
8461
  : key
8462
8462
  : $safeNavigationMigration(options()?.cellPipe)
8463
8463
  )?.value
8464
- ) | smartTrustHtml
8464
+ )
8465
8465
  "
8466
8466
  ></p>
8467
8467
  }
8468
- `, isInline: true, dependencies: [{ kind: "pipe", type: ListCellPipe, name: "smartListCell" }, { kind: "pipe", type: TrustHtmlPipe, name: "smartTrustHtml" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
8468
+ `, isInline: true, dependencies: [{ kind: "pipe", type: ListCellPipe, name: "smartListCell" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
8469
8469
  }
8470
8470
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DetailTextComponent, decorators: [{
8471
8471
  type: Component,
@@ -8485,13 +8485,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
8485
8485
  : key
8486
8486
  : $safeNavigationMigration(options()?.cellPipe)
8487
8487
  )?.value
8488
- ) | smartTrustHtml
8488
+ )
8489
8489
  "
8490
8490
  ></p>
8491
8491
  }
8492
8492
  `,
8493
8493
  changeDetection: ChangeDetectionStrategy.Eager,
8494
- imports: [ListCellPipe, TrustHtmlPipe],
8494
+ imports: [ListCellPipe],
8495
8495
  }]
8496
8496
  }] });
8497
8497
 
@@ -9537,16 +9537,12 @@ class DetailTextPresetComponent extends DetailTextComponent {
9537
9537
  @if (item && key) {
9538
9538
  @let value = (item | smartListCell: key : options()?.cellPipe)?.value;
9539
9539
  @if (value) {
9540
- <p
9541
- data-role="text"
9542
- [class]="textClasses()"
9543
- [innerHTML]="value | smartTrustHtml"
9544
- ></p>
9540
+ <p data-role="text" [class]="textClasses()" [innerHTML]="value"></p>
9545
9541
  } @else {
9546
9542
  <p data-role="empty" [class]="emptyClasses()">—</p>
9547
9543
  }
9548
9544
  }
9549
- `, isInline: true, dependencies: [{ kind: "pipe", type: ListCellPipe, name: "smartListCell" }, { kind: "pipe", type: TrustHtmlPipe, name: "smartTrustHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9545
+ `, isInline: true, dependencies: [{ kind: "pipe", type: ListCellPipe, name: "smartListCell" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
9550
9546
  }
9551
9547
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DetailTextPresetComponent, decorators: [{
9552
9548
  type: Component,
@@ -9558,17 +9554,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
9558
9554
  @if (item && key) {
9559
9555
  @let value = (item | smartListCell: key : options()?.cellPipe)?.value;
9560
9556
  @if (value) {
9561
- <p
9562
- data-role="text"
9563
- [class]="textClasses()"
9564
- [innerHTML]="value | smartTrustHtml"
9565
- ></p>
9557
+ <p data-role="text" [class]="textClasses()" [innerHTML]="value"></p>
9566
9558
  } @else {
9567
9559
  <p data-role="empty" [class]="emptyClasses()">—</p>
9568
9560
  }
9569
9561
  }
9570
9562
  `,
9571
- imports: [ListCellPipe, TrustHtmlPipe],
9563
+ imports: [ListCellPipe],
9572
9564
  changeDetection: ChangeDetectionStrategy.OnPush,
9573
9565
  encapsulation: ViewEncapsulation.None,
9574
9566
  }]