cps-ui-kit 17.26.0 → 17.27.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.
@@ -1,10 +1,10 @@
1
- import { AfterViewInit, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
1
+ import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { ControlValueAccessor, NgControl } from '@angular/forms';
3
3
  import { IconType, iconSizeType } from '../cps-icon/cps-icon.component';
4
4
  import { LabelByValuePipe } from '../../pipes/internal/label-by-value.pipe';
5
5
  import { VirtualScroller } from 'primeng/virtualscroller';
6
6
  import { CpsTooltipPosition } from '../../directives/cps-tooltip/cps-tooltip.directive';
7
- import { CpsMenuComponent } from '../cps-menu/cps-menu.component';
7
+ import { CpsMenuComponent, CpsMenuHideReason } from '../cps-menu/cps-menu.component';
8
8
  import * as i0 from "@angular/core";
9
9
  /**
10
10
  * CpsAutocompleteAppearanceType is used to define the border of the autocomplete input.
@@ -17,6 +17,7 @@ export type CpsAutocompleteAppearanceType = 'outlined' | 'underlined' | 'borderl
17
17
  */
18
18
  export declare class CpsAutocompleteComponent implements ControlValueAccessor, OnInit, OnChanges, AfterViewInit, OnDestroy {
19
19
  private _control;
20
+ private cdRef;
20
21
  private _labelByValue;
21
22
  /**
22
23
  * Label of the autocomplete component.
@@ -260,6 +261,7 @@ export declare class CpsAutocompleteComponent implements ControlValueAccessor, O
260
261
  virtualList: VirtualScroller;
261
262
  optionsMenu: CpsMenuComponent;
262
263
  optionsList: ElementRef;
264
+ autocompleteInput: ElementRef;
263
265
  error: string;
264
266
  cvtWidth: string;
265
267
  isOpened: boolean;
@@ -277,7 +279,7 @@ export declare class CpsAutocompleteComponent implements ControlValueAccessor, O
277
279
  private _inputChangeSubject$;
278
280
  private _destroy$;
279
281
  private _options;
280
- constructor(_control: NgControl, _labelByValue: LabelByValuePipe);
282
+ constructor(_control: NgControl, cdRef: ChangeDetectorRef, _labelByValue: LabelByValuePipe);
281
283
  ngOnInit(): void;
282
284
  ngOnChanges(changes: SimpleChanges): void;
283
285
  ngAfterViewInit(): void;
@@ -295,7 +297,8 @@ export declare class CpsAutocompleteComponent implements ControlValueAccessor, O
295
297
  setDisabledState(disabled: boolean): void;
296
298
  onBlur(): void;
297
299
  onFocus(): void;
298
- onBeforeOptionsHidden(): void;
300
+ isActive(): boolean;
301
+ onBeforeOptionsHidden(reason: CpsMenuHideReason): void;
299
302
  onBoxClick(): void;
300
303
  onContainerKeyDown(event: any): void;
301
304
  onInputKeyDown(event: any): void;
@@ -318,6 +321,6 @@ export declare class CpsAutocompleteComponent implements ControlValueAccessor, O
318
321
  private _navigateOptionsByArrows;
319
322
  private _confirmInput;
320
323
  private _removeLastValue;
321
- static ɵfac: i0.ɵɵFactoryDeclaration<CpsAutocompleteComponent, [{ optional: true; self: true; }, null]>;
324
+ static ɵfac: i0.ɵɵFactoryDeclaration<CpsAutocompleteComponent, [{ optional: true; self: true; }, null, null]>;
322
325
  static ɵcmp: i0.ɵɵComponentDeclaration<CpsAutocompleteComponent, "cps-autocomplete", never, { "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "returnObject": { "alias": "returnObject"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "width": { "alias": "width"; "required": false; }; "selectAll": { "alias": "selectAll"; "required": false; }; "showChevron": { "alias": "showChevron"; "required": false; }; "withOptionsAliases": { "alias": "withOptionsAliases"; "required": false; }; "useOptionsAliasesWhenNoMatch": { "alias": "useOptionsAliasesWhenNoMatch"; "required": false; }; "optionAlias": { "alias": "optionAlias"; "required": false; }; "chips": { "alias": "chips"; "required": false; }; "closableChips": { "alias": "closableChips"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "openOnClear": { "alias": "openOnClear"; "required": false; }; "keepInitialOrder": { "alias": "keepInitialOrder"; "required": false; }; "optionLabel": { "alias": "optionLabel"; "required": false; }; "optionValue": { "alias": "optionValue"; "required": false; }; "optionInfo": { "alias": "optionInfo"; "required": false; }; "hideDetails": { "alias": "hideDetails"; "required": false; }; "persistentClear": { "alias": "persistentClear"; "required": false; }; "prefixIcon": { "alias": "prefixIcon"; "required": false; }; "prefixIconSize": { "alias": "prefixIconSize"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "loadingMessage": { "alias": "loadingMessage"; "required": false; }; "showLoadingMessage": { "alias": "showLoadingMessage"; "required": false; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; }; "showEmptyMessage": { "alias": "showEmptyMessage"; "required": false; }; "virtualScroll": { "alias": "virtualScroll"; "required": false; }; "numToleratedItems": { "alias": "numToleratedItems"; "required": false; }; "externalError": { "alias": "externalError"; "required": false; }; "infoTooltip": { "alias": "infoTooltip"; "required": false; }; "infoTooltipClass": { "alias": "infoTooltipClass"; "required": false; }; "infoTooltipMaxWidth": { "alias": "infoTooltipMaxWidth"; "required": false; }; "infoTooltipPersistent": { "alias": "infoTooltipPersistent"; "required": false; }; "infoTooltipPosition": { "alias": "infoTooltipPosition"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "emptyOptionIndex": { "alias": "emptyOptionIndex"; "required": false; }; "inputChangeDebounceTime": { "alias": "inputChangeDebounceTime"; "required": false; }; "_value": { "alias": "value"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "valueChanged": "valueChanged"; "inputChanged": "inputChanged"; "focused": "focused"; "blurred": "blurred"; }, never, never, true, never>;
323
326
  }
@@ -1,4 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
+ /**
3
+ * CpsDividerType is used to define the type of the divider.
4
+ * @group Types
5
+ */
6
+ export type CpsDividerType = 'solid' | 'dashed' | 'dotted';
2
7
  /**
3
8
  * CpsDividerComponent is a component that can be used to separate content.
4
9
  * @group Components
@@ -14,13 +19,19 @@ export declare class CpsDividerComponent {
14
19
  * @group Props
15
20
  */
16
21
  color: import("@angular/core").InputSignal<string>;
22
+ /**
23
+ * Type of the divider.
24
+ * @group Props
25
+ */
26
+ type: import("@angular/core").InputSignal<CpsDividerType>;
17
27
  /**
18
28
  * Thickness of the divider, a number denoting pixels or a string.
19
29
  * @group Props
20
30
  */
21
31
  thickness: import("@angular/core").InputSignal<string | number>;
22
- private _dividerColor;
23
- private _dividerThickness;
32
+ private _borderTop;
33
+ private _borderRight;
34
+ private _constructBorder;
24
35
  static ɵfac: i0.ɵɵFactoryDeclaration<CpsDividerComponent, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<CpsDividerComponent, "cps-divider", never, { "vertical": { "alias": "vertical"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "thickness": { "alias": "thickness"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<CpsDividerComponent, "cps-divider", never, { "vertical": { "alias": "vertical"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "thickness": { "alias": "thickness"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
26
37
  }
@@ -20,6 +20,20 @@ export type CpsMenuItem = {
20
20
  disabled?: boolean;
21
21
  loading?: boolean;
22
22
  };
23
+ /**
24
+ * An enumeration of the different reasons for hiding the menu.
25
+ * @group Enums
26
+ */
27
+ export declare enum CpsMenuHideReason {
28
+ FORCED = "forced",
29
+ TOGGLE = "toggle",
30
+ CLICK_ITEM = "click-item",
31
+ CLICK_OUTSIDE = "click-outside",
32
+ KEYDOWN_ESCAPE = "keydown-escape",
33
+ SCROLL = "scroll",
34
+ RESIZE = "resize",
35
+ TARGET_NOT_CONNECTED = "target-not-connected"
36
+ }
23
37
  /**
24
38
  * CpsMenuAttachPosition is used to define attachment position of the CpsMenuComponent.
25
39
  * @group Types
@@ -90,14 +104,16 @@ export declare class CpsMenuComponent implements AfterViewInit, OnDestroy, OnCha
90
104
  menuShown: EventEmitter<any>;
91
105
  /**
92
106
  * Callback to invoke when menu is hidden.
107
+ * @param {CpsMenuHideReason} CpsMenuHideReason - reason for hiding the menu.
93
108
  * @group Emits
94
109
  */
95
- menuHidden: EventEmitter<any>;
110
+ menuHidden: EventEmitter<CpsMenuHideReason>;
96
111
  /**
97
112
  * Callback to invoke before menu is hidden.
113
+ * @param {CpsMenuHideReason} CpsMenuHideReason - reason for hiding the menu.
98
114
  * @group Emits
99
115
  */
100
- beforeMenuHidden: EventEmitter<any>;
116
+ beforeMenuHidden: EventEmitter<CpsMenuHideReason>;
101
117
  /**
102
118
  * Callback to invoke when content is clicked.
103
119
  * @group Emits
@@ -123,13 +139,14 @@ export declare class CpsMenuComponent implements AfterViewInit, OnDestroy, OnCha
123
139
  overlaySubscription: Subscription | undefined;
124
140
  resizeObserver: ResizeObserver;
125
141
  itemsClasses: string[];
142
+ hideReason: CpsMenuHideReason | undefined;
126
143
  constructor(document: Document, platformId: any, el: ElementRef, renderer: Renderer2, cd: ChangeDetectorRef, zone: NgZone, config: PrimeNGConfig, overlayService: OverlayService);
127
144
  ngOnChanges(changes: SimpleChanges): void;
128
145
  ngAfterViewInit(): void;
129
146
  private _setItemsClasses;
130
147
  toggle(event?: any, target?: any, pos?: CpsMenuAttachPosition): void;
131
148
  show(event?: any, target?: any, pos?: CpsMenuAttachPosition): void;
132
- hide(): void;
149
+ hide(reason?: CpsMenuHideReason): void;
133
150
  isVisible(): boolean;
134
151
  onItemClick(event: any, item: CpsMenuItem): void;
135
152
  bindDocumentKeydownListener(): void;
@@ -1,6 +1,7 @@
1
- import { AfterViewInit, ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
1
+ import { AfterViewInit, ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
2
2
  import { NgControl } from '@angular/forms';
3
3
  import { TreeNode } from 'primeng/api';
4
+ import { CpsMenuHideReason } from '../cps-menu/cps-menu.component';
4
5
  import { CpsBaseTreeDropdownComponent } from '../internal/cps-base-tree-dropdown/cps-base-tree-dropdown.component';
5
6
  import * as i0 from "@angular/core";
6
7
  /**
@@ -30,6 +31,7 @@ export declare class CpsTreeAutocompleteComponent extends CpsBaseTreeDropdownCom
30
31
  * @group Props
31
32
  */
32
33
  placeholder: string;
34
+ treeAutocompleteInput: ElementRef;
33
35
  inputText: string;
34
36
  backspaceClickedOnce: boolean;
35
37
  activeSingle: boolean;
@@ -38,11 +40,13 @@ export declare class CpsTreeAutocompleteComponent extends CpsBaseTreeDropdownCom
38
40
  ngAfterViewInit(): void;
39
41
  ngOnDestroy(): void;
40
42
  onSelectNode(): void;
41
- onBeforeOptionsHidden(): void;
43
+ onBlur(): void;
44
+ onBeforeOptionsHidden(reason: CpsMenuHideReason): void;
42
45
  onBoxClick(): void;
43
46
  onContainerKeyDown(event: any): void;
44
47
  onInputKeyDown(event: any): void;
45
48
  onChevronClick(event: any): void;
49
+ isActive(): boolean;
46
50
  remove(option: TreeNode): void;
47
51
  clear(event?: any): void;
48
52
  focusInput(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cps-ui-kit",
3
- "version": "17.26.0",
3
+ "version": "17.27.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.0",
6
6
  "@angular/core": "^17.3.0",