cps-ui-kit 21.10.0 → 21.12.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/fesm2022/cps-ui-kit.mjs +757 -185
- package/fesm2022/cps-ui-kit.mjs.map +1 -1
- package/package.json +2 -2
- package/styles/_mixins.scss +7 -2
- package/types/cps-ui-kit.d.ts +205 -46
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cps-ui-kit",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.12.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^21.2.6",
|
|
6
6
|
"@angular/core": "^21.2.6",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"lodash-es": "^4.17.21",
|
|
13
13
|
"primeng": "^21.1.3",
|
|
14
14
|
"rxjs": "^7.8.2",
|
|
15
|
-
"zone.js": "^0.15.1"
|
|
15
|
+
"zone.js": "^0.15.1 || ^0.16.0"
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
package/styles/_mixins.scss
CHANGED
|
@@ -22,12 +22,17 @@
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
&::before {
|
|
25
|
-
inset:
|
|
25
|
+
inset: #{-$inner-offset};
|
|
26
26
|
border: $inner-width solid var(--cps-color-calm);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
&::after {
|
|
30
|
-
inset:
|
|
30
|
+
inset: #{-$outer-offset};
|
|
31
31
|
border: $outer-width solid var(--cps-color-calm-highlighten);
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
&.suppress-focus-visible::before,
|
|
35
|
+
&.suppress-focus-visible::after {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
33
38
|
}
|
package/types/cps-ui-kit.d.ts
CHANGED
|
@@ -145,11 +145,11 @@ declare class CpsTooltipDirective implements OnInit, OnDestroy {
|
|
|
145
145
|
private _showTimeout?;
|
|
146
146
|
private _hideTimeout?;
|
|
147
147
|
private _ariaTarget?;
|
|
148
|
-
private readonly _tooltipId;
|
|
149
148
|
private _rootFontSizePx;
|
|
150
149
|
private window;
|
|
151
150
|
private _elementRef;
|
|
152
151
|
private _document;
|
|
152
|
+
private _platformId;
|
|
153
153
|
private _domSanitizer;
|
|
154
154
|
constructor();
|
|
155
155
|
ngOnInit(): void;
|
|
@@ -174,7 +174,6 @@ declare class CpsTooltipDirective implements OnInit, OnDestroy {
|
|
|
174
174
|
private _getCoords;
|
|
175
175
|
private _getCoordsForPosition;
|
|
176
176
|
private _focusableIn;
|
|
177
|
-
private _getNextFocusableAfterTrigger;
|
|
178
177
|
private _resolveAriaTarget;
|
|
179
178
|
private _announce;
|
|
180
179
|
static ɵfac: i0.ɵɵFactoryDeclaration<CpsTooltipDirective, never>;
|
|
@@ -189,6 +188,7 @@ type VoidListener$1 = () => void | null | undefined;
|
|
|
189
188
|
*/
|
|
190
189
|
type CpsMenuItem = {
|
|
191
190
|
title?: string;
|
|
191
|
+
ariaLabel?: string;
|
|
192
192
|
action?: (event?: any) => void;
|
|
193
193
|
icon?: string;
|
|
194
194
|
desc?: string;
|
|
@@ -207,6 +207,7 @@ declare enum CpsMenuHideReason {
|
|
|
207
207
|
CLICK_ITEM = "click-item",
|
|
208
208
|
CLICK_OUTSIDE = "click-outside",
|
|
209
209
|
KEYDOWN_ESCAPE = "keydown-escape",
|
|
210
|
+
KEYDOWN_TAB = "keydown-tab",
|
|
210
211
|
SCROLL = "scroll",
|
|
211
212
|
RESIZE = "resize",
|
|
212
213
|
TARGET_NOT_CONNECTED = "target-not-connected"
|
|
@@ -231,9 +232,16 @@ declare class CpsMenuComponent implements AfterViewInit, OnDestroy, OnChanges {
|
|
|
231
232
|
overlayService: OverlayService;
|
|
232
233
|
/**
|
|
233
234
|
* Header title of the menu.
|
|
235
|
+
* Only applies when items are provided.
|
|
234
236
|
* @group Props
|
|
235
237
|
*/
|
|
236
238
|
header: string;
|
|
239
|
+
/**
|
|
240
|
+
* Aria label for the menu component, used for accessibility, it takes precedence over header.
|
|
241
|
+
* Only applies when items are provided.
|
|
242
|
+
* @group Props
|
|
243
|
+
*/
|
|
244
|
+
ariaLabel: string;
|
|
237
245
|
/**
|
|
238
246
|
* An array of menu items.
|
|
239
247
|
* @group Props
|
|
@@ -250,7 +258,7 @@ declare class CpsMenuComponent implements AfterViewInit, OnDestroy, OnChanges {
|
|
|
250
258
|
*/
|
|
251
259
|
compressed: boolean;
|
|
252
260
|
/**
|
|
253
|
-
* Determines whether the menu should
|
|
261
|
+
* Determines whether the menu should move focus to its first item (or first focusable element) when opened.
|
|
254
262
|
* @group Props
|
|
255
263
|
*/
|
|
256
264
|
focusOnShow: boolean;
|
|
@@ -296,6 +304,11 @@ declare class CpsMenuComponent implements AfterViewInit, OnDestroy, OnChanges {
|
|
|
296
304
|
* @group Emits
|
|
297
305
|
*/
|
|
298
306
|
contentClicked: EventEmitter<any>;
|
|
307
|
+
/**
|
|
308
|
+
* Callback to invoke when the mouse leaves the menu container.
|
|
309
|
+
* @group Emits
|
|
310
|
+
*/
|
|
311
|
+
containerMouseLeave: EventEmitter<MouseEvent>;
|
|
299
312
|
withIcons: boolean;
|
|
300
313
|
autoZIndex: boolean;
|
|
301
314
|
baseZIndex: number;
|
|
@@ -317,6 +330,9 @@ declare class CpsMenuComponent implements AfterViewInit, OnDestroy, OnChanges {
|
|
|
317
330
|
resizeObserver: ResizeObserver;
|
|
318
331
|
itemsClasses: string[];
|
|
319
332
|
hideReason: CpsMenuHideReason | undefined;
|
|
333
|
+
private _openedByKeyboard;
|
|
334
|
+
private readonly _cpsFocusService;
|
|
335
|
+
private _menuArrow?;
|
|
320
336
|
private window;
|
|
321
337
|
constructor(document: Document, platformId: any, el: ElementRef, renderer: Renderer2, cd: ChangeDetectorRef, zone: NgZone, primeNG: PrimeNG, overlayService: OverlayService);
|
|
322
338
|
ngOnChanges(changes: SimpleChanges): void;
|
|
@@ -327,6 +343,7 @@ declare class CpsMenuComponent implements AfterViewInit, OnDestroy, OnChanges {
|
|
|
327
343
|
hide(reason?: CpsMenuHideReason): void;
|
|
328
344
|
isVisible(): boolean;
|
|
329
345
|
onItemClick(event: any, item: CpsMenuItem): void;
|
|
346
|
+
onItemKeydown(event: KeyboardEvent, item: CpsMenuItem): void;
|
|
330
347
|
bindDocumentKeydownListener(): void;
|
|
331
348
|
unbindDocumentKeydownListener(): void;
|
|
332
349
|
bindDocumentClickListener(): void;
|
|
@@ -341,6 +358,12 @@ declare class CpsMenuComponent implements AfterViewInit, OnDestroy, OnChanges {
|
|
|
341
358
|
onAnimationStart(event: AnimationEvent): void;
|
|
342
359
|
onAnimationEnd(event: AnimationEvent): void;
|
|
343
360
|
focus(): void;
|
|
361
|
+
private _focusTarget;
|
|
362
|
+
private _getMenuItems;
|
|
363
|
+
private _navigateItems;
|
|
364
|
+
private _focusFirstItem;
|
|
365
|
+
private _focusLastItem;
|
|
366
|
+
private _focusableIn;
|
|
344
367
|
onWindowResize(): void;
|
|
345
368
|
bindDocumentResizeListener(): void;
|
|
346
369
|
unbindDocumentResizeListener(): void;
|
|
@@ -350,7 +373,7 @@ declare class CpsMenuComponent implements AfterViewInit, OnDestroy, OnChanges {
|
|
|
350
373
|
private _destroy;
|
|
351
374
|
ngOnDestroy(): void;
|
|
352
375
|
static ɵfac: i0.ɵɵFactoryDeclaration<CpsMenuComponent, never>;
|
|
353
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CpsMenuComponent, "cps-menu", never, { "header": { "alias": "header"; "required": false; }; "items": { "alias": "items"; "required": false; }; "withArrow": { "alias": "withArrow"; "required": false; }; "compressed": { "alias": "compressed"; "required": false; }; "focusOnShow": { "alias": "focusOnShow"; "required": false; }; "persistent": { "alias": "persistent"; "required": false; }; "containerClass": { "alias": "containerClass"; "required": false; }; "showTransitionOptions": { "alias": "showTransitionOptions"; "required": false; }; "hideTransitionOptions": { "alias": "hideTransitionOptions"; "required": false; }; }, { "menuShown": "menuShown"; "menuHidden": "menuHidden"; "beforeMenuHidden": "beforeMenuHidden"; "contentClicked": "contentClicked"; }, never, ["*"], true, never>;
|
|
376
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CpsMenuComponent, "cps-menu", never, { "header": { "alias": "header"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "items": { "alias": "items"; "required": false; }; "withArrow": { "alias": "withArrow"; "required": false; }; "compressed": { "alias": "compressed"; "required": false; }; "focusOnShow": { "alias": "focusOnShow"; "required": false; }; "persistent": { "alias": "persistent"; "required": false; }; "containerClass": { "alias": "containerClass"; "required": false; }; "showTransitionOptions": { "alias": "showTransitionOptions"; "required": false; }; "hideTransitionOptions": { "alias": "hideTransitionOptions"; "required": false; }; }, { "menuShown": "menuShown"; "menuHidden": "menuHidden"; "beforeMenuHidden": "beforeMenuHidden"; "contentClicked": "contentClicked"; "containerMouseLeave": "containerMouseLeave"; }, never, ["*"], true, never>;
|
|
354
377
|
}
|
|
355
378
|
|
|
356
379
|
/**
|
|
@@ -365,6 +388,7 @@ type CpsAutocompleteAppearanceType = 'outlined' | 'underlined' | 'borderless';
|
|
|
365
388
|
declare class CpsAutocompleteComponent implements ControlValueAccessor, OnInit, OnChanges, AfterViewInit, OnDestroy {
|
|
366
389
|
private _control;
|
|
367
390
|
private document;
|
|
391
|
+
private platformId;
|
|
368
392
|
private cdRef;
|
|
369
393
|
private _labelByValue;
|
|
370
394
|
/**
|
|
@@ -643,7 +667,7 @@ declare class CpsAutocompleteComponent implements ControlValueAccessor, OnInit,
|
|
|
643
667
|
private _destroy$;
|
|
644
668
|
private _options;
|
|
645
669
|
private _optionIds;
|
|
646
|
-
constructor(_control: NgControl, document: Document, cdRef: ChangeDetectorRef, _labelByValue: LabelByValuePipe);
|
|
670
|
+
constructor(_control: NgControl, document: Document, platformId: object, cdRef: ChangeDetectorRef, _labelByValue: LabelByValuePipe);
|
|
647
671
|
ngOnInit(): void;
|
|
648
672
|
ngOnChanges(changes: SimpleChanges): void;
|
|
649
673
|
ngAfterViewInit(): void;
|
|
@@ -697,7 +721,7 @@ declare class CpsAutocompleteComponent implements ControlValueAccessor, OnInit,
|
|
|
697
721
|
private _confirmInput;
|
|
698
722
|
private _removeLastValue;
|
|
699
723
|
private _pxToRem;
|
|
700
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CpsAutocompleteComponent, [{ optional: true; self: true; }, null, null, null]>;
|
|
724
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CpsAutocompleteComponent, [{ optional: true; self: true; }, null, null, null, null]>;
|
|
701
725
|
static ɵcmp: i0.ɵɵComponentDeclaration<CpsAutocompleteComponent, "cps-autocomplete", never, { "label": { "alias": "label"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "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; }; "validating": { "alias": "validating"; "required": false; }; "_value": { "alias": "value"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, { "valueChanged": "valueChanged"; "inputChanged": "inputChanged"; "focused": "focused"; "blurred": "blurred"; }, never, never, true, never>;
|
|
702
726
|
}
|
|
703
727
|
|
|
@@ -720,6 +744,7 @@ type CpsButtonToggleOption = {
|
|
|
720
744
|
declare class CpsButtonToggleComponent implements ControlValueAccessor, OnInit, OnChanges {
|
|
721
745
|
private _control;
|
|
722
746
|
private document;
|
|
747
|
+
private platformId;
|
|
723
748
|
private renderer;
|
|
724
749
|
private cdr;
|
|
725
750
|
/**
|
|
@@ -802,7 +827,7 @@ declare class CpsButtonToggleComponent implements ControlValueAccessor, OnInit,
|
|
|
802
827
|
valueChanged: EventEmitter<any>;
|
|
803
828
|
largestButtonWidthRem: number;
|
|
804
829
|
private _rootFontSizePx;
|
|
805
|
-
constructor(_control: NgControl, document: Document, renderer: Renderer2, cdr: ChangeDetectorRef);
|
|
830
|
+
constructor(_control: NgControl, document: Document, platformId: object, renderer: Renderer2, cdr: ChangeDetectorRef);
|
|
806
831
|
ngOnInit(): void;
|
|
807
832
|
ngOnChanges(): void;
|
|
808
833
|
onChange: (event: any) => void;
|
|
@@ -815,7 +840,7 @@ declare class CpsButtonToggleComponent implements ControlValueAccessor, OnInit,
|
|
|
815
840
|
private _updateValue;
|
|
816
841
|
private _setEqualWidths;
|
|
817
842
|
private _pxToRem;
|
|
818
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CpsButtonToggleComponent, [{ optional: true; self: true; }, null, null, null]>;
|
|
843
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CpsButtonToggleComponent, [{ optional: true; self: true; }, null, null, null, null]>;
|
|
819
844
|
static ɵcmp: i0.ɵɵComponentDeclaration<CpsButtonToggleComponent, "cps-button-toggle", never, { "label": { "alias": "label"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "options": { "alias": "options"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "mandatory": { "alias": "mandatory"; "required": false; }; "equalWidths": { "alias": "equalWidths"; "required": false; }; "optionTooltipPosition": { "alias": "optionTooltipPosition"; "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; }; "_value": { "alias": "value"; "required": false; }; }, { "valueChanged": "valueChanged"; }, never, never, true, never>;
|
|
820
845
|
}
|
|
821
846
|
|
|
@@ -2620,7 +2645,7 @@ type CpsSidebarMenuItem = {
|
|
|
2620
2645
|
* CpsSidebarMenuComponent is a vertical menu panel component displayed at the edge of the screen.
|
|
2621
2646
|
* @group Components
|
|
2622
2647
|
*/
|
|
2623
|
-
declare class CpsSidebarMenuComponent
|
|
2648
|
+
declare class CpsSidebarMenuComponent {
|
|
2624
2649
|
private _router;
|
|
2625
2650
|
/**
|
|
2626
2651
|
* An array of menu items.
|
|
@@ -2637,19 +2662,28 @@ declare class CpsSidebarMenuComponent implements OnInit {
|
|
|
2637
2662
|
* @group Props
|
|
2638
2663
|
*/
|
|
2639
2664
|
exactRoutes: boolean;
|
|
2665
|
+
/**
|
|
2666
|
+
* Aria label for the sidebar, used for accessibility.
|
|
2667
|
+
* @group Props
|
|
2668
|
+
*/
|
|
2669
|
+
ariaLabel: string;
|
|
2640
2670
|
/**
|
|
2641
2671
|
* Height of the sidebar, of type number denoting pixels or string.
|
|
2642
2672
|
* @group Props
|
|
2673
|
+
* @default 100%
|
|
2643
2674
|
*/
|
|
2644
|
-
height:
|
|
2675
|
+
height: i0.InputSignal<string | number>;
|
|
2645
2676
|
allMenus?: QueryList<CpsMenuComponent>;
|
|
2677
|
+
focusedItemWithMenu: CpsSidebarMenuItem | null;
|
|
2646
2678
|
constructor(_router: Router);
|
|
2647
|
-
|
|
2648
|
-
|
|
2679
|
+
cvtHeight: i0.Signal<string>;
|
|
2680
|
+
showMenu(event: MouseEvent | FocusEvent, menu: CpsMenuComponent, item?: CpsSidebarMenuItem): void;
|
|
2681
|
+
toggleMenu(event: MouseEvent, menu: CpsMenuComponent, item: CpsSidebarMenuItem): void;
|
|
2682
|
+
leaveMenu(event: MouseEvent | FocusEvent, menu: CpsMenuComponent): void;
|
|
2649
2683
|
isActive(item: CpsSidebarMenuItem): boolean;
|
|
2650
2684
|
toggleSidebar(): void;
|
|
2651
2685
|
static ɵfac: i0.ɵɵFactoryDeclaration<CpsSidebarMenuComponent, never>;
|
|
2652
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CpsSidebarMenuComponent, "cps-sidebar-menu", never, { "items": { "alias": "items"; "required": false; }; "isExpanded": { "alias": "isExpanded"; "required": false; }; "exactRoutes": { "alias": "exactRoutes"; "required": false; }; "height": { "alias": "height"; "required": false; }; }, {}, never, never, true, never>;
|
|
2686
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CpsSidebarMenuComponent, "cps-sidebar-menu", never, { "items": { "alias": "items"; "required": false; }; "isExpanded": { "alias": "isExpanded"; "required": false; }; "exactRoutes": { "alias": "exactRoutes"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
2653
2687
|
}
|
|
2654
2688
|
|
|
2655
2689
|
/**
|
|
@@ -5216,6 +5250,13 @@ declare class CpsDialogContentDirective {
|
|
|
5216
5250
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CpsDialogContentDirective, "[cpsDialogContent]", never, {}, {}, never, never, true, never>;
|
|
5217
5251
|
}
|
|
5218
5252
|
|
|
5253
|
+
/**
|
|
5254
|
+
* Defines the auto-focus target when the dialog opens.
|
|
5255
|
+
* - 'dialog' - focuses the dialog container itself
|
|
5256
|
+
* - 'first-tabbable' - focuses the first tabbable element inside the dialog
|
|
5257
|
+
* @group Types
|
|
5258
|
+
*/
|
|
5259
|
+
type CpsDialogAutoFocusTarget = 'dialog' | 'first-tabbable';
|
|
5219
5260
|
/**
|
|
5220
5261
|
* Configuration for the dialog service.
|
|
5221
5262
|
* @group Interface
|
|
@@ -5258,33 +5299,50 @@ declare class CpsDialogConfig<T = any> {
|
|
|
5258
5299
|
*/
|
|
5259
5300
|
showHeaderBottomBorder?: boolean;
|
|
5260
5301
|
/**
|
|
5261
|
-
* Identifies the element
|
|
5302
|
+
* Identifies the element that labels the element it is applied to. Takes precedence over ariaLabel.
|
|
5262
5303
|
*/
|
|
5263
5304
|
ariaLabelledBy?: string;
|
|
5264
5305
|
/**
|
|
5265
|
-
*
|
|
5306
|
+
* Defines a string value that labels the dialog for assistive technologies when no visible title or ariaLabelledBy is present.
|
|
5266
5307
|
*/
|
|
5267
|
-
|
|
5308
|
+
ariaLabel?: string;
|
|
5268
5309
|
/**
|
|
5269
|
-
*
|
|
5310
|
+
* Identifies the element that describes the dialog content for assistive technologies.
|
|
5270
5311
|
*/
|
|
5271
|
-
|
|
5312
|
+
ariaDescribedBy?: string;
|
|
5272
5313
|
/**
|
|
5273
|
-
*
|
|
5314
|
+
* Defines which element receives focus when the dialog opens.
|
|
5315
|
+
* - 'dialog' - focuses the dialog container
|
|
5316
|
+
* - 'first-tabbable' / true - focuses the first tabbable element
|
|
5317
|
+
* - string (a CSS selector) - focuses the first matching element
|
|
5318
|
+
* - false - disables auto-focus
|
|
5319
|
+
* @default true
|
|
5274
5320
|
*/
|
|
5275
|
-
|
|
5321
|
+
autoFocus?: CpsDialogAutoFocusTarget | string | boolean;
|
|
5276
5322
|
/**
|
|
5277
|
-
*
|
|
5323
|
+
* Width of the dialog, a number denoting pixels or a string.
|
|
5278
5324
|
*/
|
|
5279
|
-
|
|
5325
|
+
width?: number | string;
|
|
5280
5326
|
/**
|
|
5281
|
-
*
|
|
5327
|
+
* Height of the dialog, a number denoting pixels or a string.
|
|
5282
5328
|
*/
|
|
5283
|
-
|
|
5329
|
+
height?: number | string;
|
|
5330
|
+
/**
|
|
5331
|
+
* Min-width of the dialog, a number denoting pixels or a string.
|
|
5332
|
+
*/
|
|
5333
|
+
minWidth?: number | string;
|
|
5334
|
+
/**
|
|
5335
|
+
* Min-height of the dialog, a number denoting pixels or a string.
|
|
5336
|
+
*/
|
|
5337
|
+
minHeight?: number | string;
|
|
5338
|
+
/**
|
|
5339
|
+
* Max-width of the dialog, a number denoting pixels or a string.
|
|
5340
|
+
*/
|
|
5341
|
+
maxWidth?: number | string;
|
|
5284
5342
|
/**
|
|
5285
|
-
* Max-height of the dialog.
|
|
5343
|
+
* Max-height of the dialog, a number denoting pixels or a string.
|
|
5286
5344
|
*/
|
|
5287
|
-
maxHeight?: string;
|
|
5345
|
+
maxHeight?: number | string;
|
|
5288
5346
|
/**
|
|
5289
5347
|
* Specifies if pressing escape key should hide the dialog.
|
|
5290
5348
|
*/
|
|
@@ -5355,12 +5413,14 @@ declare class CpsDialogConfig<T = any> {
|
|
|
5355
5413
|
keepInViewport?: boolean;
|
|
5356
5414
|
/**
|
|
5357
5415
|
* Minimum value for the left coordinate of dialog in dragging.
|
|
5416
|
+
* A number is treated as pixels, a string must use 'px' or 'rem' units (e.g. '2rem', '32px').
|
|
5358
5417
|
*/
|
|
5359
|
-
minX?: number;
|
|
5418
|
+
minX?: number | string;
|
|
5360
5419
|
/**
|
|
5361
5420
|
* Minimum value for the top coordinate of dialog in dragging.
|
|
5421
|
+
* A number is treated as pixels, a string must use 'px' or 'rem' units (e.g. '2rem', '32px').
|
|
5362
5422
|
*/
|
|
5363
|
-
minY?: number;
|
|
5423
|
+
minY?: number | string;
|
|
5364
5424
|
/**
|
|
5365
5425
|
* Determines whether the dialog can be displayed full screen.
|
|
5366
5426
|
*/
|
|
@@ -5377,7 +5437,7 @@ declare class CpsDialogConfig<T = any> {
|
|
|
5377
5437
|
|
|
5378
5438
|
type Nullable<T = void> = T | null | undefined;
|
|
5379
5439
|
type VoidListener = () => void | null | undefined;
|
|
5380
|
-
declare class CpsDialogComponent implements AfterViewInit, OnDestroy {
|
|
5440
|
+
declare class CpsDialogComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
5381
5441
|
private document;
|
|
5382
5442
|
private platformId;
|
|
5383
5443
|
private _dialogRef;
|
|
@@ -5399,6 +5459,7 @@ declare class CpsDialogComponent implements AfterViewInit, OnDestroy {
|
|
|
5399
5459
|
maskViewChild: Nullable<ElementRef>;
|
|
5400
5460
|
contentViewChild: Nullable<ElementRef>;
|
|
5401
5461
|
headerViewChild: Nullable<ElementRef>;
|
|
5462
|
+
dragHandleViewChild: Nullable<ElementRef>;
|
|
5402
5463
|
childComponentType: Nullable<Type<any>>;
|
|
5403
5464
|
container: Nullable<HTMLDivElement>;
|
|
5404
5465
|
wrapper: Nullable<HTMLElement>;
|
|
@@ -5409,12 +5470,27 @@ declare class CpsDialogComponent implements AfterViewInit, OnDestroy {
|
|
|
5409
5470
|
documentResizeEndListener: VoidListener | null;
|
|
5410
5471
|
documentDragListener: VoidListener | null;
|
|
5411
5472
|
documentDragEndListener: VoidListener | null;
|
|
5473
|
+
private _focusTrapTeardown;
|
|
5474
|
+
private _keyboardDragging;
|
|
5475
|
+
private _keyboardResizing;
|
|
5476
|
+
private _previouslyFocusedElement;
|
|
5477
|
+
private _shouldRestoreFocus;
|
|
5412
5478
|
_openStateChanged: EventEmitter<void>;
|
|
5413
|
-
_dragStarted: EventEmitter<MouseEvent>;
|
|
5414
|
-
_dragEnded: EventEmitter<MouseEvent>;
|
|
5415
|
-
_resizeStarted: EventEmitter<MouseEvent>;
|
|
5416
|
-
_resizeEnded: EventEmitter<MouseEvent>;
|
|
5479
|
+
_dragStarted: EventEmitter<KeyboardEvent | MouseEvent>;
|
|
5480
|
+
_dragEnded: EventEmitter<KeyboardEvent | MouseEvent>;
|
|
5481
|
+
_resizeStarted: EventEmitter<KeyboardEvent | MouseEvent>;
|
|
5482
|
+
_resizeEnded: EventEmitter<KeyboardEvent | MouseEvent>;
|
|
5417
5483
|
_maximizedStateChanged: EventEmitter<boolean>;
|
|
5484
|
+
private _rootFontSizePx;
|
|
5485
|
+
private _openedByKeyboard;
|
|
5486
|
+
private readonly _cpsFocusService;
|
|
5487
|
+
get ariaLabel(): string | null;
|
|
5488
|
+
get cvtWidth(): string;
|
|
5489
|
+
get cvtHeight(): string;
|
|
5490
|
+
get cvtMinWidth(): string;
|
|
5491
|
+
get cvtMinHeight(): string;
|
|
5492
|
+
get cvtMaxWidth(): string;
|
|
5493
|
+
get cvtMaxHeight(): string;
|
|
5418
5494
|
get minX(): number;
|
|
5419
5495
|
get minY(): number;
|
|
5420
5496
|
get keepInViewport(): boolean;
|
|
@@ -5425,18 +5501,25 @@ declare class CpsDialogComponent implements AfterViewInit, OnDestroy {
|
|
|
5425
5501
|
set style(value: any);
|
|
5426
5502
|
get position(): string;
|
|
5427
5503
|
get parent(): Element | undefined;
|
|
5428
|
-
constructor(document: Document, platformId:
|
|
5504
|
+
constructor(document: Document, platformId: object, _dialogRef: CpsDialogRef, _cdRef: ChangeDetectorRef, renderer: Renderer2, config: CpsDialogConfig, zone: NgZone, primeNG: PrimeNG);
|
|
5505
|
+
ngOnInit(): void;
|
|
5429
5506
|
ngAfterViewInit(): void;
|
|
5507
|
+
ngOnDestroy(): void;
|
|
5430
5508
|
loadChildComponent(componentType: Type<any>): void;
|
|
5431
5509
|
moveOnTop(): void;
|
|
5432
5510
|
onAnimationStart(event: AnimationEvent): void;
|
|
5433
5511
|
onAnimationEnd(event: AnimationEvent): void;
|
|
5434
5512
|
onContainerDestroy(): void;
|
|
5513
|
+
isCloseDisabled(): boolean;
|
|
5435
5514
|
close(): void;
|
|
5436
5515
|
hide(): void;
|
|
5437
5516
|
enableModality(): void;
|
|
5438
5517
|
disableModality(): void;
|
|
5439
|
-
focus(): void;
|
|
5518
|
+
focus(afterFocus?: () => void): void;
|
|
5519
|
+
onResizeHandleKeydown(event: KeyboardEvent): void;
|
|
5520
|
+
onResizeHandleKeyup(event: KeyboardEvent): void;
|
|
5521
|
+
onHeaderKeyup(event: KeyboardEvent): void;
|
|
5522
|
+
onHeaderKeydown(event: KeyboardEvent): void;
|
|
5440
5523
|
toggleMaximized(value?: boolean): void;
|
|
5441
5524
|
initResize(event: MouseEvent): void;
|
|
5442
5525
|
onResize(event: MouseEvent): void;
|
|
@@ -5455,8 +5538,12 @@ declare class CpsDialogComponent implements AfterViewInit, OnDestroy {
|
|
|
5455
5538
|
unbindGlobalListeners(): void;
|
|
5456
5539
|
bindDocumentEscapeListener(): void;
|
|
5457
5540
|
unbindDocumentEscapeListener(): void;
|
|
5541
|
+
bindFocusTrapListener(): void;
|
|
5542
|
+
unbindFocusTrapListener(): void;
|
|
5458
5543
|
unbindMaskClickListener(): void;
|
|
5459
|
-
|
|
5544
|
+
private _pxToRem;
|
|
5545
|
+
private _toPx;
|
|
5546
|
+
private _clampDragPos;
|
|
5460
5547
|
static ɵfac: i0.ɵɵFactoryDeclaration<CpsDialogComponent, never>;
|
|
5461
5548
|
static ɵcmp: i0.ɵɵComponentDeclaration<CpsDialogComponent, "cps-dialog", never, {}, {}, never, never, true, never>;
|
|
5462
5549
|
}
|
|
@@ -5526,31 +5613,31 @@ declare class CpsDialogRef<T = any> {
|
|
|
5526
5613
|
private readonly _onDragStart;
|
|
5527
5614
|
/**
|
|
5528
5615
|
* Event triggered on drag start.
|
|
5529
|
-
* @param {MouseEvent} event - Mouse event.
|
|
5616
|
+
* @param {MouseEvent | KeyboardEvent} event - Mouse or keyboard event.
|
|
5530
5617
|
* @group Events
|
|
5531
5618
|
*/
|
|
5532
|
-
onDragStart: Observable<MouseEvent>;
|
|
5619
|
+
onDragStart: Observable<MouseEvent | KeyboardEvent>;
|
|
5533
5620
|
private readonly _onDragEnd;
|
|
5534
5621
|
/**
|
|
5535
5622
|
* Event triggered on drag end.
|
|
5536
|
-
* @param {MouseEvent} event - Mouse event.
|
|
5623
|
+
* @param {MouseEvent | KeyboardEvent} event - Mouse or keyboard event.
|
|
5537
5624
|
* @group Events
|
|
5538
5625
|
*/
|
|
5539
|
-
onDragEnd: Observable<MouseEvent>;
|
|
5626
|
+
onDragEnd: Observable<MouseEvent | KeyboardEvent>;
|
|
5540
5627
|
private readonly _onResizeStart;
|
|
5541
5628
|
/**
|
|
5542
5629
|
* Event triggered on resize start.
|
|
5543
|
-
* @param {MouseEvent} event - Mouse event.
|
|
5630
|
+
* @param {MouseEvent | KeyboardEvent} event - Mouse or keyboard event.
|
|
5544
5631
|
* @group Events
|
|
5545
5632
|
*/
|
|
5546
|
-
onResizeStart: Observable<MouseEvent>;
|
|
5633
|
+
onResizeStart: Observable<MouseEvent | KeyboardEvent>;
|
|
5547
5634
|
private readonly _onResizeEnd;
|
|
5548
5635
|
/**
|
|
5549
5636
|
* Event triggered on resize end.
|
|
5550
|
-
* @param {MouseEvent} event - Mouse event.
|
|
5637
|
+
* @param {MouseEvent | KeyboardEvent} event - Mouse or keyboard event.
|
|
5551
5638
|
* @group Events
|
|
5552
5639
|
*/
|
|
5553
|
-
onResizeEnd: Observable<MouseEvent>;
|
|
5640
|
+
onResizeEnd: Observable<MouseEvent | KeyboardEvent>;
|
|
5554
5641
|
private readonly _onMaximize;
|
|
5555
5642
|
/**
|
|
5556
5643
|
* Event triggered on dialog maximized state changed.
|
|
@@ -5723,6 +5810,78 @@ declare class CpsNotificationService {
|
|
|
5723
5810
|
static ɵprov: i0.ɵɵInjectableDeclaration<CpsNotificationService>;
|
|
5724
5811
|
}
|
|
5725
5812
|
|
|
5813
|
+
/**
|
|
5814
|
+
* CpsFocusService manages focus-related concerns:
|
|
5815
|
+
* - Tracks the most recent user input modality (keyboard vs. pointer)
|
|
5816
|
+
* - Focuses elements with conditional focus-ring suppression
|
|
5817
|
+
* - Traps focus within a container (e.g. a modal dialog)
|
|
5818
|
+
*
|
|
5819
|
+
* Only active in browser environments; no-ops under SSR.
|
|
5820
|
+
*
|
|
5821
|
+
* @example
|
|
5822
|
+
* ```ts
|
|
5823
|
+
* readonly focusService = inject(CpsFocusService);
|
|
5824
|
+
* readonly showFocusRing = computed(() => this.focusService.isKeyboard());
|
|
5825
|
+
* ```
|
|
5826
|
+
*/
|
|
5827
|
+
declare class CpsFocusService {
|
|
5828
|
+
private readonly _platformId;
|
|
5829
|
+
private readonly _document;
|
|
5830
|
+
/**
|
|
5831
|
+
* A signal reflecting the most recently detected input modality.
|
|
5832
|
+
* - `'keyboard'` — set when a navigation key (Tab, Enter, Space, Arrow keys,
|
|
5833
|
+
* Home, End, PageUp, PageDown) is pressed.
|
|
5834
|
+
* - `'pointer'` — set on every `pointerdown` event (mouse, touch, stylus).
|
|
5835
|
+
*
|
|
5836
|
+
* Defaults to `'pointer'`.
|
|
5837
|
+
*/
|
|
5838
|
+
readonly lastInput: i0.WritableSignal<"keyboard" | "pointer">;
|
|
5839
|
+
/**
|
|
5840
|
+
* Returns `true` when the most recently detected input was keyboard.
|
|
5841
|
+
* Shorthand for `lastInput() === 'keyboard'`.
|
|
5842
|
+
*/
|
|
5843
|
+
isKeyboard(): boolean;
|
|
5844
|
+
/**
|
|
5845
|
+
* Focuses `el`, conditionally suppressing the focus-visible ring.
|
|
5846
|
+
*
|
|
5847
|
+
* When `showFocusRing` is `false`, adds the `suppress-focus-visible` CSS
|
|
5848
|
+
* class to the element before focusing and removes it on the next `blur`
|
|
5849
|
+
* event. This keeps the UI clean for pointer-initiated closes.
|
|
5850
|
+
*/
|
|
5851
|
+
focusElement(el: HTMLElement, showFocusRing: boolean): void;
|
|
5852
|
+
/**
|
|
5853
|
+
* Installs a Tab key focus trap on `container`.
|
|
5854
|
+
*
|
|
5855
|
+
* @param container - The element to trap focus within.
|
|
5856
|
+
* @param getFocusableElements - Returns the ordered list of tabbable
|
|
5857
|
+
* elements inside `container`. Defaults to a native CSS-selector-based
|
|
5858
|
+
* implementation. Pass `DomHandler.getFocusableElements` (PrimeNG) or any
|
|
5859
|
+
* custom function when richer querying is needed.
|
|
5860
|
+
* @returns A teardown function — call it to remove the trap listener.
|
|
5861
|
+
*/
|
|
5862
|
+
trapFocus(container: HTMLElement, getFocusableElements?: (el: HTMLElement) => HTMLElement[]): () => void;
|
|
5863
|
+
private readonly _navigationKeys;
|
|
5864
|
+
constructor();
|
|
5865
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CpsFocusService, never>;
|
|
5866
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CpsFocusService>;
|
|
5867
|
+
}
|
|
5868
|
+
/**
|
|
5869
|
+
* Injection token for the focus managing service.
|
|
5870
|
+
*
|
|
5871
|
+
* By default it resolves to the singleton {@link CpsFocusService}.
|
|
5872
|
+
* Consumer applications can override it to:
|
|
5873
|
+
* - Supply a custom subclass
|
|
5874
|
+
* - Provide `null` to disable dynamic tracking entirely
|
|
5875
|
+
*
|
|
5876
|
+
* @example Disable dynamic tracking:
|
|
5877
|
+
* ```typescript
|
|
5878
|
+
* providers: [
|
|
5879
|
+
* { provide: CPS_FOCUS_SERVICE, useValue: null }
|
|
5880
|
+
* ]
|
|
5881
|
+
* ```
|
|
5882
|
+
*/
|
|
5883
|
+
declare const CPS_FOCUS_SERVICE: InjectionToken<CpsFocusService | null>;
|
|
5884
|
+
|
|
5726
5885
|
/**
|
|
5727
5886
|
* Available theme options
|
|
5728
5887
|
* @group Types
|
|
@@ -5850,5 +6009,5 @@ declare const getCpsColors: (_document: Document) => [string, string][];
|
|
|
5850
6009
|
declare const getCSSColor: (val: string, _document: Document) => string;
|
|
5851
6010
|
declare const getTextColor: (backgroundColor: string) => string;
|
|
5852
6011
|
|
|
5853
|
-
export { CPS_RADIO_GROUP, CpsAutocompleteComponent, CpsButtonComponent, CpsButtonToggleComponent, CpsCheckboxComponent, CpsChipComponent, CpsColumnFilterMatchMode, CpsDatepickerComponent, CpsDialogConfig, CpsDialogRef, CpsDialogService, CpsDividerComponent, CpsExpansionPanelComponent, CpsFileUploadComponent, CpsIconComponent, CpsInfoCircleComponent, CpsInputComponent, CpsLoaderComponent, CpsMenuComponent, CpsMenuHideReason, CpsNotificationAppearance, CpsNotificationPosition, CpsNotificationService, CpsPaginatePipe, CpsPaginatorComponent, CpsProgressCircularComponent, CpsProgressLinearComponent, CpsRadioComponent, CpsRadioGroupComponent, CpsSchedulerComponent, CpsSelectComponent, CpsSidebarMenuComponent, CpsSwitchComponent, CpsTabComponent, CpsTabGroupComponent, CpsTableColumnFilterDirective, CpsTableColumnResizableDirective, CpsTableColumnSortableDirective, CpsTableComponent, CpsTableDetectFilterTypePipe, CpsTableHeaderSelectableDirective, CpsTableRowSelectableDirective, CpsTagComponent, CpsTextareaComponent, CpsThemeService, CpsTimepickerComponent, CpsTooltipDirective, CpsTreeAutocompleteComponent, CpsTreeSelectComponent, CpsTreeTableColumnFilterDirective, CpsTreeTableColumnResizableDirective, CpsTreeTableColumnSortableDirective, CpsTreeTableComponent, CpsTreeTableDetectFilterTypePipe, CpsTreeTableHeaderSelectableDirective, CpsTreeTableRowSelectableDirective, CpsTreetableRowTogglerDirective, ICONS_PATH, getCSSColor, getCpsColors, getTextColor, iconNames, tableFactory, treeTableFactory };
|
|
5854
|
-
export type { CpsAutocompleteAppearanceType, CpsBaseTheme, CpsButtonToggleOption, CpsColorTheme, CpsColumnFilterCategoryOption, CpsColumnFilterType, CpsDatepickerAppearanceType, CpsDividerType, CpsInputAppearanceType, CpsMenuAttachPosition, CpsMenuItem, CpsNotificationConfig, CpsRadioOption, CpsRadiusTheme, CpsSelectAppearanceType, CpsSidebarMenuItem, CpsTabChangeEvent, CpsTableExportFormat, CpsTableSize, CpsTableSortMode, CpsTableToolbarSize, CpsTabsAlignmentType, CpsTabsAnimationType, CpsTheme, CpsTime, CpsTooltipOpenOn, CpsTooltipPosition, CpsTreeAutocompleteAppearanceType, CpsTreeSelectAppearanceType, CpsTreeTableSize, CpsTreeTableSortMode, CpsTreeTableToolbarSize, IconType, iconSizeType };
|
|
6012
|
+
export { CPS_FOCUS_SERVICE, CPS_RADIO_GROUP, CpsAutocompleteComponent, CpsButtonComponent, CpsButtonToggleComponent, CpsCheckboxComponent, CpsChipComponent, CpsColumnFilterMatchMode, CpsDatepickerComponent, CpsDialogConfig, CpsDialogRef, CpsDialogService, CpsDividerComponent, CpsExpansionPanelComponent, CpsFileUploadComponent, CpsFocusService, CpsIconComponent, CpsInfoCircleComponent, CpsInputComponent, CpsLoaderComponent, CpsMenuComponent, CpsMenuHideReason, CpsNotificationAppearance, CpsNotificationPosition, CpsNotificationService, CpsPaginatePipe, CpsPaginatorComponent, CpsProgressCircularComponent, CpsProgressLinearComponent, CpsRadioComponent, CpsRadioGroupComponent, CpsSchedulerComponent, CpsSelectComponent, CpsSidebarMenuComponent, CpsSwitchComponent, CpsTabComponent, CpsTabGroupComponent, CpsTableColumnFilterDirective, CpsTableColumnResizableDirective, CpsTableColumnSortableDirective, CpsTableComponent, CpsTableDetectFilterTypePipe, CpsTableHeaderSelectableDirective, CpsTableRowSelectableDirective, CpsTagComponent, CpsTextareaComponent, CpsThemeService, CpsTimepickerComponent, CpsTooltipDirective, CpsTreeAutocompleteComponent, CpsTreeSelectComponent, CpsTreeTableColumnFilterDirective, CpsTreeTableColumnResizableDirective, CpsTreeTableColumnSortableDirective, CpsTreeTableComponent, CpsTreeTableDetectFilterTypePipe, CpsTreeTableHeaderSelectableDirective, CpsTreeTableRowSelectableDirective, CpsTreetableRowTogglerDirective, ICONS_PATH, getCSSColor, getCpsColors, getTextColor, iconNames, tableFactory, treeTableFactory };
|
|
6013
|
+
export type { CpsAutocompleteAppearanceType, CpsBaseTheme, CpsButtonToggleOption, CpsColorTheme, CpsColumnFilterCategoryOption, CpsColumnFilterType, CpsDatepickerAppearanceType, CpsDialogAutoFocusTarget, CpsDividerType, CpsInputAppearanceType, CpsMenuAttachPosition, CpsMenuItem, CpsNotificationConfig, CpsRadioOption, CpsRadiusTheme, CpsSelectAppearanceType, CpsSidebarMenuItem, CpsTabChangeEvent, CpsTableExportFormat, CpsTableSize, CpsTableSortMode, CpsTableToolbarSize, CpsTabsAlignmentType, CpsTabsAnimationType, CpsTheme, CpsTime, CpsTooltipOpenOn, CpsTooltipPosition, CpsTreeAutocompleteAppearanceType, CpsTreeSelectAppearanceType, CpsTreeTableSize, CpsTreeTableSortMode, CpsTreeTableToolbarSize, IconType, iconSizeType };
|