@js-smart/ng-kit 21.7.1 → 21.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@js-smart/ng-kit",
3
- "version": "21.7.1",
3
+ "version": "21.9.0",
4
4
  "license": "MIT",
5
5
  "author": "Pavan Kumar Jadda",
6
6
  "private": false,
@@ -1,9 +1,9 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, ChangeDetectorRef, OnDestroy, ElementRef, ViewContainerRef, ComponentRef, WritableSignal } from '@angular/core';
2
+ import { OnInit, ChangeDetectorRef, OnDestroy, ElementRef, AfterViewInit, ViewContainerRef, ComponentRef, WritableSignal } from '@angular/core';
3
3
  import { BehaviorSubject, Observable, Subject } from 'rxjs';
4
4
  import { ThemePalette } from '@angular/material/core';
5
5
  import { ControlValueAccessor, FormControl } from '@angular/forms';
6
- import { MatAutocompleteTrigger } from '@angular/material/autocomplete';
6
+ import { MatAutocompleteTrigger, MatAutocomplete } from '@angular/material/autocomplete';
7
7
  import { MatFormFieldAppearance } from '@angular/material/form-field';
8
8
  import { MatPaginator } from '@angular/material/paginator';
9
9
  import { MatTableDataSource } from '@angular/material/table';
@@ -267,6 +267,8 @@ declare class SpinnerComponent {
267
267
  declare class AutocompleteComponent<T = string> implements ControlValueAccessor {
268
268
  /** Gets reference to the MatAutocompleteTrigger to programmatically open/close the panel */
269
269
  autocompleteTrigger: _angular_core.Signal<MatAutocompleteTrigger>;
270
+ /** MatAutocomplete instance (used to scroll the selected option into view when the panel opens) */
271
+ matAutocomplete: _angular_core.Signal<MatAutocomplete>;
270
272
  /** Gets reference to the input element for re-focusing after clear */
271
273
  inputElement: _angular_core.Signal<ElementRef<HTMLInputElement>>;
272
274
  /** Label of the autocomplete form field */
@@ -293,8 +295,10 @@ declare class AutocompleteComponent<T = string> implements ControlValueAccessor
293
295
  noOptionsText: _angular_core.InputSignal<string>;
294
296
  /** Emits the selected value when an option is picked from the dropdown */
295
297
  selectionChange: _angular_core.OutputEmitterRef<T>;
298
+ /** Emits the raw text in the input on each keystroke (filter text while typing) */
299
+ onInputChange: _angular_core.OutputEmitterRef<string>;
296
300
  /** Internal form control for the autocomplete input */
297
- control: FormControl<string | null>;
301
+ control: FormControl<string | T | null>;
298
302
  /** Signal that tracks whether the autocomplete panel is currently open */
299
303
  isExpanded: _angular_core.WritableSignal<boolean>;
300
304
  /** Signal that tracks the current filter text typed by the user */
@@ -337,6 +341,9 @@ declare class AutocompleteComponent<T = string> implements ControlValueAccessor
337
341
  * and re-focuses the input element.
338
342
  */
339
343
  clearInput(event: Event): void;
344
+ /** Runs when the autocomplete overlay opens: keep expanded state and scroll the selected option into view. */
345
+ onPanelOpened(): void;
346
+ private scrollSelectedOptionIntoView;
340
347
  /** Opens the autocomplete panel programmatically */
341
348
  openPanel(): void;
342
349
  /**
@@ -349,7 +356,49 @@ declare class AutocompleteComponent<T = string> implements ControlValueAccessor
349
356
  /** Callback function registered by the parent form to propagate touched state */
350
357
  private onTouched;
351
358
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutocompleteComponent<any>, never>;
352
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AutocompleteComponent<any>, "autocomplete, lib-autocomplete", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "noOptionsText": { "alias": "noOptionsText"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; }, never, never, true, never>;
359
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AutocompleteComponent<any>, "autocomplete, lib-autocomplete", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "classes": { "alias": "classes"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "noOptionsText": { "alias": "noOptionsText"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "onInputChange": "onInputChange"; }, never, never, true, never>;
360
+ }
361
+
362
+ /**
363
+ * Single directive that adds clear and dropdown-toggle icon buttons to a
364
+ * Material autocomplete input. Unlike {@link LibAutocompleteActionsDirective},
365
+ * this directive is applied directly to the `input` element and does not require
366
+ * an anchor directive or a separate suffix component.
367
+ *
368
+ * Usage:
369
+ * ```html
370
+ * <mat-form-field appearance="outline">
371
+ * <mat-label>City</mat-label>
372
+ * <input matInput [matAutocomplete]="auto" formControlName="city" autocompleteSuffix />
373
+ * <mat-autocomplete #auto="matAutocomplete"> … </mat-autocomplete>
374
+ * </mat-form-field>
375
+ * ```
376
+ *
377
+ * @author Pavan Kumar Jadda
378
+ * @since 21.8.0
379
+ */
380
+ declare class AutocompleteSuffixDirective implements AfterViewInit {
381
+ private readonly trigger;
382
+ private readonly el;
383
+ private readonly renderer;
384
+ private readonly destroyRef;
385
+ private readonly ngControl;
386
+ private clearBtn;
387
+ private clearPlaceholder;
388
+ private dropdownIconSpan;
389
+ private isExpanded;
390
+ private readonly unlisten;
391
+ ngAfterViewInit(): void;
392
+ private createSuffixElements;
393
+ private createIconButton;
394
+ private setupListeners;
395
+ private clearInput;
396
+ private togglePanel;
397
+ private updateClearButtonVisibility;
398
+ private scrollSelectedOptionIntoView;
399
+ private updateDropdownIcon;
400
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutocompleteSuffixDirective, never>;
401
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AutocompleteSuffixDirective, "input[matAutocomplete][autocompleteSuffix]", never, {}, {}, never, never, true, never>;
353
402
  }
354
403
 
355
404
  declare class PrintOptions {
@@ -1089,5 +1138,5 @@ declare const markSuccess: (progressState: WritableSignal<ProgressState>, messag
1089
1138
  */
1090
1139
  declare const markError: (progressState: WritableSignal<ProgressState>, message?: string) => void;
1091
1140
 
1092
- export { AlertComponent, AutocompleteComponent, BaseButtonDirective, BsLinkButtonComponent, BsLinkButtonDirective, CloseButtonDirective, ConfirmDialogComponent, DeleteButtonComponent, DeleteButtonDirective, EditBsButtonComponent, EditBsButtonDirective, EditButtonComponent, EditButtonDirective, EditSolidSvgComponent, EditSvgIconButtonComponent, EditSvgIconButtonDirective, EntityStore, ExcelExportButtonComponent, ExcelExportButtonDirective, ManageButtonComponent, ManageButtonDirective, MatSnackBarService, NgxPrintDirective, NgxSpinnerComponent, NgxSpinnerService, PdfExportButtonComponent, PdfExportButtonDirective, PreventMultipleClicksDirective, PrimaryButtonComponent, PrimaryButtonDirective, SavePrimaryButtonComponent, SavePrimaryButtonDirective, SearchButtonComponent, SpinnerComponent, Store, SuccessButtonComponent, SuccessButtonDirective, ViewButtonComponent, ViewButtonDirective, ViewPrimaryButtonComponent, ViewPrimaryButtonDirective, initializeState, markError, markLoading, markSuccess };
1141
+ export { AlertComponent, AutocompleteComponent, AutocompleteSuffixDirective, BaseButtonDirective, BsLinkButtonComponent, BsLinkButtonDirective, CloseButtonDirective, ConfirmDialogComponent, DeleteButtonComponent, DeleteButtonDirective, EditBsButtonComponent, EditBsButtonDirective, EditButtonComponent, EditButtonDirective, EditSolidSvgComponent, EditSvgIconButtonComponent, EditSvgIconButtonDirective, EntityStore, ExcelExportButtonComponent, ExcelExportButtonDirective, ManageButtonComponent, ManageButtonDirective, MatSnackBarService, NgxPrintDirective, NgxSpinnerComponent, NgxSpinnerService, PdfExportButtonComponent, PdfExportButtonDirective, PreventMultipleClicksDirective, PrimaryButtonComponent, PrimaryButtonDirective, SavePrimaryButtonComponent, SavePrimaryButtonDirective, SearchButtonComponent, SpinnerComponent, Store, SuccessButtonComponent, SuccessButtonDirective, ViewButtonComponent, ViewButtonDirective, ViewPrimaryButtonComponent, ViewPrimaryButtonDirective, initializeState, markError, markLoading, markSuccess };
1093
1142
  export type { AlertType, ConfirmDialogData, MatSnackBarOptions, ProgressState };