cps-ui-kit 21.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cps-ui-kit",
3
- "version": "21.7.0",
3
+ "version": "21.9.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.2.6",
6
6
  "@angular/core": "^21.2.6",
@@ -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: 14px;
6
- background: #f9f5f6;
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: 1px solid var(--cps-color-calm);
11
+ border: 0.0625rem solid var(--cps-color-calm);
10
12
  overflow-wrap: break-word;
11
- border-radius: 3px;
12
- padding: 3px;
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
  }
@@ -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
+ }
@@ -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, OnInit, QueryList, TemplateRef, AfterContentInit, AfterViewChecked, ComponentRef, ViewContainerRef, Type, ApplicationRef, EnvironmentInjector, Injector } from '@angular/core';
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: number | string;
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 for styling.
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
- onBlur(): void;
160
+ onFocusOut(event: FocusEvent): void;
161
+ onTabFromTrigger(event: Event): void;
152
162
  onClick(): void;
153
- onDocumentClick(target: any): void;
154
- onPageResize(event: Event): void;
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": false; }; "tooltipOpenDelay": { "alias": "tooltipOpenDelay"; "required": false; }; "tooltipCloseDelay": { "alias": "tooltipCloseDelay"; "required": false; }; "tooltipOpenOn": { "alias": "tooltipOpenOn"; "required": false; }; "tooltipPosition": { "alias": "tooltipPosition"; "required": false; }; "tooltipPersistent": { "alias": "tooltipPersistent"; "required": false; }; "tooltipDisabled": { "alias": "tooltipDisabled"; "required": false; }; "tooltipMaxWidth": { "alias": "tooltipMaxWidth"; "required": false; }; "tooltipContentClass": { "alias": "tooltipContentClass"; "required": false; }; "tooltipOffset": { "alias": "tooltipOffset"; "required": false; }; }, {}, never, never, true, never>;
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;
@@ -1401,21 +1426,25 @@ declare class CpsDividerComponent {
1401
1426
  /**
1402
1427
  * Determines whether the divider is vertically aligned.
1403
1428
  * @group Props
1429
+ * @default false
1404
1430
  */
1405
1431
  vertical: i0.InputSignal<boolean>;
1406
1432
  /**
1407
1433
  * Color of the divider.
1408
1434
  * @group Props
1435
+ * @default line-mid
1409
1436
  */
1410
1437
  color: i0.InputSignal<string>;
1411
1438
  /**
1412
1439
  * Type of the divider.
1413
1440
  * @group Props
1441
+ * @default solid
1414
1442
  */
1415
1443
  type: i0.InputSignal<CpsDividerType>;
1416
1444
  /**
1417
1445
  * Thickness of the divider, a number denoting pixels or a string.
1418
1446
  * @group Props
1447
+ * @default 1px
1419
1448
  */
1420
1449
  thickness: i0.InputSignal<string | number>;
1421
1450
  constructor(document: Document);
@@ -1513,7 +1542,7 @@ declare class CpsExpansionPanelComponent implements OnInit, AfterViewInit {
1513
1542
  * CpsFileUploadComponent is an advanced uploader with dragdrop support.
1514
1543
  * @group Components
1515
1544
  */
1516
- declare class CpsFileUploadComponent implements OnInit, OnChanges {
1545
+ declare class CpsFileUploadComponent implements OnInit, OnChanges, OnDestroy {
1517
1546
  /**
1518
1547
  * Expected extensions of a file to be uploaded. E.g. 'doc or .doc'.
1519
1548
  * @group Props
@@ -1525,15 +1554,20 @@ declare class CpsFileUploadComponent implements OnInit, OnChanges {
1525
1554
  */
1526
1555
  fileDesc: string;
1527
1556
  /**
1528
- * Width of the component, a number denoting pixels or a string.
1557
+ * Aria label for the component, used for accessibility.
1529
1558
  * @group Props
1530
1559
  */
1531
- width: number | string;
1560
+ ariaLabel: string;
1532
1561
  /**
1533
1562
  * Expected file info block, explaining some extra stuff about file.
1534
1563
  * @group Props
1535
1564
  */
1536
1565
  fileInfo: string;
1566
+ /**
1567
+ * Whether the component is disabled.
1568
+ * @group Props
1569
+ */
1570
+ disabled: boolean;
1537
1571
  /**
1538
1572
  * Callback for uploaded file processing.
1539
1573
  * @group Props
@@ -1545,10 +1579,16 @@ declare class CpsFileUploadComponent implements OnInit, OnChanges {
1545
1579
  */
1546
1580
  fileNameTooltipPosition: CpsTooltipPosition;
1547
1581
  /**
1548
- * File name tooltip offset for styling.
1582
+ * File name tooltip offset, a number denoting pixels or a string.
1549
1583
  * @group Props
1550
1584
  */
1551
- fileNameTooltipOffset: number;
1585
+ fileNameTooltipOffset: number | string;
1586
+ /**
1587
+ * Width of the component, a number denoting pixels or a string.
1588
+ * @group Props
1589
+ * @default 100%
1590
+ */
1591
+ width: i0.InputSignal<string | number>;
1552
1592
  /**
1553
1593
  * Callback to invoke when file is uploaded.
1554
1594
  * @param {File} File
@@ -1561,6 +1601,24 @@ declare class CpsFileUploadComponent implements OnInit, OnChanges {
1561
1601
  * @group Emits
1562
1602
  */
1563
1603
  fileUploadFailed: EventEmitter<string>;
1604
+ /**
1605
+ * Callback to invoke when file is processed.
1606
+ * @param {File} File
1607
+ * @group Emits
1608
+ */
1609
+ fileProcessed: EventEmitter<File>;
1610
+ /**
1611
+ * Callback to invoke when file processing fails.
1612
+ * @param {string} - file name
1613
+ * @group Emits
1614
+ */
1615
+ fileProcessingFailed: EventEmitter<string>;
1616
+ /**
1617
+ * Callback to invoke when file processing is cancelled.
1618
+ * @param {string} - file name
1619
+ * @group Emits
1620
+ */
1621
+ fileProcessingCancelled: EventEmitter<string>;
1564
1622
  /**
1565
1623
  * Callback to invoke when uploaded file is removed.
1566
1624
  * @param {string} - file name
@@ -1568,21 +1626,36 @@ declare class CpsFileUploadComponent implements OnInit, OnChanges {
1568
1626
  */
1569
1627
  uploadedFileRemoved: EventEmitter<string>;
1570
1628
  fileInput?: ElementRef<HTMLInputElement>;
1629
+ dropzoneButton?: ElementRef<HTMLButtonElement>;
1571
1630
  isDragoverFile: boolean;
1572
1631
  uploadedFile?: File;
1573
1632
  extensionsString: string;
1574
1633
  extensionsStringAsterisks: string;
1575
- cvtWidth: string;
1634
+ cvtWidth: i0.Signal<string>;
1576
1635
  isProcessingFile: boolean;
1636
+ errorMessage: string;
1637
+ private dragCounter;
1638
+ private readonly cancelProcessing$;
1577
1639
  ngOnInit(): void;
1640
+ ngOnDestroy(): void;
1578
1641
  ngOnChanges(changes: SimpleChanges): void;
1642
+ resetState(): void;
1643
+ openFilePicker(): void;
1644
+ onDragEnter(): void;
1645
+ onDragLeave(): void;
1646
+ onDragEnd(): void;
1647
+ onDragOver(event: DragEvent): void;
1648
+ onDrop(event: Event): void;
1579
1649
  updateExtensionsString(): void;
1580
1650
  tryUploadFile(event: Event): void;
1651
+ onRemoveUploadedFile(event: Event): void;
1652
+ onCancelFileProcessing(event: Event): void;
1653
+ cancelFileProcessing(): void;
1581
1654
  removeUploadedFile(): void;
1582
1655
  private _isFileExtensionValid;
1583
1656
  static ɵfac: i0.ɵɵFactoryDeclaration<CpsFileUploadComponent, never>;
1584
- static ɵcmp: i0.ɵɵComponentDeclaration<CpsFileUploadComponent, "cps-file-upload", never, { "extensions": { "alias": "extensions"; "required": false; }; "fileDesc": { "alias": "fileDesc"; "required": false; }; "width": { "alias": "width"; "required": false; }; "fileInfo": { "alias": "fileInfo"; "required": false; }; "fileProcessingCallback": { "alias": "fileProcessingCallback"; "required": false; }; "fileNameTooltipPosition": { "alias": "fileNameTooltipPosition"; "required": false; }; "fileNameTooltipOffset": { "alias": "fileNameTooltipOffset"; "required": false; }; }, { "fileUploaded": "fileUploaded"; "fileUploadFailed": "fileUploadFailed"; "uploadedFileRemoved": "uploadedFileRemoved"; }, never, never, true, never>;
1585
- static ngAcceptInputType_fileNameTooltipOffset: unknown;
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>;
1658
+ static ngAcceptInputType_disabled: unknown;
1586
1659
  }
1587
1660
 
1588
1661
  /**
@@ -1761,42 +1834,51 @@ declare class CpsProgressCircularComponent implements OnInit {
1761
1834
  * CpsProgressLinearComponent is a process status indicator of a rectangular form.
1762
1835
  * @group Components
1763
1836
  */
1764
- declare class CpsProgressLinearComponent implements OnInit {
1765
- private document;
1837
+ declare class CpsProgressLinearComponent {
1766
1838
  /**
1767
1839
  * Width of the progress bar, of type number denoting pixels or string.
1768
1840
  * @group Props
1841
+ * @default 100%
1769
1842
  */
1770
- width: number | string;
1843
+ width: i0.InputSignal<string | number>;
1771
1844
  /**
1772
1845
  * Height of the progress bar, of type number denoting pixels or string.
1773
1846
  * @group Props
1847
+ * @default 0.5rem
1774
1848
  */
1775
- height: number | string;
1849
+ height: i0.InputSignal<string | number>;
1776
1850
  /**
1777
1851
  * Color of the progress bar.
1778
1852
  * @group Props
1853
+ * @default var(--cps-accent-primary)
1779
1854
  */
1780
- color: string;
1855
+ color: i0.InputSignal<string>;
1781
1856
  /**
1782
1857
  * Background color of the progress bar.
1783
1858
  * @group Props
1859
+ * @default white
1784
1860
  */
1785
- bgColor: string;
1861
+ bgColor: i0.InputSignal<string>;
1786
1862
  /**
1787
1863
  * Option to control the opacity of the progress bar.
1788
1864
  * @group Props
1865
+ * @default 1
1789
1866
  */
1790
- opacity: number | string;
1867
+ opacity: i0.InputSignal<string | number>;
1791
1868
  /**
1792
1869
  * Border radius of the progress bar, of type number denoting pixels or string.
1793
1870
  * @group Props
1871
+ * @default 0
1794
1872
  */
1795
- radius: number | string;
1796
- constructor(document: Document);
1797
- ngOnInit(): void;
1873
+ radius: i0.InputSignal<string | number>;
1874
+ private readonly document;
1875
+ cvtWidth: i0.Signal<string>;
1876
+ cvtHeight: i0.Signal<string>;
1877
+ cvtRadius: i0.Signal<string>;
1878
+ cssColor: i0.Signal<string>;
1879
+ cssBgColor: i0.Signal<string>;
1798
1880
  static ɵfac: i0.ɵɵFactoryDeclaration<CpsProgressLinearComponent, never>;
1799
- static ɵcmp: i0.ɵɵComponentDeclaration<CpsProgressLinearComponent, "cps-progress-linear", never, { "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "color": { "alias": "color"; "required": false; }; "bgColor": { "alias": "bgColor"; "required": false; }; "opacity": { "alias": "opacity"; "required": false; }; "radius": { "alias": "radius"; "required": false; }; }, {}, never, never, true, never>;
1881
+ static ɵcmp: i0.ɵɵComponentDeclaration<CpsProgressLinearComponent, "cps-progress-linear", never, { "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "bgColor": { "alias": "bgColor"; "required": false; "isSignal": true; }; "opacity": { "alias": "opacity"; "required": false; "isSignal": true; }; "radius": { "alias": "radius"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1800
1882
  }
1801
1883
 
1802
1884
  /**