commons-shared-web-ui 0.0.47 → 0.0.49

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/index.d.ts CHANGED
@@ -688,6 +688,16 @@ interface RichTextConfig {
688
688
  placeholder?: string;
689
689
  maxLength?: number;
690
690
  showCharCount?: boolean;
691
+ /**
692
+ * List of toolbar items to show, in order. Supported tokens:
693
+ * 'bold' | 'italic' | 'underline' | 'strike' | 'blockquote' | 'code' |
694
+ * 'font' | 'size' | 'color' | 'background' | 'align' |
695
+ * 'header1' | 'header2' | 'orderedList' | 'bulletList' |
696
+ * 'subscript' | 'superscript' | 'indentMinus' | 'indentPlus' |
697
+ * 'link' | 'image' | 'video' | 'clean'.
698
+ * Defaults to: ['bold', 'italic', 'underline', 'font', 'size', 'color', 'link', 'image', 'video']
699
+ */
700
+ headerConfig?: string[];
691
701
  }
692
702
  interface ValidationResult {
693
703
  isValid: boolean;
@@ -1494,6 +1504,16 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1494
1504
  get errorMessage(): string;
1495
1505
  get showCharCount(): boolean;
1496
1506
  get remainingCharacters(): number | null;
1507
+ private static readonly RICH_TEXT_TOKEN_MAP;
1508
+ private static readonly DEFAULT_RICH_TEXT_HEADER;
1509
+ /**
1510
+ * Builds the ngx-quill `modules.toolbar` config from `richTextConfig.headerConfig`
1511
+ * (a flat list of tokens) falling back to a curated default set.
1512
+ * Consecutive simple (button) tokens are grouped together; dropdown-style
1513
+ * tokens (font/size/color/...) each get their own group, matching Quill's
1514
+ * expected toolbar shape.
1515
+ */
1516
+ get richTextModules(): any;
1497
1517
  toggleMultiDropdown(event: MouseEvent): void;
1498
1518
  toggleSingleDropdown(event: MouseEvent): void;
1499
1519
  selectSingleOption(option: any): void;
@@ -3447,6 +3467,8 @@ interface TableActionItem {
3447
3467
  confirmationNeeded?: boolean;
3448
3468
  confirmationMessage?: string;
3449
3469
  callback?: (row: any) => void;
3470
+ /** Set to false to hide this action item. Default: true */
3471
+ isEnabled?: boolean;
3450
3472
  /** Config for native 'delete' action type — drives the built-in confirmation modal */
3451
3473
  deleteConfig?: {
3452
3474
  apiUrl: string;
@@ -3469,6 +3491,8 @@ interface TableAction {
3469
3491
  confirmationMessage?: string;
3470
3492
  callback?: (row: any) => void;
3471
3493
  items?: TableActionItem[];
3494
+ /** Set to false to hide this action. Default: true */
3495
+ isEnabled?: boolean;
3472
3496
  }
3473
3497
  interface PaginationConfig {
3474
3498
  enabled: boolean;
@@ -3536,6 +3560,7 @@ interface SearchConfig {
3536
3560
  searchKey?: string;
3537
3561
  debounceTime?: number;
3538
3562
  handling?: 'standard' | 'nested_string';
3563
+ minimumCharacter?: number;
3539
3564
  }
3540
3565
  interface TableLabels {
3541
3566
  searchPlaceholder?: string;
@@ -3912,6 +3937,10 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
3912
3937
  private calculateStickyPositions;
3913
3938
  private toTitleCase;
3914
3939
  get columnCount(): number;
3940
+ /** Filters out actions/action-items explicitly disabled via `isEnabled: false`. */
3941
+ getVisibleActions<T extends {
3942
+ isEnabled?: boolean;
3943
+ }>(actions?: T[] | null): T[];
3915
3944
  get showPagination(): boolean;
3916
3945
  private applyPaginationDefaults;
3917
3946
  onColumnClick(row: any, col: TableColumn): void;
@@ -3931,8 +3960,15 @@ declare class SmartTableComponent implements OnInit, OnChanges, AfterViewInit, O
3931
3960
  }
3932
3961
 
3933
3962
  /**
3934
- * Sanitizes and bypasses Angular's DomSanitizer security for HTML content.
3935
- * Prevents execution of unsafe scripts/attributes while allowing safe rendering of formatting tags in [innerHTML].
3963
+ * Marks rich-text HTML (e.g. from a smart-table "html" column, always sourced from this
3964
+ * app's own rich-text editor output, never arbitrary external/user-supplied markup) as
3965
+ * trusted so [innerHTML] renders it without Angular's default HTML sanitizer stripping it.
3966
+ *
3967
+ * Deliberately does NOT run the value through DomSanitizer.sanitize(SecurityContext.HTML, ...)
3968
+ * first — that sanitizer strips `style` attributes entirely (they're not in its allowlist),
3969
+ * which silently destroyed rich-text formatting like text color and highlight color while
3970
+ * leaving semantic-tag formatting (bold/italic/underline) untouched, since only tags — not
3971
+ * inline styles — survive that pass.
3936
3972
  */
3937
3973
  declare class SafeHtmlPipe implements PipeTransform {
3938
3974
  private sanitizer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commons-shared-web-ui",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "20.3.15",
6
6
  "@angular/cdk": "20.2.14",