@ethlete/cdk 5.0.0-next.26 → 5.0.0-next.28

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @ethlete/cdk
2
2
 
3
+ ## 5.0.0-next.28
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3048](https://github.com/ethlete-io/ethdk/pull/3048) [`ee3bd8c`](https://github.com/ethlete-io/ethdk/commit/ee3bd8cae84be832da2ead4543b5440dd69d4e82) Thanks [@github-actions](https://github.com/apps/github-actions)! - Overlay: the full-screen open and close animation now clones the origin at the size it renders at, so a percentage-sized or ancestor-squeezed element no longer jumps to its intrinsic size.
8
+
9
+ ## 5.0.0-next.27
10
+
11
+ ### Patch Changes
12
+
13
+ - [#3045](https://github.com/ethlete-io/ethdk/pull/3045) [`f5c1fcc`](https://github.com/ethlete-io/ethdk/commit/f5c1fccf51fbeda86a3bb6d23d2bf4348ebb3c93) Thanks [@github-actions](https://github.com/apps/github-actions)! - Internal cleanup only - replaces index-access non-null assertions and drops dead bindings; no behavior
14
+ or API change.
15
+
16
+ - [#3045](https://github.com/ethlete-io/ethdk/pull/3045) [`23fd039`](https://github.com/ethlete-io/ethdk/commit/23fd0394d265e3c006cc96ff9143eca1d21e8a53) Thanks [@github-actions](https://github.com/apps/github-actions)! - Fix `migrate-from-cdk`: stop duplicating import specifiers, rewriting `<et-picture>` attributes on templates still bound to cdk's component, and mechanically renaming `TableImports`/`TabImports` onto an unrelated API.
17
+
3
18
  ## 5.0.0-next.26
4
19
 
5
20
  ### Minor Changes
@@ -2088,7 +2088,7 @@ const getNavigationContext = (params) => {
2088
2088
  };
2089
2089
  };
2090
2090
  const handleFinalRound = (params) => {
2091
- const { relations, currentUpperRound, previousUpperRound, nextUpperRound, lowerRounds, currentUpperRoundIndex, firstUpperRound, firstLowerRound, lastLowerRound, } = params;
2091
+ const { relations, currentUpperRound, previousUpperRound, nextUpperRound, lowerRounds, firstUpperRound, firstLowerRound, lastLowerRound, } = params;
2092
2092
  const finalLowerRound = lastLowerRound;
2093
2093
  const isAsyncBracket = nextUpperRound?.type === DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE.REVERSE_FINAL;
2094
2094
  if (nextUpperRound) {
@@ -2888,22 +2888,16 @@ const createBracketGrid = (config) => {
2888
2888
  let currentMasterColumnLeft = 0;
2889
2889
  let maxGridHeight = 0;
2890
2890
  const masterCols = newGrid.masterColumns;
2891
- for (let mcIdx = 0; mcIdx < masterCols.length; mcIdx++) {
2892
- const masterColumn = masterCols[mcIdx];
2891
+ for (const masterColumn of masterCols) {
2893
2892
  const { padding } = masterColumn;
2894
2893
  masterColumn.dimensions.left = currentMasterColumnLeft;
2895
2894
  masterColumn.dimensions.top = 0;
2896
2895
  masterColumn.dimensions.width += padding.left + padding.right;
2897
2896
  const sections = masterColumn.sections;
2898
2897
  let runningTop = 0;
2899
- let firstSectionIsHeader = false;
2900
- if (sections.length > 0) {
2901
- const firstSubColumn = sections[0].subColumns[0];
2902
- const firstElement = firstSubColumn?.elements[0];
2903
- firstSectionIsHeader = !!(firstElement && firstElement.type === 'header');
2904
- }
2905
- for (let secIdx = 0; secIdx < sections.length; secIdx++) {
2906
- const section = sections[secIdx];
2898
+ const firstElement = sections[0]?.subColumns[0]?.elements[0];
2899
+ const firstSectionIsHeader = firstElement?.type === 'header';
2900
+ for (const [secIdx, section] of sections.entries()) {
2907
2901
  const sectionPadding = section.padding ?? padding;
2908
2902
  let sectionPaddingTop;
2909
2903
  if (secIdx === 0) {
@@ -2922,20 +2916,17 @@ const createBracketGrid = (config) => {
2922
2916
  const subColumnWidth = contentWidth / totalSubColumns;
2923
2917
  let currentSubColumnLeft = masterColumn.dimensions.left + sectionPadding.left;
2924
2918
  let maxSectionHeight = 0;
2925
- for (let scIdx = 0; scIdx < totalSubColumns; scIdx++) {
2926
- const subColumn = subColumns[scIdx];
2919
+ for (const subColumn of subColumns) {
2927
2920
  subColumn.dimensions.width = subColumnWidth;
2928
2921
  subColumn.dimensions.left = currentSubColumnLeft;
2929
2922
  // TODO: The problem is here somewhere
2930
2923
  subColumn.dimensions.top = section.dimensions.top + sectionPaddingTop;
2931
2924
  let totalSubColumnHeight = 0;
2932
2925
  const elements = subColumn.elements;
2933
- for (let elIdx = 0; elIdx < elements.length; elIdx++) {
2934
- const element = elements[elIdx];
2926
+ for (const element of elements) {
2935
2927
  let totalElementHeight = 0;
2936
2928
  const parts = element.parts;
2937
- for (let pIdx = 0; pIdx < parts.length; pIdx++) {
2938
- const part = parts[pIdx];
2929
+ for (const part of parts) {
2939
2930
  part.dimensions.width = subColumnWidth;
2940
2931
  part.dimensions.left = currentSubColumnLeft;
2941
2932
  part.dimensions.top = subColumn.dimensions.top + totalSubColumnHeight + totalElementHeight;
@@ -2971,17 +2962,13 @@ const createBracketGrid = (config) => {
2971
2962
  const calculateSpanningElementDimensions = () => {
2972
2963
  const spanDimensions = new Map();
2973
2964
  const masterCols = newGrid.masterColumns;
2974
- for (let mcIdx = 0; mcIdx < masterCols.length; mcIdx++) {
2975
- const masterColumn = masterCols[mcIdx];
2965
+ for (const [mcIdx, masterColumn] of masterCols.entries()) {
2976
2966
  const sections = masterColumn.sections;
2977
- for (let secIdx = 0; secIdx < sections.length; secIdx++) {
2978
- const section = sections[secIdx];
2967
+ for (const [secIdx, section] of sections.entries()) {
2979
2968
  const subColumns = section.subColumns;
2980
- for (let scIdx = 0; scIdx < subColumns.length; scIdx++) {
2981
- const subColumn = subColumns[scIdx];
2969
+ for (const [scIdx, subColumn] of subColumns.entries()) {
2982
2970
  const elements = subColumn.elements;
2983
- for (let elIdx = 0; elIdx < elements.length; elIdx++) {
2984
- const element = elements[elIdx];
2971
+ for (const element of elements) {
2985
2972
  if (!element.span)
2986
2973
  continue;
2987
2974
  const span = element.span;
@@ -3013,8 +3000,9 @@ const createBracketGrid = (config) => {
3013
3000
  };
3014
3001
  const calculateSpannedWidth = (span, masterColumns) => {
3015
3002
  const key = `${span.masterColumnStart}-${span.masterColumnEnd}-${span.sectionStart}-${span.sectionEnd}-${span.subColumnStart}-${span.subColumnEnd}`;
3016
- if (spannedWidthCache.has(key))
3017
- return spannedWidthCache.get(key);
3003
+ const cachedWidth = spannedWidthCache.get(key);
3004
+ if (cachedWidth !== undefined)
3005
+ return cachedWidth;
3018
3006
  if (span.masterColumnStart === span.masterColumnEnd) {
3019
3007
  const masterColumn = masterColumns[span.masterColumnStart];
3020
3008
  if (masterColumn) {
@@ -3057,8 +3045,9 @@ const createBracketGrid = (config) => {
3057
3045
  };
3058
3046
  const calculateSpanStartLeft = (span, masterColumns) => {
3059
3047
  const key = `${span.masterColumnStart}-${span.sectionStart}-${span.subColumnStart}`;
3060
- if (spanStartLeftCache.has(key))
3061
- return spanStartLeftCache.get(key);
3048
+ const cachedLeft = spanStartLeftCache.get(key);
3049
+ if (cachedLeft !== undefined)
3050
+ return cachedLeft;
3062
3051
  const startMasterColumn = masterColumns[span.masterColumnStart];
3063
3052
  if (!startMasterColumn) {
3064
3053
  spanStartLeftCache.set(key, 0);
@@ -3074,14 +3063,11 @@ const createBracketGrid = (config) => {
3074
3063
  };
3075
3064
  const setupElementSpans = () => {
3076
3065
  const masterCols = newGrid.masterColumns;
3077
- for (let mcIdx = 0; mcIdx < masterCols.length; mcIdx++) {
3078
- const masterColumn = masterCols[mcIdx];
3066
+ for (const [mcIdx, masterColumn] of masterCols.entries()) {
3079
3067
  const sections = masterColumn.sections;
3080
- for (let secIdx = 0; secIdx < sections.length; secIdx++) {
3081
- const section = sections[secIdx];
3068
+ for (const [secIdx, section] of sections.entries()) {
3082
3069
  const subColumns = section.subColumns;
3083
- for (let scIdx = 0; scIdx < subColumns.length; scIdx++) {
3084
- const subColumn = subColumns[scIdx];
3070
+ for (const [scIdx, subColumn] of subColumns.entries()) {
3085
3071
  if (subColumn.span.isStart && subColumn.span.isEnd)
3086
3072
  continue;
3087
3073
  let spanStart = { masterColumnIndex: mcIdx, sectionIndex: secIdx, subColumnIndex: scIdx };
@@ -3121,8 +3107,8 @@ const createBracketGrid = (config) => {
3121
3107
  }
3122
3108
  }
3123
3109
  const elements = subColumn.elements;
3124
- for (let elIdx = 0; elIdx < elements.length; elIdx++) {
3125
- elements[elIdx].span = {
3110
+ for (const element of elements) {
3111
+ element.span = {
3126
3112
  masterColumnStart: spanStart.masterColumnIndex,
3127
3113
  masterColumnEnd: spanEnd.masterColumnIndex,
3128
3114
  sectionStart: spanStart.sectionIndex,
@@ -3258,31 +3244,16 @@ function gridColumnsToGridProperty(grid) {
3258
3244
  const totalColumns = grid.reduce((total, masterColumn) => {
3259
3245
  return total + Math.max(...masterColumn.sections.map((section) => section.subColumns.length));
3260
3246
  }, 0);
3261
- // Find all unique sections across all master columns to determine rows
3262
- const allSections = [];
3263
- grid.forEach((masterColumn, masterColumnIndex) => {
3264
- masterColumn.sections.forEach((section, sectionIndex) => {
3265
- // For each section, we need to process all its subcolumns
3266
- section.subColumns.forEach((subColumn) => {
3267
- allSections.push({
3268
- elements: subColumn.elements,
3269
- sectionIndex,
3270
- masterColumnIndex,
3271
- });
3272
- });
3273
- });
3274
- });
3275
3247
  // Group sections by their index to create rows
3276
3248
  const sectionsByIndex = new Map();
3277
3249
  let globalColumnIndex = 0;
3278
3250
  grid.forEach((masterColumn, masterColumnIndex) => {
3279
3251
  const maxSubColumns = Math.max(...masterColumn.sections.map((section) => section.subColumns.length));
3280
3252
  masterColumn.sections.forEach((section, sectionIndex) => {
3281
- if (!sectionsByIndex.has(sectionIndex)) {
3282
- sectionsByIndex.set(sectionIndex, []);
3283
- }
3253
+ const sectionColumns = sectionsByIndex.get(sectionIndex) ?? [];
3254
+ sectionsByIndex.set(sectionIndex, sectionColumns);
3284
3255
  section.subColumns.forEach((subColumn, subColumnIndex) => {
3285
- sectionsByIndex.get(sectionIndex).push({
3256
+ sectionColumns.push({
3286
3257
  elements: subColumn.elements,
3287
3258
  columnIndex: globalColumnIndex + subColumnIndex,
3288
3259
  masterColumnIndex,
@@ -3295,7 +3266,7 @@ function gridColumnsToGridProperty(grid) {
3295
3266
  const areaMatrix = [];
3296
3267
  const rowHeights = [];
3297
3268
  // Process each section (which becomes a row group)
3298
- for (const [sectionIndex, sectionColumns] of sectionsByIndex.entries()) {
3269
+ for (const sectionColumns of sectionsByIndex.values()) {
3299
3270
  // Find max rows needed for this section
3300
3271
  const maxRowsInSection = Math.max(...sectionColumns.map((col) => col.elements.reduce((total, element) => total + element.parts.length, 0)), 0);
3301
3272
  // Create rows for this section
@@ -4914,7 +4885,7 @@ class ExposeInputVarsDirective {
4914
4885
  };
4915
4886
  this._viewContainerRef.createEmbeddedView(this._templateRef, this._viewContext);
4916
4887
  }
4917
- static ngTemplateContextGuard(dir, ctx) {
4888
+ static ngTemplateContextGuard(_dir, _ctx) {
4918
4889
  return true;
4919
4890
  }
4920
4891
  _monitorInput(input) {
@@ -6298,7 +6269,6 @@ const getClosestOverlay = (element, openOverlays) => {
6298
6269
  /**
6299
6270
  * @deprecated `@ethlete/cdk` is in maintenance mode. Use the `@ethlete/components` equivalent instead - see https://ethlete-sdk-docs.web.app/cdk/migration, and run `nx g @ethlete/cdk:migrate-from-cdk` to rewrite the mechanical parts. Intent to remove in v6.
6300
6271
  */
6301
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
6302
6272
  class OverlayRef {
6303
6273
  get _internalDisableClose() {
6304
6274
  return this._disableCloseFromInternalInitiators.size > 0;
@@ -7135,6 +7105,14 @@ const cleanupFullscreenAnimationStyles = (containerEl, renderer, state) => {
7135
7105
  restoreOriginElement(renderer, state.originElement);
7136
7106
  }
7137
7107
  };
7108
+ const pinClonedContentToRect = (renderer, content, rect) => {
7109
+ renderer.setStyle(content, {
7110
+ inset: '0',
7111
+ boxSizing: 'border-box',
7112
+ width: `${rect.width}px`,
7113
+ height: `${rect.height}px`,
7114
+ });
7115
+ };
7138
7116
  const updateCloneLeaveAnimationStyles = (renderer, cloneEl, rect, transforms) => {
7139
7117
  renderer.setStyle(cloneEl, {
7140
7118
  top: `${rect.top}px`,
@@ -7142,6 +7120,10 @@ const updateCloneLeaveAnimationStyles = (renderer, cloneEl, rect, transforms) =>
7142
7120
  width: `${rect.width}px`,
7143
7121
  height: `${rect.height}px`,
7144
7122
  });
7123
+ const clonedContent = cloneEl.firstElementChild;
7124
+ if (clonedContent instanceof HTMLElement) {
7125
+ pinClonedContentToRect(renderer, clonedContent, rect);
7126
+ }
7145
7127
  renderer.setCssProperties(cloneEl, {
7146
7128
  '--leave-from-translate-x': `${transforms.cloneTranslateX}px`,
7147
7129
  '--leave-from-translate-y': `${transforms.cloneTranslateY}px`,
@@ -7153,7 +7135,7 @@ const updateCloneLeaveAnimationStyles = (renderer, cloneEl, rect, transforms) =>
7153
7135
  '--leave-to-scale-y': '1',
7154
7136
  });
7155
7137
  };
7156
- const createOriginClone = (originElement, deps) => {
7138
+ const createOriginClone = (originElement, rect, deps) => {
7157
7139
  const { injector, appRef, document, renderer } = deps;
7158
7140
  const cloneComponentRef = createComponent(OverlayOriginCloneComponent, {
7159
7141
  environmentInjector: injector,
@@ -7163,9 +7145,9 @@ const createOriginClone = (originElement, deps) => {
7163
7145
  renderer.setStyle(clonedContent, {
7164
7146
  margin: '0',
7165
7147
  position: 'relative',
7166
- boxSizing: computedStyle.boxSizing,
7167
7148
  display: computedStyle.display,
7168
7149
  });
7150
+ pinClonedContentToRect(renderer, clonedContent, rect);
7169
7151
  cloneComponentRef.location.nativeElement.appendChild(clonedContent);
7170
7152
  appRef.attachView(cloneComponentRef.hostView);
7171
7153
  document.body.appendChild(cloneComponentRef.location.nativeElement);
@@ -7243,8 +7225,9 @@ const startFullscreenEnterAnimation = (context, deps, applyTransformOrigin, skip
7243
7225
  if (!state.originElement) {
7244
7226
  throw new Error('Origin element is required for full animation');
7245
7227
  }
7246
- const transforms = calculateViewportTransforms(state.originElement);
7247
- const cloneComponentRef = createOriginClone(state.originElement, deps);
7228
+ const originElement = state.originElement;
7229
+ const transforms = calculateViewportTransforms(originElement);
7230
+ const cloneComponentRef = createOriginClone(originElement, transforms.rect, deps);
7248
7231
  const cloneEl = cloneComponentRef.location.nativeElement;
7249
7232
  applyCloneElementStyles(renderer, cloneEl, transforms.rect, transforms);
7250
7233
  applyContainerElementStyles(renderer, containerEl, transforms.rect, transforms);
@@ -7260,7 +7243,7 @@ const startFullscreenEnterAnimation = (context, deps, applyTransformOrigin, skip
7260
7243
  if (skipAnimation) {
7261
7244
  cloneComponentRef.instance.animatedLifecycle.forceEnteredState();
7262
7245
  containerInstance.animatedLifecycle.forceEnteredState();
7263
- hideOriginElement(renderer, state.originElement);
7246
+ hideOriginElement(renderer, originElement);
7264
7247
  mutableState.isOriginHidden = true;
7265
7248
  }
7266
7249
  else {
@@ -7275,7 +7258,7 @@ const startFullscreenEnterAnimation = (context, deps, applyTransformOrigin, skip
7275
7258
  return;
7276
7259
  cloneComponentRef.instance.animatedLifecycle.enter();
7277
7260
  containerInstance.animatedLifecycle.enter();
7278
- hideOriginElement(renderer, state.originElement);
7261
+ hideOriginElement(renderer, originElement);
7279
7262
  mutableState.isOriginHidden = true;
7280
7263
  });
7281
7264
  });
@@ -7320,7 +7303,7 @@ const startFullscreenLeaveAnimation = (context, state, deps, applyTransformOrigi
7320
7303
  let { cloneComponentRef } = state;
7321
7304
  let isOriginHidden = state.isOriginHidden;
7322
7305
  if (!cloneComponentRef) {
7323
- cloneComponentRef = createOriginClone(state.originElement, deps);
7306
+ cloneComponentRef = createOriginClone(state.originElement, transforms.rect, deps);
7324
7307
  const cloneEl = cloneComponentRef.location.nativeElement;
7325
7308
  applyCloneElementStyles(renderer, cloneEl, transforms.rect, transforms);
7326
7309
  applyContainerElementStyles(renderer, containerEl, transforms.rect, transforms);
@@ -8003,7 +7986,6 @@ class OverlayContainerComponent extends CdkDialogContainer {
8003
7986
  const elevation = this.resolvedSurfaceElevation();
8004
7987
  const resolved = resolveSurfaceByElevation(this.surfaceThemes, parentType, elevation);
8005
7988
  if (resolved) {
8006
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8007
7989
  setInputSignal(this.surfaceProvider.surface, resolved.name);
8008
7990
  }
8009
7991
  const unregister = this.surfaceContextTracker.register(parentType, elevation, this._elementRef.nativeElement);
@@ -8547,7 +8529,6 @@ const createOverlayHandlerWithQueryParamLifecycle = (config) => {
8547
8529
  updateQueryParam(null);
8548
8530
  };
8549
8531
  const getQueryParamInput = () => {
8550
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8551
8532
  return currentOverlayRef?.componentInstance?.[OVERLAY_QUERY_PARAM_INPUT_NAME];
8552
8533
  };
8553
8534
  effect(() => {
@@ -9314,7 +9295,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
9314
9295
  }, imports: [NgTemplateOutlet], styles: [".et-overlay-shared-route-template-outlet-host{display:contents}\n"] }]
9315
9296
  }] });
9316
9297
 
9317
- /* eslint-disable @typescript-eslint/no-explicit-any */
9318
9298
  const OVERLAY_SCROLL_BLOCKER_DEF = /* @__PURE__ */ defineRootProvider(() => {
9319
9299
  const overlayManager = injectOverlayManager();
9320
9300
  const document = inject(DOCUMENT);
@@ -15982,7 +15962,7 @@ class ComboboxDirective {
15982
15962
  this.customBodyErrorTpl$ = this._bodyErrorTemplate$.asObservable();
15983
15963
  this.customBodyEmptyTpl$ = this._bodyEmptyTemplate$.asObservable();
15984
15964
  this.customBodyMoreItemsHintTpl$ = this._bodyMoreItemsHintTemplate$.asObservable();
15985
- this.trackByOptionKeyFn = (index, item) => this._selectionModel.getKey(item);
15965
+ this.trackByOptionKeyFn = (_index, item) => this._selectionModel.getKey(item);
15986
15966
  this._selectionModel.setDisabledBinding('disabled');
15987
15967
  this._activeSelectionModel.setSelectionModel(this._selectionModel);
15988
15968
  setInputSignal(this._animatedOverlay.mirrorWidth, true);
@@ -16707,7 +16687,7 @@ class NativeSelectInputDirective {
16707
16687
  this._destroy$ = createDestroy();
16708
16688
  this.input = inject(INPUT_TOKEN);
16709
16689
  this.options = contentChildren(NATIVE_SELECT_OPTION_TOKEN, { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), descendants: true });
16710
- this._trackByFn = (index, option) => option.key() ?? option.value;
16690
+ this._trackByFn = (_index, option) => option.key() ?? option.value;
16711
16691
  }
16712
16692
  ngOnInit() {
16713
16693
  combineLatest([this.input.value$, this.input.nativeInputRef$])
@@ -16925,7 +16905,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
16925
16905
  /**
16926
16906
  * @deprecated `@ethlete/cdk` is in maintenance mode. Use the `@ethlete/components` equivalent instead - see https://ethlete-sdk-docs.web.app/cdk/migration, and run `nx g @ethlete/cdk:migrate-from-cdk` to rewrite the mechanical parts. Intent to remove in v6.
16927
16907
  */
16928
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16929
16908
  const SELECT_TOKEN = new InjectionToken('ET_SELECT_INPUT_TOKEN');
16930
16909
  let uniqueId$1 = 0;
16931
16910
  /**
@@ -17836,17 +17815,21 @@ const isTouchEvent = (event) => {
17836
17815
  };
17837
17816
  const getTouchIdForSlider = (event, slider) => {
17838
17817
  for (let i = 0; i < event.touches.length; i++) {
17839
- const target = event.touches[i].target;
17818
+ const touch = event.touches.item(i);
17819
+ if (!touch)
17820
+ continue;
17821
+ const target = touch.target;
17840
17822
  if (slider === target || slider.contains(target)) {
17841
- return event.touches[i].identifier;
17823
+ return touch.identifier;
17842
17824
  }
17843
17825
  }
17844
17826
  return null;
17845
17827
  };
17846
17828
  const findMatchingTouch = (touches, id) => {
17847
17829
  for (let i = 0; i < touches.length; i++) {
17848
- if (touches[i].identifier === id) {
17849
- return touches[i];
17830
+ const touch = touches.item(i);
17831
+ if (touch?.identifier === id) {
17832
+ return touch;
17850
17833
  }
17851
17834
  }
17852
17835
  return null;
@@ -17894,8 +17877,8 @@ class SliderComponent {
17894
17877
  this._dir$ = this._dirService.change.pipe(startWith(this._dirService.value));
17895
17878
  this._value$ = combineLatest([this._input.value$, this._min$, this._max$]).pipe(map(([value, min, max]) => clamp(value ?? 0, min, max)));
17896
17879
  this._roundToDecimal$ = this._step$.pipe(map((step) => {
17897
- const stepString = step.toString();
17898
- return stepString.includes('.') ? stepString.split('.')[1].length : 0;
17880
+ const [, decimals] = step.toString().split('.');
17881
+ return decimals?.length ?? 0;
17899
17882
  }));
17900
17883
  this._percent$ = combineLatest([this._value$, this._min$, this._max$]).pipe(map(([value, min, max]) => (value - min) / (max - min)));
17901
17884
  this._shouldInvertAxis$ = combineLatest([this._vertical$, this._inverted$]).pipe(map(([vertical, inverted]) => (vertical ? !inverted : inverted)));
@@ -19623,12 +19606,13 @@ class QueryErrorDirective {
19623
19606
  errorList.items.push({ message: defaultErrorMessage });
19624
19607
  }
19625
19608
  errorList.isList = errorList.items.length > 1;
19626
- if (errorList.items.length === 1) {
19609
+ const [onlyItem] = errorList.items;
19610
+ if (errorList.items.length === 1 && onlyItem) {
19627
19611
  const compareString = (str) => str.toLowerCase().replace(/\s/g, '').replace(/\.|,/g, '');
19628
- if (compareString(errorList.items[0].message) === compareString(errorList.title)) {
19612
+ if (compareString(onlyItem.message) === compareString(errorList.title)) {
19629
19613
  // Often the error title is the same as the error message. In this case we simply use the default error message as a message.
19630
19614
  // This way the same text is at least not displayed twice.
19631
- errorList.items[0].message = defaultErrorMessage;
19615
+ onlyItem.message = defaultErrorMessage;
19632
19616
  }
19633
19617
  }
19634
19618
  return errorList;
@@ -19667,7 +19651,7 @@ class QueryErrorComponent {
19667
19651
  ...(ngDevMode ? [{ debugName: "canBeRetried" }] : /* istanbul ignore next */ []));
19668
19652
  this.isList = computed(() => this.errorList()?.isList ?? false, /* @ts-ignore */
19669
19653
  ...(ngDevMode ? [{ debugName: "isList" }] : /* istanbul ignore next */ []));
19670
- this.trackByFn = (index, item) => item.message;
19654
+ this.trackByFn = (_index, item) => item.message;
19671
19655
  }
19672
19656
  retry() {
19673
19657
  extractQuery(this.host.query())?.execute({ skipCache: true });