cps-ui-kit 21.13.0 → 21.14.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.
@@ -2175,7 +2175,7 @@ class CpsAutocompleteComponent {
2175
2175
  this._options = [];
2176
2176
  this._optionIds = new WeakMap();
2177
2177
  // eslint-disable-next-line @typescript-eslint/no-empty-function
2178
- this.onChange = (event) => { };
2178
+ this.onChange = (_event) => { };
2179
2179
  // eslint-disable-next-line @typescript-eslint/no-empty-function
2180
2180
  this.onTouched = () => { };
2181
2181
  if (this._control) {
@@ -2365,7 +2365,7 @@ class CpsAutocompleteComponent {
2365
2365
  }, 0);
2366
2366
  }
2367
2367
  // eslint-disable-next-line @typescript-eslint/no-empty-function
2368
- setDisabledState(disabled) { }
2368
+ setDisabledState(_disabled) { }
2369
2369
  onBlur() {
2370
2370
  this.isActive = false;
2371
2371
  this._confirmInput(this.inputText || '', false);
@@ -3034,7 +3034,7 @@ class CpsButtonToggleComponent {
3034
3034
  this.largestButtonWidthRem = 0;
3035
3035
  this._rootFontSizePx = 16;
3036
3036
  // eslint-disable-next-line @typescript-eslint/no-empty-function
3037
- this.onChange = (event) => { };
3037
+ this.onChange = (_event) => { };
3038
3038
  // eslint-disable-next-line @typescript-eslint/no-empty-function
3039
3039
  this.onTouched = () => { };
3040
3040
  if (this._control) {
@@ -3068,7 +3068,7 @@ class CpsButtonToggleComponent {
3068
3068
  }
3069
3069
  }
3070
3070
  // eslint-disable-next-line @typescript-eslint/no-empty-function
3071
- setDisabledState(disabled) { }
3071
+ setDisabledState(_disabled) { }
3072
3072
  registerOnChange(fn) {
3073
3073
  this.onChange = fn;
3074
3074
  }
@@ -3502,7 +3502,7 @@ class CpsCheckboxComponent {
3502
3502
  this.valueChanged = new EventEmitter();
3503
3503
  this._value = false;
3504
3504
  // eslint-disable-next-line @typescript-eslint/no-empty-function
3505
- this.onChange = (event) => { };
3505
+ this.onChange = (_event) => { };
3506
3506
  // eslint-disable-next-line @typescript-eslint/no-empty-function
3507
3507
  this.onTouched = () => { };
3508
3508
  if (this._control) {
@@ -3538,7 +3538,7 @@ class CpsCheckboxComponent {
3538
3538
  this.valueChanged.emit(value);
3539
3539
  }
3540
3540
  // eslint-disable-next-line @typescript-eslint/no-empty-function
3541
- setDisabledState(disabled) { }
3541
+ setDisabledState(_disabled) { }
3542
3542
  focus() {
3543
3543
  this._elementRef?.nativeElement?.querySelector('input')?.focus();
3544
3544
  }
@@ -3760,7 +3760,7 @@ class CpsInputComponent {
3760
3760
  this.cvtWidth = '';
3761
3761
  this._value = '';
3762
3762
  // eslint-disable-next-line @typescript-eslint/no-empty-function
3763
- this.onChange = (event) => { };
3763
+ this.onChange = (_event) => { };
3764
3764
  // eslint-disable-next-line @typescript-eslint/no-empty-function
3765
3765
  this.onTouched = () => { };
3766
3766
  if (this._control) {
@@ -3860,7 +3860,7 @@ class CpsInputComponent {
3860
3860
  this.currentType = this.currentType === 'password' ? 'text' : 'password';
3861
3861
  }
3862
3862
  // eslint-disable-next-line @typescript-eslint/no-empty-function
3863
- setDisabledState(disabled) { }
3863
+ setDisabledState(_disabled) { }
3864
3864
  onClickPrefixIcon() {
3865
3865
  if (!this.prefixIconClickable || this.readonly || this.disabled)
3866
3866
  return;
@@ -4069,7 +4069,7 @@ class CpsDatepickerComponent {
4069
4069
  this.cvtWidth = '';
4070
4070
  this._value = null;
4071
4071
  // eslint-disable-next-line @typescript-eslint/no-empty-function
4072
- this.onChange = (event) => { };
4072
+ this.onChange = (_event) => { };
4073
4073
  // eslint-disable-next-line @typescript-eslint/no-empty-function
4074
4074
  this.onTouched = () => { };
4075
4075
  if (this._control) {
@@ -5166,7 +5166,7 @@ class CpsSelectComponent {
5166
5166
  this.virtualScrollItemSize = 44;
5167
5167
  this.selectBoxWidth = 0;
5168
5168
  // eslint-disable-next-line @typescript-eslint/no-empty-function
5169
- this.onChange = (event) => { };
5169
+ this.onChange = (_event) => { };
5170
5170
  // eslint-disable-next-line @typescript-eslint/no-empty-function
5171
5171
  this.onTouched = () => { };
5172
5172
  if (this._control) {
@@ -5451,7 +5451,7 @@ class CpsSelectComponent {
5451
5451
  this._dehighlightOption();
5452
5452
  }
5453
5453
  // eslint-disable-next-line @typescript-eslint/no-empty-function
5454
- setDisabledState(disabled) { }
5454
+ setDisabledState(_disabled) { }
5455
5455
  onBlur() {
5456
5456
  this._checkErrors();
5457
5457
  this.blurred.emit();
@@ -5906,7 +5906,7 @@ class CpsRadioGroupComponent {
5906
5906
  this._value = undefined;
5907
5907
  this.error = '';
5908
5908
  // eslint-disable-next-line @typescript-eslint/no-empty-function
5909
- this.onChange = (event) => { };
5909
+ this.onChange = (_event) => { };
5910
5910
  // eslint-disable-next-line @typescript-eslint/no-empty-function
5911
5911
  this.onTouched = () => { };
5912
5912
  if (this._control) {
@@ -5946,7 +5946,7 @@ class CpsRadioGroupComponent {
5946
5946
  this.valueChanged.emit(value);
5947
5947
  }
5948
5948
  // eslint-disable-next-line @typescript-eslint/no-empty-function
5949
- setDisabledState(disabled) { }
5949
+ setDisabledState(_disabled) { }
5950
5950
  onBlur() {
5951
5951
  this._checkErrors();
5952
5952
  this.blurred.emit();
@@ -6619,7 +6619,7 @@ class CpsTimepickerComponent {
6619
6619
  this.secondsError = '';
6620
6620
  this._value = undefined;
6621
6621
  // eslint-disable-next-line @typescript-eslint/no-empty-function
6622
- this.onChange = (event) => { };
6622
+ this.onChange = (_event) => { };
6623
6623
  // eslint-disable-next-line @typescript-eslint/no-empty-function
6624
6624
  this.onTouched = () => { };
6625
6625
  if (this._control) {
@@ -6656,7 +6656,7 @@ class CpsTimepickerComponent {
6656
6656
  this.onTouched = fn;
6657
6657
  }
6658
6658
  // eslint-disable-next-line @typescript-eslint/no-empty-function
6659
- setDisabledState(disabled) { }
6659
+ setDisabledState(_disabled) { }
6660
6660
  writeValue(value) {
6661
6661
  this.value = value;
6662
6662
  }
@@ -8369,7 +8369,7 @@ class CpsSwitchComponent {
8369
8369
  this.valueChanged = new EventEmitter();
8370
8370
  this._value = false;
8371
8371
  // eslint-disable-next-line @typescript-eslint/no-empty-function
8372
- this.onChange = (event) => { };
8372
+ this.onChange = (_event) => { };
8373
8373
  // eslint-disable-next-line @typescript-eslint/no-empty-function
8374
8374
  this.onTouched = () => { };
8375
8375
  if (this._control) {
@@ -8397,7 +8397,7 @@ class CpsSwitchComponent {
8397
8397
  this.valueChanged.emit(value);
8398
8398
  }
8399
8399
  // eslint-disable-next-line @typescript-eslint/no-empty-function
8400
- setDisabledState(disabled) { }
8400
+ setDisabledState(_disabled) { }
8401
8401
  focus() {
8402
8402
  this._elementRef?.nativeElement?.querySelector('input')?.focus();
8403
8403
  }
@@ -11103,7 +11103,7 @@ class CpsTagComponent {
11103
11103
  this.classesList = [];
11104
11104
  this._value = false;
11105
11105
  // eslint-disable-next-line @typescript-eslint/no-empty-function
11106
- this.onChange = (event) => { };
11106
+ this.onChange = (_event) => { };
11107
11107
  // eslint-disable-next-line @typescript-eslint/no-empty-function
11108
11108
  this.onTouched = () => { };
11109
11109
  if (this._control) {
@@ -11308,7 +11308,7 @@ class CpsTextareaComponent {
11308
11308
  this._value = '';
11309
11309
  this.cvtWidth = '';
11310
11310
  // eslint-disable-next-line @typescript-eslint/no-empty-function
11311
- this.onChange = (event) => { };
11311
+ this.onChange = (_event) => { };
11312
11312
  // eslint-disable-next-line @typescript-eslint/no-empty-function
11313
11313
  this.onTouched = () => { };
11314
11314
  if (this._control) {
@@ -11381,7 +11381,7 @@ class CpsTextareaComponent {
11381
11381
  this._updateValue('');
11382
11382
  }
11383
11383
  // eslint-disable-next-line @typescript-eslint/no-empty-function
11384
- setDisabledState(disabled) { }
11384
+ setDisabledState(_disabled) { }
11385
11385
  onBlur() {
11386
11386
  this._checkErrors();
11387
11387
  this.blurred.emit();
@@ -11636,7 +11636,7 @@ class CpsBaseTreeDropdownComponent {
11636
11636
  this.isAutocomplete = false;
11637
11637
  this.boxWidth = 0;
11638
11638
  // eslint-disable-next-line @typescript-eslint/no-empty-function
11639
- this.onChange = (event) => { };
11639
+ this.onChange = (_event) => { };
11640
11640
  // eslint-disable-next-line @typescript-eslint/no-empty-function
11641
11641
  this.onTouched = () => { };
11642
11642
  if (this.control) {
@@ -11705,7 +11705,7 @@ class CpsBaseTreeDropdownComponent {
11705
11705
  }
11706
11706
  }
11707
11707
  // eslint-disable-next-line @typescript-eslint/no-empty-function
11708
- setDisabledState(disabled) { }
11708
+ setDisabledState(_disabled) { }
11709
11709
  onBlur() {
11710
11710
  this._checkErrors();
11711
11711
  this.blurred.emit();
@@ -12315,7 +12315,7 @@ class CpsTreeAutocompleteComponent extends CpsBaseTreeDropdownComponent {
12315
12315
  return;
12316
12316
  if (this.treeSelection?.length) {
12317
12317
  if (this.backspaceClickedOnce) {
12318
- this.treeSelection = this.treeSelection.filter((v, index) => index !== this.treeSelection.length - 1);
12318
+ this.treeSelection = this.treeSelection.filter((_v, index) => index !== this.treeSelection.length - 1);
12319
12319
  this.updateValue(this.treeSelectionToValue(this.treeSelection));
12320
12320
  this.backspaceClickedOnce = false;
12321
12321
  }
@@ -15786,6 +15786,116 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
15786
15786
  args: [DOCUMENT]
15787
15787
  }] }] });
15788
15788
 
15789
+ /**
15790
+ * CpsRootFontSizeService tracks the application's current root font size.
15791
+ *
15792
+ * The service uses a ResizeObserver strategy to reliably detect root font-size changes:
15793
+ *
15794
+ * **Sentinel element** (`<div style="width:1rem;height:0">`) — its pixel width
15795
+ * mirrors `1rem`. Any root font-size change — caused by CSS class toggles,
15796
+ * stylesheet rules, direct JS assignment, or viewport resize (e.g.
15797
+ * `font-size: 1.5vw`) — changes the sentinel's computed width, firing the
15798
+ * observer.
15799
+ * The cached value is stored in a signal and is only updated when the actual
15800
+ * font-size value changes, preventing spurious updates.
15801
+ *
15802
+ * In microfrontend environments the sentinel element is keyed by a known DOM
15803
+ * attribute (`data-cps-root-font-size-sentinel`) and reused if already present,
15804
+ * so only one sentinel node exists per document regardless of how many
15805
+ * instances of this service are created. The sentinel is intentionally never
15806
+ * removed from the DOM — it is a lightweight, invisible element and removing it
15807
+ * could silently break any other live service instance still observing it.
15808
+ *
15809
+ * Only active in browser environments. Under SSR the `fontSize` signal is
15810
+ * initialized to `16` (the standard browser default) and no DOM observers are created.
15811
+ *
15812
+ * Prefer injecting {@link CPS_ROOT_FONT_SIZE_SERVICE} over this class directly
15813
+ * to allow consumer applications to override the behavior.
15814
+ *
15815
+ * @example
15816
+ * ```typescript
15817
+ * class MyComponent {
15818
+ * private fontSizeService = inject(CPS_ROOT_FONT_SIZE_SERVICE);
15819
+ * readonly fontSize = this.fontSizeService?.fontSize;
15820
+ * }
15821
+ * ```
15822
+ */
15823
+ class CpsRootFontSizeService {
15824
+ static { this._SENTINEL_ATTR = 'data-cps-root-font-size-sentinel'; }
15825
+ constructor() {
15826
+ this._document = inject(DOCUMENT);
15827
+ this._platformId = inject(PLATFORM_ID);
15828
+ this._fontSize = signal(isPlatformBrowser(this._platformId) ? this._readRootFontSize() : 16, ...(ngDevMode ? [{ debugName: "_fontSize" }] : /* istanbul ignore next */ []));
15829
+ this._sentinelObserver = null;
15830
+ /** Reactive signal containing the current root font size in pixels. */
15831
+ this.fontSize = this._fontSize.asReadonly();
15832
+ if (!isPlatformBrowser(this._platformId))
15833
+ return;
15834
+ this._setupObservers();
15835
+ }
15836
+ ngOnDestroy() {
15837
+ this._sentinelObserver?.disconnect();
15838
+ this._sentinelObserver = null;
15839
+ }
15840
+ _setupObservers() {
15841
+ // Reuse an existing sentinel if another service instance already created one.
15842
+ let sentinel = this._document.querySelector(`[${CpsRootFontSizeService._SENTINEL_ATTR}]`);
15843
+ if (!sentinel) {
15844
+ sentinel = this._document.createElement('div');
15845
+ sentinel.setAttribute(CpsRootFontSizeService._SENTINEL_ATTR, '');
15846
+ Object.assign(sentinel.style, {
15847
+ position: 'absolute',
15848
+ width: '1rem',
15849
+ height: '0',
15850
+ visibility: 'hidden',
15851
+ pointerEvents: 'none',
15852
+ userSelect: 'none',
15853
+ top: '0',
15854
+ left: '0'
15855
+ });
15856
+ this._document.documentElement.appendChild(sentinel);
15857
+ }
15858
+ this._sentinelObserver = new ResizeObserver(() => this._refresh());
15859
+ this._sentinelObserver.observe(sentinel);
15860
+ }
15861
+ _refresh() {
15862
+ const newSize = this._readRootFontSize();
15863
+ if (newSize !== this._fontSize()) {
15864
+ this._fontSize.set(newSize);
15865
+ }
15866
+ }
15867
+ _readRootFontSize() {
15868
+ return parseFloat(getComputedStyle(this._document.documentElement).fontSize);
15869
+ }
15870
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CpsRootFontSizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
15871
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CpsRootFontSizeService, providedIn: 'root' }); }
15872
+ }
15873
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImport: i0, type: CpsRootFontSizeService, decorators: [{
15874
+ type: Injectable,
15875
+ args: [{
15876
+ providedIn: 'root'
15877
+ }]
15878
+ }], ctorParameters: () => [] });
15879
+ /**
15880
+ * Injection token for the root font size service.
15881
+ *
15882
+ * By default it resolves to the singleton {@link CpsRootFontSizeService}.
15883
+ * Consumer applications can override it to:
15884
+ * - Supply a custom subclass
15885
+ * - Provide `null` to disable dynamic tracking entirely
15886
+ *
15887
+ * @example Disable dynamic tracking:
15888
+ * ```typescript
15889
+ * providers: [
15890
+ * { provide: CPS_ROOT_FONT_SIZE_SERVICE, useValue: null }
15891
+ * ]
15892
+ * ```
15893
+ */
15894
+ const CPS_ROOT_FONT_SIZE_SERVICE = new InjectionToken('CpsRootFontSizeService', {
15895
+ providedIn: 'root',
15896
+ factory: () => inject(CpsRootFontSizeService)
15897
+ });
15898
+
15789
15899
  /**
15790
15900
  * CpsThemeService manages application theming including dark mode support.
15791
15901
  *
@@ -15983,14 +16093,13 @@ class CpsThemeService {
15983
16093
  return 'compact';
15984
16094
  }
15985
16095
  // TODO: Use as fallback in getInitialTheme() once dark mode is fully supported across all components.
15986
- getSystemTheme() {
15987
- const win = this.document.defaultView;
15988
- if (!win?.matchMedia)
15989
- return 'light';
15990
- return win.matchMedia('(prefers-color-scheme: dark)').matches
15991
- ? 'dark'
15992
- : 'light';
15993
- }
16096
+ // private getSystemTheme(): CpsTheme {
16097
+ // const win = this.document.defaultView;
16098
+ // if (!win?.matchMedia) return 'light';
16099
+ // return win.matchMedia('(prefers-color-scheme: dark)').matches
16100
+ // ? 'dark'
16101
+ // : 'light';
16102
+ // }
15994
16103
  // TODO: Enable system preference fallback once dark mode is fully supported across all components.
15995
16104
  watchSystemTheme() {
15996
16105
  const win = this.document.defaultView;
@@ -16034,5 +16143,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.10", ngImpo
16034
16143
  * Generated bundle index. Do not edit.
16035
16144
  */
16036
16145
 
16037
- export { CPS_CRON_VALIDATION_SERVICE, CPS_FOCUS_SERVICE, CPS_RADIO_GROUP, CpsAutocompleteComponent, CpsButtonComponent, CpsButtonToggleComponent, CpsCheckboxComponent, CpsChipComponent, CpsColumnFilterMatchMode, CpsCronValidationService, 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 };
16146
+ export { CPS_CRON_VALIDATION_SERVICE, CPS_FOCUS_SERVICE, CPS_RADIO_GROUP, CPS_ROOT_FONT_SIZE_SERVICE, CpsAutocompleteComponent, CpsButtonComponent, CpsButtonToggleComponent, CpsCheckboxComponent, CpsChipComponent, CpsColumnFilterMatchMode, CpsCronValidationService, CpsDatepickerComponent, CpsDialogConfig, CpsDialogRef, CpsDialogService, CpsDividerComponent, CpsExpansionPanelComponent, CpsFileUploadComponent, CpsFocusService, CpsIconComponent, CpsInfoCircleComponent, CpsInputComponent, CpsLoaderComponent, CpsMenuComponent, CpsMenuHideReason, CpsNotificationAppearance, CpsNotificationPosition, CpsNotificationService, CpsPaginatePipe, CpsPaginatorComponent, CpsProgressCircularComponent, CpsProgressLinearComponent, CpsRadioComponent, CpsRadioGroupComponent, CpsRootFontSizeService, 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 };
16038
16147
  //# sourceMappingURL=cps-ui-kit.mjs.map