@js-smart/ng-kit 21.4.0 → 21.5.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.4.0",
3
+ "version": "21.5.0",
4
4
  "license": "MIT",
5
5
  "author": "Pavan Kumar Jadda",
6
6
  "private": false,
@@ -45,4 +45,4 @@
45
45
  "default": "./fesm2022/js-smart-ng-kit.mjs"
46
46
  }
47
47
  }
48
- }
48
+ }
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, ChangeDetectorRef, OnDestroy, OnChanges, AfterContentChecked, ElementRef, SimpleChanges, ViewContainerRef, ComponentRef, WritableSignal } from '@angular/core';
2
+ import { OnInit, ChangeDetectorRef, OnDestroy, OnChanges, ElementRef, SimpleChanges, ViewContainerRef, ComponentRef, WritableSignal } from '@angular/core';
3
3
  import { BehaviorSubject, Observable, Subject } from 'rxjs';
4
4
  import { ThemePalette, MatOptionSelectionChange } from '@angular/material/core';
5
5
  import { ControlValueAccessor, FormControl } from '@angular/forms';
@@ -257,22 +257,23 @@ declare class SpinnerComponent {
257
257
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpinnerComponent, "spinner,lib-spinner", never, { "bootstrapSpinner": { "alias": "bootstrapSpinner"; "required": false; "isSignal": true; }; "diameter": { "alias": "diameter"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
258
258
  }
259
259
 
260
+ type AutocompleteOption = Record<string, any>;
260
261
  /**
261
262
  * Reusable Auto Complete component that extends MatAutoComplete to show Clear icon and Arrow buttons
262
263
  *
263
264
  * @author Pavan Kumar Jadda
264
265
  * @since 12.0.0
265
266
  */
266
- declare class AutocompleteComponent implements OnInit, OnChanges, AfterContentChecked, ControlValueAccessor {
267
+ declare class AutocompleteComponent implements OnInit, OnChanges, ControlValueAccessor {
267
268
  /**
268
269
  * Gets reference inputAutoComplete HTML attribute
269
270
  */
270
271
  inputAutoComplete: ElementRef;
271
- cdRef: ChangeDetectorRef;
272
+ private destroyRef;
272
273
  /**
273
274
  * Internal form control for the autocomplete
274
275
  */
275
- control: FormControl<string | null>;
276
+ control: FormControl<string | AutocompleteOption | null>;
276
277
  /**
277
278
  * Label of the AutoComplete
278
279
  */
@@ -284,7 +285,7 @@ declare class AutocompleteComponent implements OnInit, OnChanges, AfterContentCh
284
285
  /**
285
286
  * Appearance of the AutoComplete, defaults to `fill`
286
287
  */
287
- appearance: _angular_core.InputSignal<string>;
288
+ appearance: _angular_core.InputSignal<"fill" | "outline">;
288
289
  /**
289
290
  * List of CSS classes that need to applied to autocomplete
290
291
  */
@@ -300,7 +301,7 @@ declare class AutocompleteComponent implements OnInit, OnChanges, AfterContentCh
300
301
  /**
301
302
  * Function that maps an option's control value to its display value in the trigger.
302
303
  */
303
- displayWith: ((value: any) => string) | null;
304
+ displayWith: _angular_core.InputSignal<((value: string | AutocompleteOption) => string) | null>;
304
305
  /**
305
306
  * Specifies if the autocomplete is required. Default is not required.
306
307
  */
@@ -309,37 +310,87 @@ declare class AutocompleteComponent implements OnInit, OnChanges, AfterContentCh
309
310
  * Specifies if the autocomplete is disabled. Default is not required.
310
311
  */
311
312
  disabled: _angular_core.InputSignal<boolean>;
313
+ /**
314
+ * Text displayed when no options match the input. Defaults to 'No options'
315
+ */
316
+ noOptionsText: _angular_core.InputSignal<string>;
317
+ /**
318
+ * Whether the autocomplete is in a loading state. Shows a loading message instead of options
319
+ */
320
+ loading: _angular_core.InputSignal<boolean>;
321
+ /**
322
+ * Text displayed when the autocomplete is in a loading state. Defaults to 'Loading...'
323
+ */
324
+ loadingText: _angular_core.InputSignal<string>;
312
325
  /**
313
326
  * List of Objects that need to be bind and searched for
314
327
  */
315
- data: _angular_core.InputSignal<any[] | string[] | undefined>;
328
+ data: _angular_core.InputSignal<(string | AutocompleteOption)[] | undefined>;
316
329
  /**
317
330
  * Emit selected value on selection changes
318
331
  */
319
- onSelectionChange: _angular_core.OutputEmitterRef<any>;
332
+ onSelectionChange: _angular_core.OutputEmitterRef<string | AutocompleteOption>;
320
333
  /**
321
- * BehaviorSubject that shows the current active arrow icon
334
+ * Signal that tracks the current arrow icon state
322
335
  */
323
- arrowIconSubject: BehaviorSubject<string>;
336
+ arrowIcon: _angular_core.WritableSignal<string>;
324
337
  /**
325
338
  * Filtered options when user types
326
339
  */
327
- filteredOptions: Observable<any[] | undefined> | undefined;
328
- writeValue(value: any): void;
329
- registerOnChange(fn: any): void;
330
- registerOnTouched(fn: any): void;
340
+ filteredOptions: Observable<(string | AutocompleteOption)[] | undefined> | undefined;
341
+ /**
342
+ * Writes a new value to the control
343
+ */
344
+ writeValue(value: string | AutocompleteOption): void;
345
+ /**
346
+ * Registers a callback function that is called when the control's value changes
347
+ */
348
+ registerOnChange(fn: (value: string | AutocompleteOption | null) => void): void;
349
+ /**
350
+ * Registers a callback function that is called when the control is touched
351
+ */
352
+ registerOnTouched(fn: () => void): void;
353
+ /**
354
+ * Sets the disabled state of the control
355
+ */
331
356
  setDisabledState(isDisabled: boolean): void;
332
- ngAfterContentChecked(): void;
357
+ /**
358
+ * Initializes the filtered options observable pipeline
359
+ */
333
360
  ngOnInit(): void;
361
+ /**
362
+ * Binds the displayFn to the component context on input changes
363
+ */
334
364
  ngOnChanges(_changes: SimpleChanges): void;
335
- clearInput(evt: any): void;
336
- openOrClosePanel(evt: any, trigger: MatAutocompleteTrigger): void;
337
- displayFn(object: any): string;
365
+ /**
366
+ * Clears the input value, resets the control, and re-focuses the input
367
+ */
368
+ clearInput(evt: Event): void;
369
+ /**
370
+ * Toggles the autocomplete panel open or closed
371
+ */
372
+ openOrClosePanel(evt: Event, trigger: MatAutocompleteTrigger): void;
373
+ /**
374
+ * Returns the display value for the given option. Uses custom displayWith function if provided,
375
+ * otherwise falls back to the bindLabel property or the string value itself.
376
+ */
377
+ displayFn(object: string | AutocompleteOption): string;
378
+ /**
379
+ * Emits the selected value and notifies the parent form of the selection change
380
+ */
338
381
  emitSelectedValue($event: MatOptionSelectionChange): void;
382
+ /**
383
+ * Updates the arrow icon to point up when the panel opens
384
+ */
385
+ onPanelOpened(): void;
386
+ /**
387
+ * Updates the arrow icon to point down when the panel closes
388
+ */
389
+ onPanelClosed(): void;
339
390
  private onChange;
340
391
  private onTouched;
341
392
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutocompleteComponent, never>;
342
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AutocompleteComponent, "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; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; }, { "onSelectionChange": "onSelectionChange"; }, never, never, true, never>;
393
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AutocompleteComponent, "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; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "noOptionsText": { "alias": "noOptionsText"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; }, { "onSelectionChange": "onSelectionChange"; }, never, never, true, never>;
343
394
  }
344
395
 
345
396
  declare class PrintOptions {
@@ -1080,4 +1131,4 @@ declare const markSuccess: (progressState: WritableSignal<ProgressState>, messag
1080
1131
  declare const markError: (progressState: WritableSignal<ProgressState>, message?: string) => void;
1081
1132
 
1082
1133
  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 };
1083
- export type { AlertType, ConfirmDialogData, MatSnackBarOptions, ProgressState };
1134
+ export type { AlertType, AutocompleteOption, ConfirmDialogData, MatSnackBarOptions, ProgressState };