cps-ui-kit 21.8.0 → 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/fesm2022/cps-ui-kit.mjs +277 -172
- package/fesm2022/cps-ui-kit.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_cps-tooltip-style.scss +11 -5
- package/styles/styles.scss +13 -0
- package/types/cps-ui-kit.d.ts +49 -25
package/package.json
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
|
+
@use './mixins' as *;
|
|
2
|
+
|
|
1
3
|
.cps-tooltip {
|
|
2
4
|
position: absolute;
|
|
3
5
|
top: 0;
|
|
4
6
|
cursor: default;
|
|
5
|
-
font-size:
|
|
6
|
-
background:
|
|
7
|
+
font-size: 0.875rem;
|
|
8
|
+
background: var(--cps-color-bg-light);
|
|
7
9
|
color: var(--cps-color-text-darkest);
|
|
8
10
|
font-family: 'Source Sans Pro', sans-serif;
|
|
9
|
-
border:
|
|
11
|
+
border: 0.0625rem solid var(--cps-color-calm);
|
|
10
12
|
overflow-wrap: break-word;
|
|
11
|
-
border-radius:
|
|
12
|
-
padding:
|
|
13
|
+
border-radius: 0.1875rem;
|
|
14
|
+
padding: 0.1875rem;
|
|
13
15
|
transition: opacity 0.2s;
|
|
14
16
|
opacity: 0;
|
|
15
17
|
z-index: 2000;
|
|
18
|
+
|
|
19
|
+
*:focus-visible {
|
|
20
|
+
@include focus-ring(0.125rem, 0.25rem, inherit);
|
|
21
|
+
}
|
|
16
22
|
}
|
package/styles/styles.scss
CHANGED
|
@@ -43,3 +43,16 @@ body {
|
|
|
43
43
|
color var(--cps-motion-base) var(--cps-motion-easing),
|
|
44
44
|
box-shadow var(--cps-motion-base) var(--cps-motion-easing) !important;
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
// Visually hidden but accessible to screen readers
|
|
48
|
+
.cps-sr-only {
|
|
49
|
+
position: absolute;
|
|
50
|
+
width: 0.0625rem;
|
|
51
|
+
height: 0.0625rem;
|
|
52
|
+
padding: 0;
|
|
53
|
+
margin: -0.0625rem;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
clip: rect(0, 0, 0, 0);
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
border: 0;
|
|
58
|
+
}
|
package/types/cps-ui-kit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnChanges, InjectionToken, PipeTransform, OnDestroy, AfterViewInit, ElementRef, Renderer2, ChangeDetectorRef, EventEmitter, NgZone, SimpleChanges,
|
|
2
|
+
import { OnChanges, InjectionToken, PipeTransform, OnInit, OnDestroy, AfterViewInit, ElementRef, Renderer2, ChangeDetectorRef, EventEmitter, NgZone, SimpleChanges, QueryList, TemplateRef, AfterContentInit, AfterViewChecked, ComponentRef, ViewContainerRef, Type, ApplicationRef, EnvironmentInjector, Injector } from '@angular/core';
|
|
3
3
|
import { ControlValueAccessor, NgControl, FormGroup } from '@angular/forms';
|
|
4
4
|
import { AnimationEvent, AnimationBuilder } from '@angular/animations';
|
|
5
5
|
import { OverlayService, SortEvent, FilterMetadata, SelectItem, TreeNode } from 'primeng/api';
|
|
@@ -80,80 +80,105 @@ type CpsTooltipOpenOn = 'hover' | 'click' | 'focus';
|
|
|
80
80
|
* CpsTooltipDirective provides advisory information for a target element.
|
|
81
81
|
* @group Components
|
|
82
82
|
*/
|
|
83
|
-
declare class CpsTooltipDirective implements OnDestroy {
|
|
83
|
+
declare class CpsTooltipDirective implements OnInit, OnDestroy {
|
|
84
84
|
/**
|
|
85
85
|
* Tooltip text or html to show.
|
|
86
86
|
* @group Props
|
|
87
87
|
*/
|
|
88
|
-
tooltip: string
|
|
88
|
+
readonly tooltip: i0.InputSignal<string>;
|
|
89
89
|
/**
|
|
90
90
|
* Delay to show the tooltip in milliseconds, it can be of type string or number.
|
|
91
91
|
* @group Props
|
|
92
|
+
* @default 300
|
|
92
93
|
*/
|
|
93
|
-
tooltipOpenDelay: string | number
|
|
94
|
+
readonly tooltipOpenDelay: i0.InputSignal<string | number>;
|
|
94
95
|
/**
|
|
95
96
|
* Delay to hide the tooltip in milliseconds, it can be of type string or number.
|
|
96
97
|
* @group Props
|
|
98
|
+
* @default 300
|
|
97
99
|
*/
|
|
98
|
-
tooltipCloseDelay: string | number
|
|
100
|
+
readonly tooltipCloseDelay: i0.InputSignal<string | number>;
|
|
99
101
|
/**
|
|
100
102
|
* Determines whether the tooltip should open on hover, click or focus.
|
|
101
103
|
* @group Props
|
|
104
|
+
* @default hover
|
|
102
105
|
*/
|
|
103
|
-
tooltipOpenOn: CpsTooltipOpenOn
|
|
106
|
+
readonly tooltipOpenOn: i0.InputSignal<CpsTooltipOpenOn>;
|
|
104
107
|
/**
|
|
105
108
|
* Position of the tooltip, it can be 'top', 'bottom', 'left' or 'right'.
|
|
106
109
|
* @group Props
|
|
110
|
+
* @default top
|
|
107
111
|
*/
|
|
108
|
-
tooltipPosition: CpsTooltipPosition
|
|
112
|
+
readonly tooltipPosition: i0.InputSignal<CpsTooltipPosition>;
|
|
109
113
|
/**
|
|
110
114
|
* Determines whether the tooltip is persistent.
|
|
111
115
|
* @group Props
|
|
116
|
+
* @default false
|
|
112
117
|
*/
|
|
113
|
-
tooltipPersistent: boolean
|
|
118
|
+
readonly tooltipPersistent: i0.InputSignal<boolean>;
|
|
114
119
|
/**
|
|
115
120
|
* When present, it specifies that the tooltip should be disabled.
|
|
116
121
|
* @group Props
|
|
122
|
+
* @default false
|
|
117
123
|
*/
|
|
118
|
-
tooltipDisabled: boolean
|
|
124
|
+
readonly tooltipDisabled: i0.InputSignal<boolean>;
|
|
119
125
|
/**
|
|
120
126
|
* Max width of the tooltip of type number denoting pixels or string.
|
|
121
127
|
* @group Props
|
|
128
|
+
* @default 100%
|
|
122
129
|
*/
|
|
123
|
-
tooltipMaxWidth:
|
|
130
|
+
readonly tooltipMaxWidth: i0.InputSignal<string | number>;
|
|
124
131
|
/**
|
|
125
132
|
* Tooltip content class for styling.
|
|
126
133
|
* @group Props
|
|
134
|
+
* @default cps-tooltip-content
|
|
127
135
|
*/
|
|
128
|
-
tooltipContentClass: string
|
|
136
|
+
readonly tooltipContentClass: i0.InputSignal<string>;
|
|
129
137
|
/**
|
|
130
|
-
* Tooltip offset
|
|
138
|
+
* Tooltip offset, a number denoting pixels or a string.
|
|
131
139
|
* @group Props
|
|
140
|
+
* @default 0.5rem
|
|
132
141
|
*/
|
|
133
|
-
tooltipOffset: number
|
|
142
|
+
readonly tooltipOffset: i0.InputSignal<string | number>;
|
|
143
|
+
readonly cvtTooltipOffset: i0.Signal<string>;
|
|
134
144
|
private _popup?;
|
|
135
145
|
private _showTimeout?;
|
|
136
146
|
private _hideTimeout?;
|
|
147
|
+
private _ariaTarget?;
|
|
148
|
+
private readonly _tooltipId;
|
|
149
|
+
private _rootFontSizePx;
|
|
137
150
|
private window;
|
|
138
151
|
private _elementRef;
|
|
139
152
|
private _document;
|
|
140
153
|
private _domSanitizer;
|
|
141
154
|
constructor();
|
|
155
|
+
ngOnInit(): void;
|
|
142
156
|
ngOnDestroy(): void;
|
|
143
|
-
private _createTooltip;
|
|
144
|
-
private _destroyTooltip;
|
|
145
|
-
private _constructElement;
|
|
146
|
-
private _getCoords;
|
|
147
|
-
private _getCoordsForPosition;
|
|
148
157
|
onMouseEnter(): void;
|
|
149
158
|
onMouseLeave(): void;
|
|
150
159
|
onFocus(): void;
|
|
151
|
-
|
|
160
|
+
onFocusOut(event: FocusEvent): void;
|
|
161
|
+
onTabFromTrigger(event: Event): void;
|
|
152
162
|
onClick(): void;
|
|
153
|
-
onDocumentClick(target:
|
|
154
|
-
onPageResize(
|
|
163
|
+
onDocumentClick(target: EventTarget | null): void;
|
|
164
|
+
onPageResize(): void;
|
|
165
|
+
private _onScrollDestroy;
|
|
166
|
+
private _onPopupKeydown;
|
|
167
|
+
private _onPopupFocusOut;
|
|
168
|
+
private _createTooltip;
|
|
169
|
+
private _positionAndShow;
|
|
170
|
+
private _destroyTooltip;
|
|
171
|
+
private _isInsideScreen;
|
|
172
|
+
private _pxToRem;
|
|
173
|
+
private _getOffsetPx;
|
|
174
|
+
private _getCoords;
|
|
175
|
+
private _getCoordsForPosition;
|
|
176
|
+
private _focusableIn;
|
|
177
|
+
private _getNextFocusableAfterTrigger;
|
|
178
|
+
private _resolveAriaTarget;
|
|
179
|
+
private _announce;
|
|
155
180
|
static ɵfac: i0.ɵɵFactoryDeclaration<CpsTooltipDirective, never>;
|
|
156
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CpsTooltipDirective, "[cpsTooltip]", never, { "tooltip": { "alias": "cpsTooltip"; "required":
|
|
181
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CpsTooltipDirective, "[cpsTooltip]", never, { "tooltip": { "alias": "cpsTooltip"; "required": true; "isSignal": true; }; "tooltipOpenDelay": { "alias": "tooltipOpenDelay"; "required": false; "isSignal": true; }; "tooltipCloseDelay": { "alias": "tooltipCloseDelay"; "required": false; "isSignal": true; }; "tooltipOpenOn": { "alias": "tooltipOpenOn"; "required": false; "isSignal": true; }; "tooltipPosition": { "alias": "tooltipPosition"; "required": false; "isSignal": true; }; "tooltipPersistent": { "alias": "tooltipPersistent"; "required": false; "isSignal": true; }; "tooltipDisabled": { "alias": "tooltipDisabled"; "required": false; "isSignal": true; }; "tooltipMaxWidth": { "alias": "tooltipMaxWidth"; "required": false; "isSignal": true; }; "tooltipContentClass": { "alias": "tooltipContentClass"; "required": false; "isSignal": true; }; "tooltipOffset": { "alias": "tooltipOffset"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
157
182
|
}
|
|
158
183
|
|
|
159
184
|
type Nullable$1<T = void> = T | null | undefined;
|
|
@@ -1554,10 +1579,10 @@ declare class CpsFileUploadComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1554
1579
|
*/
|
|
1555
1580
|
fileNameTooltipPosition: CpsTooltipPosition;
|
|
1556
1581
|
/**
|
|
1557
|
-
* File name tooltip offset
|
|
1582
|
+
* File name tooltip offset, a number denoting pixels or a string.
|
|
1558
1583
|
* @group Props
|
|
1559
1584
|
*/
|
|
1560
|
-
fileNameTooltipOffset: number;
|
|
1585
|
+
fileNameTooltipOffset: number | string;
|
|
1561
1586
|
/**
|
|
1562
1587
|
* Width of the component, a number denoting pixels or a string.
|
|
1563
1588
|
* @group Props
|
|
@@ -1631,7 +1656,6 @@ declare class CpsFileUploadComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
1631
1656
|
static ɵfac: i0.ɵɵFactoryDeclaration<CpsFileUploadComponent, never>;
|
|
1632
1657
|
static ɵcmp: i0.ɵɵComponentDeclaration<CpsFileUploadComponent, "cps-file-upload", never, { "extensions": { "alias": "extensions"; "required": false; }; "fileDesc": { "alias": "fileDesc"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "fileInfo": { "alias": "fileInfo"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "fileProcessingCallback": { "alias": "fileProcessingCallback"; "required": false; }; "fileNameTooltipPosition": { "alias": "fileNameTooltipPosition"; "required": false; }; "fileNameTooltipOffset": { "alias": "fileNameTooltipOffset"; "required": false; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, { "fileUploaded": "fileUploaded"; "fileUploadFailed": "fileUploadFailed"; "fileProcessed": "fileProcessed"; "fileProcessingFailed": "fileProcessingFailed"; "fileProcessingCancelled": "fileProcessingCancelled"; "uploadedFileRemoved": "uploadedFileRemoved"; }, never, never, true, never>;
|
|
1633
1658
|
static ngAcceptInputType_disabled: unknown;
|
|
1634
|
-
static ngAcceptInputType_fileNameTooltipOffset: unknown;
|
|
1635
1659
|
}
|
|
1636
1660
|
|
|
1637
1661
|
/**
|