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

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,14 @@
1
1
  # @ethlete/cdk
2
2
 
3
+ ## 5.0.0-next.27
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+ or API change.
9
+
10
+ - [#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.
11
+
3
12
  ## 5.0.0-next.26
4
13
 
5
14
  ### 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;
@@ -7243,8 +7213,9 @@ const startFullscreenEnterAnimation = (context, deps, applyTransformOrigin, skip
7243
7213
  if (!state.originElement) {
7244
7214
  throw new Error('Origin element is required for full animation');
7245
7215
  }
7246
- const transforms = calculateViewportTransforms(state.originElement);
7247
- const cloneComponentRef = createOriginClone(state.originElement, deps);
7216
+ const originElement = state.originElement;
7217
+ const transforms = calculateViewportTransforms(originElement);
7218
+ const cloneComponentRef = createOriginClone(originElement, deps);
7248
7219
  const cloneEl = cloneComponentRef.location.nativeElement;
7249
7220
  applyCloneElementStyles(renderer, cloneEl, transforms.rect, transforms);
7250
7221
  applyContainerElementStyles(renderer, containerEl, transforms.rect, transforms);
@@ -7260,7 +7231,7 @@ const startFullscreenEnterAnimation = (context, deps, applyTransformOrigin, skip
7260
7231
  if (skipAnimation) {
7261
7232
  cloneComponentRef.instance.animatedLifecycle.forceEnteredState();
7262
7233
  containerInstance.animatedLifecycle.forceEnteredState();
7263
- hideOriginElement(renderer, state.originElement);
7234
+ hideOriginElement(renderer, originElement);
7264
7235
  mutableState.isOriginHidden = true;
7265
7236
  }
7266
7237
  else {
@@ -7275,7 +7246,7 @@ const startFullscreenEnterAnimation = (context, deps, applyTransformOrigin, skip
7275
7246
  return;
7276
7247
  cloneComponentRef.instance.animatedLifecycle.enter();
7277
7248
  containerInstance.animatedLifecycle.enter();
7278
- hideOriginElement(renderer, state.originElement);
7249
+ hideOriginElement(renderer, originElement);
7279
7250
  mutableState.isOriginHidden = true;
7280
7251
  });
7281
7252
  });
@@ -8003,7 +7974,6 @@ class OverlayContainerComponent extends CdkDialogContainer {
8003
7974
  const elevation = this.resolvedSurfaceElevation();
8004
7975
  const resolved = resolveSurfaceByElevation(this.surfaceThemes, parentType, elevation);
8005
7976
  if (resolved) {
8006
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8007
7977
  setInputSignal(this.surfaceProvider.surface, resolved.name);
8008
7978
  }
8009
7979
  const unregister = this.surfaceContextTracker.register(parentType, elevation, this._elementRef.nativeElement);
@@ -8547,7 +8517,6 @@ const createOverlayHandlerWithQueryParamLifecycle = (config) => {
8547
8517
  updateQueryParam(null);
8548
8518
  };
8549
8519
  const getQueryParamInput = () => {
8550
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8551
8520
  return currentOverlayRef?.componentInstance?.[OVERLAY_QUERY_PARAM_INPUT_NAME];
8552
8521
  };
8553
8522
  effect(() => {
@@ -9314,7 +9283,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
9314
9283
  }, imports: [NgTemplateOutlet], styles: [".et-overlay-shared-route-template-outlet-host{display:contents}\n"] }]
9315
9284
  }] });
9316
9285
 
