commons-shared-web-ui 0.0.73 → 0.0.74

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
@@ -519,6 +519,13 @@ interface OptionConfig$1 {
519
519
  showSelectAll?: boolean;
520
520
  /** When true, displays a loading spinner during options API requests. */
521
521
  showLoader?: boolean;
522
+ /**
523
+ * When true, a plain `optionList`-only SINGLE DROPDOWN (no `searchConfig`/`pagination`) renders
524
+ * the same styled overlay/chevron panel used by searchable and paginated dropdowns, instead of
525
+ * a native `<select>` — purely for visual consistency with sibling fields. No search box or
526
+ * pagination is added.
527
+ */
528
+ customUI?: boolean;
522
529
  }
523
530
  interface AutocompleteDisplayField {
524
531
  /** Dot-notation path to the value in the API response item (e.g. 'login', 'contact.phone'). */
@@ -1652,10 +1659,27 @@ declare class FormFieldComponent implements OnInit, AfterViewInit, OnDestroy {
1652
1659
  * object is reused across multiple allowMulti repeater instances.
1653
1660
  */
1654
1661
  localOptionList: any[];
1662
+ /** Snapshot of default (unsearched) options and pagination state for DROPDOWN / AUTOCOMPLETE fields */
1663
+ private defaultStateSnapshot;
1664
+ /** Tracks whether the current localOptionList is filtered by an active server-side search query */
1665
+ private _isServerSearchActive;
1655
1666
  /** Dedicated cache of currently selected option objects */
1656
1667
  selectedItems: any[];
1657
1668
  /** Cache of the latest dependency parameters for server-side autocomplete filtering */
1658
1669
  private _latestDependencyValues;
1670
+ /** True when this field has no optionConfig.dependencies (nothing to satisfy) OR every
1671
+ * dependency's current value is present — false while waiting on a parent field. Guards every
1672
+ * opportunistic reload path (dropdown-open, search-reset, search-clear) so a dependent
1673
+ * dropdown never re-fetches an unfiltered full list just because it was opened/searched before
1674
+ * its parent was chosen — only setupDependencies()'s own reactive load (which always supplies
1675
+ * the real dependency params) is allowed to populate it.
1676
+ * Defaults to true here (fields with no dependencies never get corrected otherwise), but
1677
+ * ngOnInit flips it to false up front for any field that DOES declare dependencies — closing
1678
+ * the window between component creation and setupDependencies()'s first (necessarily async,
1679
+ * via combineLatest) emission, during which a fast dropdown-open would otherwise still see
1680
+ * this stale `true` default and fire an unfiltered fetch before the parent-unmet state is
1681
+ * known. */
1682
+ private _dependenciesSatisfied;
1659
1683
  /** For GROUP fields with allowMulti = true */
1660
1684
  groupFormArray: FormArray;
1661
1685
  /** For GROUP fields with allowMulti = false — single nested FormGroup */
@@ -1718,7 +1742,9 @@ declare class FormFieldComponent implements OnInit, AfterViewInit, OnDestroy {
1718
1742
  isSingleOptionSelected(code: any): boolean;
1719
1743
  /** Whether the dropdown search feature is enabled for this field */
1720
1744
  get isSearchableDropdown(): boolean;
1721
- /** Whether the custom single-select dropdown overlay is required (for search OR pagination) */
1745
+ /** Whether the custom single-select dropdown overlay is required — for search, pagination, or
1746
+ * when optionConfig.customUI opts in to the styled overlay purely for visual consistency with
1747
+ * sibling dropdowns (no search box, no pagination — just the same panel/chevron treatment). */
1722
1748
  get isCustomSingleDropdown(): boolean;
1723
1749
  private initGroupField;
1724
1750
  /**
@@ -1890,6 +1916,8 @@ declare class FormFieldComponent implements OnInit, AfterViewInit, OnDestroy {
1890
1916
  private initDropdownSearch;
1891
1917
  /** Execute client-side or server-side dropdown search. */
1892
1918
  private executeDropdownSearch;
1919
+ /** Restores localOptionList and pagination metadata from defaultStateSnapshot, preserving selected item(s) */
1920
+ private restoreDefaultOptionList;
1893
1921
  /** Resets the dropdown search text and filtered list. */
1894
1922
  resetDropdownSearch(forceLoad?: boolean, bypassCache?: boolean): void;
1895
1923
  /** Merges option(s) from selectedOptionsData into the local dropdown options list */
@@ -2662,6 +2690,9 @@ interface DropdownConfig {
2662
2690
  disabled?: boolean;
2663
2691
  required?: boolean;
2664
2692
  errorMessage?: string;
2693
+ serverSearch?: boolean;
2694
+ searchDebounceMs?: number;
2695
+ lazyLoad?: boolean;
2665
2696
  width?: string;
2666
2697
  height?: string;
2667
2698
  borderRadius?: string;
@@ -2685,7 +2716,7 @@ interface DropdownConfig {
2685
2716
  boxShadow?: string;
2686
2717
  }
2687
2718
 
2688
- declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChanges {
2719
+ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChanges, OnDestroy {
2689
2720
  private el;
2690
2721
  config?: DropdownConfig;
2691
2722
  labels?: DropdownLabels;
@@ -2699,6 +2730,12 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
2699
2730
  disabled: boolean;
2700
2731
  required: boolean;
2701
2732
  errorMessage: string;
2733
+ serverSearch: boolean;
2734
+ searchDebounceMs: number;
2735
+ lazyLoad: boolean;
2736
+ loading: boolean;
2737
+ loadingMore: boolean;
2738
+ hasMore: boolean;
2702
2739
  width?: string;
2703
2740
  height?: string;
2704
2741
  borderRadius?: string;
@@ -2721,6 +2758,8 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
2721
2758
  disabledColor?: string;
2722
2759
  boxShadow?: string;
2723
2760
  selectionChange: EventEmitter<any>;
2761
+ searchTermChange: EventEmitter<string>;
2762
+ loadMore: EventEmitter<void>;
2724
2763
  viewport?: CdkVirtualScrollViewport;
2725
2764
  searchInput?: ElementRef;
2726
2765
  triggerEl?: ElementRef;
@@ -2736,8 +2775,10 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
2736
2775
  };
2737
2776
  onChange: (value: any) => void;
2738
2777
  onTouched: () => void;
2778
+ private search$;
2739
2779
  constructor(el: ElementRef);
2740
2780
  ngOnInit(): void;
2781
+ ngOnDestroy(): void;
2741
2782
  ngOnChanges(changes: SimpleChanges): void;
2742
2783
  private get validOptions();
2743
2784
  private updateFromConfig;
@@ -2758,6 +2799,7 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
2758
2799
  selectOption(option: DropdownOption): void;
2759
2800
  isSelected(option: DropdownOption): boolean;
2760
2801
  onSearch(term: string): void;
2802
+ onOptionsScroll(event: Event): void;
2761
2803
  clearSelection(event?: Event): void;
2762
2804
  getIconType(icon: any): 'material' | 'fontawesome' | 'img' | 'none';
2763
2805
  getIconValue(icon: any): string;
@@ -2776,7 +2818,7 @@ declare class DropdownComponent implements ControlValueAccessor, OnInit, OnChang
2776
2818
  [key: string]: string | undefined;
2777
2819
  };
2778
2820
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownComponent, never>;
2779
- static ɵcmp: i0.ɵɵComponentDeclaration<DropdownComponent, "lib-dropdown", never, { "config": { "alias": "config"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "options": { "alias": "options"; "required": false; }; "selectedValue": { "alias": "selectedValue"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "label": { "alias": "label"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "searchable": { "alias": "searchable"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "borderRadius": { "alias": "borderRadius"; "required": false; }; "fontSize": { "alias": "fontSize"; "required": false; }; "gap": { "alias": "gap"; "required": false; }; "fontFamily": { "alias": "fontFamily"; "required": false; }; "labelColor": { "alias": "labelColor"; "required": false; }; "labelFontSize": { "alias": "labelFontSize"; "required": false; }; "labelFontWeight": { "alias": "labelFontWeight"; "required": false; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; }; "borderColor": { "alias": "borderColor"; "required": false; }; "borderWidth": { "alias": "borderWidth"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; "fontWeight": { "alias": "fontWeight"; "required": false; }; "color": { "alias": "color"; "required": false; }; "placeholderColor": { "alias": "placeholderColor"; "required": false; }; "focusBorderColor": { "alias": "focusBorderColor"; "required": false; }; "errorColor": { "alias": "errorColor"; "required": false; }; "disabledBackgroundColor": { "alias": "disabledBackgroundColor"; "required": false; }; "disabledColor": { "alias": "disabledColor"; "required": false; }; "boxShadow": { "alias": "boxShadow"; "required": false; }; }, { "selectionChange": "selectionChange"; }, never, never, false, never>;
2821
+ static ɵcmp: i0.ɵɵComponentDeclaration<DropdownComponent, "lib-dropdown", never, { "config": { "alias": "config"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; "options": { "alias": "options"; "required": false; }; "selectedValue": { "alias": "selectedValue"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "label": { "alias": "label"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "searchable": { "alias": "searchable"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "serverSearch": { "alias": "serverSearch"; "required": false; }; "searchDebounceMs": { "alias": "searchDebounceMs"; "required": false; }; "lazyLoad": { "alias": "lazyLoad"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingMore": { "alias": "loadingMore"; "required": false; }; "hasMore": { "alias": "hasMore"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "borderRadius": { "alias": "borderRadius"; "required": false; }; "fontSize": { "alias": "fontSize"; "required": false; }; "gap": { "alias": "gap"; "required": false; }; "fontFamily": { "alias": "fontFamily"; "required": false; }; "labelColor": { "alias": "labelColor"; "required": false; }; "labelFontSize": { "alias": "labelFontSize"; "required": false; }; "labelFontWeight": { "alias": "labelFontWeight"; "required": false; }; "backgroundColor": { "alias": "backgroundColor"; "required": false; }; "borderColor": { "alias": "borderColor"; "required": false; }; "borderWidth": { "alias": "borderWidth"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; "fontWeight": { "alias": "fontWeight"; "required": false; }; "color": { "alias": "color"; "required": false; }; "placeholderColor": { "alias": "placeholderColor"; "required": false; }; "focusBorderColor": { "alias": "focusBorderColor"; "required": false; }; "errorColor": { "alias": "errorColor"; "required": false; }; "disabledBackgroundColor": { "alias": "disabledBackgroundColor"; "required": false; }; "disabledColor": { "alias": "disabledColor"; "required": false; }; "boxShadow": { "alias": "boxShadow"; "required": false; }; }, { "selectionChange": "selectionChange"; "searchTermChange": "searchTermChange"; "loadMore": "loadMore"; }, never, never, false, never>;
2780
2822
  }
2781
2823
 
2782
2824
  interface CheckboxOption {
@@ -5278,6 +5320,13 @@ interface HierarchyCfg {
5278
5320
  nodes: Record<string, any>;
5279
5321
  branchSubType: string;
5280
5322
  showLoader: boolean;
5323
+ /** Passed straight through onto every generated level's DROPDOWN optionConfig — same shape as
5324
+ * optionConfig.searchConfig documented in smart-form.md. Lets a large flat MDM level (e.g.
5325
+ * hundreds of districts) be searched instead of scrolled through in full. */
5326
+ searchConfig?: any;
5327
+ /** Passed straight through onto every generated level's DROPDOWN optionConfig — same shape as
5328
+ * optionConfig.pagination documented in smart-form.md (loadMore/infiniteScroll). */
5329
+ pagination?: any;
5281
5330
  }
5282
5331
 
5283
5332
  declare class ValidationUtils {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "commons-shared-web-ui",
3
- "version": "0.0.73",
3
+ "version": "0.0.74",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "20.3.15",
6
6
  "@angular/cdk": "20.2.14",