commons-shared-web-ui 0.0.45 → 0.0.46

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
@@ -360,6 +360,22 @@ interface TimeConfig {
360
360
  */
361
361
  minTimeField?: string;
362
362
  }
363
+ /**
364
+ * Configuration for enabling search functionality inside DROPDOWN fields.
365
+ * Supports both client-side (local) and server-side (remote GET) filtering.
366
+ */
367
+ interface DropdownSearchConfig {
368
+ /** Whether to display a search input inside the dropdown panel. */
369
+ enabled: boolean;
370
+ /** Filtering mode. 'local' filters client-side (default). 'server' queries the API on typing via GET. */
371
+ mode?: 'local' | 'server';
372
+ /** Query parameter key for the search term sent to the API (default: 'search'). Only used in 'server' mode. */
373
+ searchKey?: string;
374
+ /** Minimum characters required before triggering a server-side search (default: 3). Only used in 'server' mode. */
375
+ minSearchLength?: number;
376
+ /** Debounce delay in milliseconds before firing search (default: 300). */
377
+ debounceTime?: number;
378
+ }
363
379
  interface OptionConfig$1 {
364
380
  optionClass?: string;
365
381
  optionUrl?: string;
@@ -375,6 +391,10 @@ interface OptionConfig$1 {
375
391
  sortDirection?: 'ASC' | 'DESC';
376
392
  layout?: 'row' | 'column';
377
393
  optionList?: OptionItem[];
394
+ /** Configuration for enabling search functionality inside the dropdown panel. */
395
+ searchConfig?: DropdownSearchConfig;
396
+ /** When true, renders a 'Select All' checkbox at the top of a MULTIPLE select dropdown. */
397
+ showSelectAll?: boolean;
378
398
  }
379
399
  interface AutocompleteDisplayField {
380
400
  /** Dot-notation path to the value in the API response item (e.g. 'login', 'contact.phone'). */
@@ -1494,6 +1514,10 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1494
1514
  /** Effective maximum time for the time input (explicit maxTime only). */
1495
1515
  get effectiveMaxTime(): string | null;
1496
1516
  isMultiDropdownOpen: boolean;
1517
+ isSingleDropdownOpen: boolean;
1518
+ searchText: string;
1519
+ filteredOptionList: any[];
1520
+ dropdownSearch$: Subject<string>;
1497
1521
  isDragOver: boolean;
1498
1522
  fileUploadError: string;
1499
1523
  multiSaveError: string;
@@ -1585,6 +1609,16 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1585
1609
  get expandLessLabel(): string;
1586
1610
  /** Getter for expand more icon name */
1587
1611
  get expandMoreLabel(): string;
1612
+ /** Getter for dropdown search placeholder label */
1613
+ get searchPlaceholderLabel(): string;
1614
+ /** Getter for Select All label */
1615
+ get selectAllLabel(): string;
1616
+ /** Getter for No matching options label */
1617
+ get noMatchingOptionsLabel(): string;
1618
+ /** Returns the label of the currently selected option for single-select custom dropdowns */
1619
+ get singleSelectedLabel(): string;
1620
+ /** Whether the dropdown search feature is enabled for this field */
1621
+ get isSearchableDropdown(): boolean;
1588
1622
  private initGroupField;
1589
1623
  /**
1590
1624
  * Sets up cross-field validation based on the `onValidate` formula.
@@ -1660,9 +1694,23 @@ declare class FormFieldComponent implements OnInit, OnDestroy {
1660
1694
  get showCharCount(): boolean;
1661
1695
  get remainingCharacters(): number | null;
1662
1696
  toggleMultiDropdown(event: MouseEvent): void;
1697
+ toggleSingleDropdown(event: MouseEvent): void;
1698
+ selectSingleOption(option: any): void;
1663
1699
  onDocumentClick(): void;
1664
1700
  onEscapeKey(): void;
1665
1701
  get multiSelectedCount(): number;
1702
+ /** Initialise the RxJS search stream for dropdown filtering. */
1703
+ private initDropdownSearch;
1704
+ /** Execute client-side or server-side dropdown search. */
1705
+ private executeDropdownSearch;
1706
+ /** Resets the dropdown search text and filtered list. */
1707
+ resetDropdownSearch(): void;
1708
+ /** Returns true if every option in the current filtered list is selected. */
1709
+ isAllSelected(): boolean;
1710
+ /** Returns true if some (but not all) filtered options are selected — for indeterminate state. */
1711
+ isSomeSelected(): boolean;
1712
+ /** Toggles selection of all filtered options. */
1713
+ toggleSelectAll(checked: boolean): void;
1666
1714
  get isTextField(): boolean;
1667
1715
  get isNumberField(): boolean;
1668
1716
  get isDateField(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commons-shared-web-ui",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "20.3.15",
6
6
  "@angular/cdk": "20.2.14",