9317
- /* eslint-disable @typescript-eslint/no-explicit-any */
9318
9286
  const OVERLAY_SCROLL_BLOCKER_DEF = /* @__PURE__ */ defineRootProvider(() => {
9319
9287
  const overlayManager = injectOverlayManager();
9320
9288
  const document = inject(DOCUMENT);
@@ -15982,7 +15950,7 @@ class ComboboxDirective {
15982
15950
  this.customBodyErrorTpl$ = this._bodyErrorTemplate$.asObservable();
15983
15951
  this.customBodyEmptyTpl$ = this._bodyEmptyTemplate$.asObservable();
15984
15952
  this.customBodyMoreItemsHintTpl$ = this._bodyMoreItemsHintTemplate$.asObservable();
15985
- this.trackByOptionKeyFn = (index, item) => this._selectionModel.getKey(item);
15953
+ this.trackByOptionKeyFn = (_index, item) => this._selectionModel.getKey(item);
15986
15954
  this._selectionModel.setDisabledBinding('disabled');
15987
15955
  this._activeSelectionModel.setSelectionModel(this._selectionModel);
15988
15956
  setInputSignal(this._animatedOverlay.mirrorWidth, true);
@@ -16707,7 +16675,7 @@ class NativeSelectInputDirective {
16707
16675
  this._destroy$ = createDestroy();
16708
16676
  this.input = inject(INPUT_TOKEN);
16709
16677
  this.options = contentChildren(NATIVE_SELECT_OPTION_TOKEN, { ...(ngDevMode ? { debugName: "options" } : /* istanbul ignore next */ {}), descendants: true });
16710
- this._trackByFn = (index, option) => option.key() ?? option.value;
16678
+ this._trackByFn = (_index, option) => option.key() ?? option.value;
16711
16679
  }
16712
16680
  ngOnInit() {
16713
16681
  combineLatest([this.input.value$, this.input.nativeInputRef$])
@@ -16925,7 +16893,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
16925
16893
  /**
16926
16894
  * @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
16895
  */
16928
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16929
16896
  const SELECT_TOKEN = new InjectionToken('ET_SELECT_INPUT_TOKEN');
16930
16897
  let uniqueId$1 = 0;
16931
16898
  /**
@@ -17836,17 +17803,21 @@ const isTouchEvent = (event) => {
17836
17803
  };
17837
17804
  const getTouchIdForSlider = (event, slider) => {
17838
17805
  for (let i = 0; i < event.touches.length; i++) {
17839
- const target = event.touches[i].target;
17806
+ const touch = event.touches.item(i);
17807
+ if (!touch)
17808
+ continue;
17809
+ const target = touch.target;
17840
17810
  if (slider === target || slider.contains(target)) {
17841
- return event.touches[i].identifier;
17811
+ return touch.identifier;
17842
17812
  }
17843
17813
  }
17844
17814
  return null;
17845
17815
  };
17846
17816
  const findMatchingTouch = (touches, id) => {
17847
17817
  for (let i = 0; i < touches.length; i++) {
17848
- if (touches[i].identifier === id) {
17849
- return touches[i];
17818
+ const touch = touches.item(i);
17819
+ if (touch?.identifier === id) {
17820
+ return touch;
17850
17821
  }
17851
17822
  }
17852
17823
  return null;
@@ -17894,8 +17865,8 @@ class SliderComponent {
17894
17865
  this._dir$ = this._dirService.change.pipe(startWith(this._dirService.value));
17895
17866
  this._value$ = combineLatest([this._input.value$, this._min$, this._max$]).pipe(map(([value, min, max]) => clamp(value ?? 0, min, max)));
17896
17867
  this._roundToDecimal$ = this._step$.pipe(map((step) => {
17897
- const stepString = step.toString();
17898
- return stepString.includes('.') ? stepString.split('.')[1].length : 0;
17868
+ const [, decimals] = step.toString().split('.');
17869
+ return decimals?.length ?? 0;
17899
17870
  }));
17900
17871
  this._percent$ = combineLatest([this._value$, this._min$, this._max$]).pipe(map(([value, min, max]) => (value - min) / (max - min)));
17901
17872
  this._shouldInvertAxis$ = combineLatest([this._vertical$, this._inverted$]).pipe(map(([vertical, inverted]) => (vertical ? !inverted : inverted)));
@@ -19623,12 +19594,13 @@ class QueryErrorDirective {
19623
19594
  errorList.items.push({ message: defaultErrorMessage });
19624
19595
  }
19625
19596
  errorList.isList = errorList.items.length > 1;
19626
- if (errorList.items.length === 1) {
19597
+ const [onlyItem] = errorList.items;
19598
+ if (errorList.items.length === 1 && onlyItem) {
19627
19599
  const compareString = (str) => str.toLowerCase().replace(/\s/g, '').replace(/\.|,/g, '');
19628
- if (compareString(errorList.items[0].message) === compareString(errorList.title)) {
19600
+ if (compareString(onlyItem.message) === compareString(errorList.title)) {
19629
19601
  // 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
19602
  // This way the same text is at least not displayed twice.
19631
- errorList.items[0].message = defaultErrorMessage;
19603
+ onlyItem.message = defaultErrorMessage;
19632
19604
  }
19633
19605
  }
19634
19606
  return errorList;
@@ -19667,7 +19639,7 @@ class QueryErrorComponent {
19667
19639
  ...(ngDevMode ? [{ debugName: "canBeRetried" }] : /* istanbul ignore next */ []));
19668
19640
  this.isList = computed(() => this.errorList()?.isList ?? false, /* @ts-ignore */
19669
19641
  ...(ngDevMode ? [{ debugName: "isList" }] : /* istanbul ignore next */ []));
19670
- this.trackByFn = (index, item) => item.message;
19642
+ this.trackByFn = (_index, item) => item.message;
19671
19643
  }
19672
19644
  retry() {
19673
19645
  extractQuery(this.host.query())?.execute({ skipCache: true });