@ethlete/components 1.0.0-next.110 → 1.0.0-next.112

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.
@@ -71,6 +71,11 @@
71
71
  "schema": "./migrate-tabs-active-underline/schema.json",
72
72
  "description": "Remove the activeUnderline option from provideTabsConfig calls"
73
73
  },
74
+ "migrate-tab-bar-active-underline-input": {
75
+ "factory": "./migrate-tab-bar-active-underline-input/migration",
76
+ "schema": "./migrate-tab-bar-active-underline-input/schema.json",
77
+ "description": "Remove the activeUnderline input from tab group and nav tabs templates"
78
+ },
74
79
  "migrate-youtube-player-slot-directive": {
75
80
  "factory": "./migrate-youtube-player-slot-directive/migration",
76
81
  "schema": "./migrate-youtube-player-slot-directive/schema.json",
@@ -0,0 +1,41 @@
1
+ import { formatFiles } from '@nx/devkit';
2
+ import { createMigrationScope } from '../migrate-query-error-labels/migration-scope.js';
3
+ import { importsEthleteComponents, isTabBarTemplateCandidate, removeActiveUnderlineInput, } from './tab-bar-active-underline-input.js';
4
+ export default async function migrateTabBarActiveUnderlineInput(tree, schema) {
5
+ console.log('\n🔎 Removing the activeUnderline input from tab groups and nav tabs...');
6
+ const scope = createMigrationScope(tree, schema);
7
+ console.log(` Scope: ${scope.describe()}`);
8
+ const changed = [];
9
+ const needsRule = [];
10
+ scope.visit(tree, (filePath) => {
11
+ if (!isTabBarTemplateCandidate(filePath))
12
+ return;
13
+ const content = tree.read(filePath, 'utf-8');
14
+ if (!content)
15
+ return;
16
+ if (filePath.endsWith('.ts') && !importsEthleteComponents(content))
17
+ return;
18
+ const result = removeActiveUnderlineInput(content);
19
+ if (result === null)
20
+ return;
21
+ tree.write(filePath, result.content);
22
+ changed.push(filePath);
23
+ if (result.disabled)
24
+ needsRule.push(filePath);
25
+ });
26
+ if (!schema.skipFormat) {
27
+ await formatFiles(tree);
28
+ }
29
+ if (changed.length === 0) {
30
+ console.log('\n✅ Nothing to do.');
31
+ return;
32
+ }
33
+ console.log(`\n✅ Removed the activeUnderline input in ${changed.length} file(s).`);
34
+ if (needsRule.length > 0) {
35
+ console.log('\n⚠️ These files turned the active underline off or bound it to a value. Keep a bar without it with a host rule:');
36
+ for (const filePath of needsRule)
37
+ console.log(` ${filePath}`);
38
+ console.log(" .et-tab-group, .et-nav-tabs { --et-tab-bar-underline-size: 0px; --et-tab-baseline-size: 2px; }\n .et-tab-group[data-variant='primary'], .et-nav-tabs[data-variant='primary'] { --et-tab-baseline-size: 3px; }");
39
+ }
40
+ }
41
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "migrate-tab-bar-active-underline-input",
4
+ "title": "Remove the activeUnderline input from tab group and nav tabs templates",
5
+ "type": "object",
6
+ "properties": {
7
+ "projects": {
8
+ "type": "array",
9
+ "items": { "type": "string" },
10
+ "description": "Nx projects to scan. Defaults to every project in the workspace.",
11
+ "alias": "project"
12
+ },
13
+ "include": {
14
+ "type": "array",
15
+ "items": { "type": "string" },
16
+ "description": "Path prefixes to scan, relative to the workspace root (e.g. 'apps/shop'). Unioned with `projects`.",
17
+ "alias": "includePath"
18
+ },
19
+ "skipFormat": {
20
+ "type": "boolean",
21
+ "description": "Skip formatting files after migration",
22
+ "default": false
23
+ }
24
+ },
25
+ "required": []
26
+ }
@@ -0,0 +1,23 @@
1
+ const TAG = /<(?:et-tab-group|et-nav-tabs)\b[^>]*>/g;
2
+ const INPUT = /[ \t]*\r?\n?[ \t]*(\[activeUnderline\]|activeUnderline)(?:\s*=\s*"([^"]*)")?(?=[\s/>])/;
3
+ export const isTabBarTemplateCandidate = (filePath) => (filePath.endsWith('.html') || (filePath.endsWith('.ts') && !filePath.endsWith('.d.ts'))) &&
4
+ !filePath.includes('node_modules');
5
+ export const importsEthleteComponents = (content) => /from\s*['"]@ethlete\/components(?:\/[^'"]*)?['"]/.test(content);
6
+ /**
7
+ * Returns the source without the `activeUnderline` input on `<et-tab-group>` and `<et-nav-tabs>`, or `null` when
8
+ * there is none. `disabled` is true when a removed value was not literally `true`.
9
+ */
10
+ export const removeActiveUnderlineInput = (content) => {
11
+ let disabled = false;
12
+ const next = content.replace(TAG, (tag) => {
13
+ const match = INPUT.exec(tag);
14
+ if (!match)
15
+ return tag;
16
+ const value = match[2]?.trim();
17
+ if (!(match[1] === '[activeUnderline]' && value === 'true'))
18
+ disabled = true;
19
+ return tag.replace(INPUT, '');
20
+ });
21
+ return next === content ? null : { content: next, disabled };
22
+ };
23
+ //# sourceMappingURL=tab-bar-active-underline-input.js.map
package/migrations.json CHANGED
@@ -233,6 +233,15 @@
233
233
  "description": "Remove --et-scrollable-buttons-end-space, which is removed, from stylesheets and inline styles: the inside buttons lie over the items.",
234
234
  "generator": "@ethlete/components:migrate-scrollable-end-space",
235
235
  "docs": "/components/scrollable"
236
+ },
237
+ {
238
+ "name": "tab-bar-active-underline-input",
239
+ "version": "1.0.0-next.111",
240
+ "kind": "auto",
241
+ "level": "required",
242
+ "description": "Remove the activeUnderline input of et-tab-group and et-nav-tabs, which is removed: where a bar turned it off, a host CSS rule (--et-tab-bar-underline-size: 0px) replaces it.",
243
+ "generator": "@ethlete/components:migrate-tab-bar-active-underline-input",
244
+ "docs": "/components/tabs"
236
245
  }
237
246
  ]
238
247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/components",
3
- "version": "1.0.0-next.110",
3
+ "version": "1.0.0-next.112",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/ethlete-io/ethdk",
@@ -156,10 +156,6 @@
156
156
  border-radius: 0 var(--et-tab-bar-underline-size) var(--et-tab-bar-underline-size) 0;
157
157
  }
158
158
 
159
- [data-active-underline='false'] .et-tab-bar-underline--active {
160
- opacity: 0;
161
- }
162
-
163
159
  [data-underline-width='label'][data-orientation='horizontal'] .et-tab-group__trigger .et-tab-bar-underline {
164
160
  left: var(--et-tab-group-trigger-padding-inline);
165
161
  right: var(--et-tab-group-trigger-padding-inline);
@@ -11,6 +11,8 @@ import { Observable } from "rxjs";
11
11
  import * as i1 from "@angular/router";
12
12
  import { RouterLink } from "@angular/router";
13
13
  export type AccordionConfig = {
14
+ /** Default for `scrollOnOpen` on every accordion. An explicit `[scrollOnOpen]` input still wins. */
15
+ scrollOnOpen?: boolean;
14
16
  /** Default for `lastDivider` on every accordion group. An explicit `[lastDivider]` input still wins. */
15
17
  lastDivider?: boolean;
16
18
  };
@@ -48,6 +50,9 @@ export declare const ACCORDION_ERROR_CODES: {
48
50
  */
49
51
  export declare class AccordionDirective {
50
52
  private group;
53
+ private config;
54
+ private injector;
55
+ private destroyRef;
51
56
  /** Whether the panel is expanded. Two-way bindable. */
52
57
  isOpen: import("@angular/core").ModelSignal<boolean>;
53
58
  /**
@@ -60,6 +65,8 @@ export declare class AccordionDirective {
60
65
  * disabled, so screen-reader users can still reach the header and hear that it can't be expanded.
61
66
  */
62
67
  disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
68
+ /** Reveal the panel after the user opens it with the trigger. Defaults to `true`. */
69
+ scrollOnOpen: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
63
70
  /**
64
71
  * Set one frame after the first render. Gate open/close transitions on `[data-can-animate]` so a
65
72
  * panel that starts open renders open instead of animating in.
@@ -76,16 +83,19 @@ export declare class AccordionDirective {
76
83
  * collapse would throw away its state and leave nothing to animate the collapse with.
77
84
  */
78
85
  hasBeenOpened: import("@angular/core").WritableSignal<boolean>;
86
+ private shouldScrollOnOpen;
87
+ private scrollRequest;
79
88
  constructor();
80
89
  /** Expand the panel. No-op while `disabled`. */
81
90
  open(): void;
82
91
  /** Collapse the panel. Works even while `disabled` - a disabled accordion can still be closed programmatically. */
83
92
  close(): void;
84
93
  /**
85
- * Expand or collapse the panel - what the trigger calls. No-op while `disabled`, and no-op when this
86
- * is the last open panel of a group with `preventCloseLast`.
94
+ * Expand or collapse the panel. No-op while `disabled`, and no-op when this is the last open panel of a
95
+ * group with `preventCloseLast`.
87
96
  */
88
97
  toggle(): void;
98
+ private revealOpenedPanel;
89
99
  static ɵfac: i0.ɵɵFactoryDeclaration<AccordionDirective, never>;
90
100
  static ɵdir: i0.ɵɵDirectiveDeclaration<AccordionDirective, "[etAccordion]", ["etAccordion"], {
91
101
  "isOpen": {
@@ -103,6 +113,11 @@ export declare class AccordionDirective {
103
113
  "required": false;
104
114
  "isSignal": true;
105
115
  };
116
+ "scrollOnOpen": {
117
+ "alias": "scrollOnOpen";
118
+ "required": false;
119
+ "isSignal": true;
120
+ };
106
121
  }, {
107
122
  "isOpen": "isOpenChange";
108
123
  }, never, never, true, never>;
@@ -232,7 +247,6 @@ export declare class AccordionGroupComponent {
232
247
  */
233
248
  export declare class AccordionPanelDirective {
234
249
  protected accordion: import("@ethlete/components").AccordionDirective | null;
235
- private hostElement;
236
250
  constructor();
237
251
  static ɵfac: i0.ɵɵFactoryDeclaration<AccordionPanelDirective, never>;
238
252
  static ɵdir: i0.ɵɵDirectiveDeclaration<AccordionPanelDirective, "[etAccordionPanel]", ["etAccordionPanel"], {}, {}, never, never, true, never>;
@@ -354,6 +368,7 @@ export declare class AccordionComponent {
354
368
  "isOpen": "isOpen";
355
369
  "isOpenByDefault": "isOpenByDefault";
356
370
  "disabled": "disabled";
371
+ "scrollOnOpen": "scrollOnOpen";
357
372
  };
358
373
  outputs: {
359
374
  "isOpenChange": "isOpenChange";
@@ -35959,8 +35974,6 @@ export declare class TabBarDirective {
35959
35974
  align: import("@angular/core").InputSignal<TabBarAlign>;
35960
35975
  variant: import("@angular/core").InputSignal<TabBarVariant>;
35961
35976
  divider: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
35962
- /** Shows the underline under the active tab. Falls back to `provideTabsConfig`, then `true`. */
35963
- activeUnderline: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
35964
35977
  /** Whether the active underline spans the whole tab or only its label. Falls back to `provideTabsConfig`, then `'tab'`. */
35965
35978
  underlineWidth: import("@angular/core").InputSignal<TabUnderlineWidth | undefined>;
35966
35979
  /**
@@ -36008,11 +36021,6 @@ export declare class TabBarDirective {
36008
36021
  "required": false;
36009
36022
  "isSignal": true;
36010
36023
  };
36011
- "activeUnderline": {
36012
- "alias": "activeUnderline";
36013
- "required": false;
36014
- "isSignal": true;
36015
- };
36016
36024
  "underlineWidth": {
36017
36025
  "alias": "underlineWidth";
36018
36026
  "required": false;
@@ -36162,7 +36170,6 @@ export declare class NavTabsComponent {
36162
36170
  "align": "align";
36163
36171
  "divider": "divider";
36164
36172
  "variant": "variant";
36165
- "activeUnderline": "activeUnderline";
36166
36173
  "underlineWidth": "underlineWidth";
36167
36174
  "scrollableButtons": "scrollableButtons";
36168
36175
  "renderMasks": "renderMasks";
@@ -36360,7 +36367,6 @@ export declare class TabGroupComponent {
36360
36367
  "align": "align";
36361
36368
  "divider": "divider";
36362
36369
  "variant": "variant";
36363
- "activeUnderline": "activeUnderline";
36364
36370
  "underlineWidth": "underlineWidth";
36365
36371
  "scrollableButtons": "scrollableButtons";
36366
36372
  "renderMasks": "renderMasks";
@@ -37598,5 +37604,5 @@ export declare const provideUnsavedChangesLabels: (labels: import("@ethlete/core
37598
37604
  export declare const injectUnsavedChangesLabels: () => import("@angular/core").Signal<UnsavedChangesLabels>;
37599
37605
  export declare const UNSAVED_CHANGES_LABELS: import("@angular/core").InjectionToken<import("@ethlete/core").LabelsSource<UnsavedChangesLabels>>;
37600
37606
  /** The version of `@ethlete/components` this build was cut from. */
37601
- export declare const COMPONENTS_VERSION = "1.0.0-next.110";
37607
+ export declare const COMPONENTS_VERSION = "1.0.0-next.112";
37602
37608
  export { type AlertDialogComponentSlot, type AlertDialogSlot, type AlertDialogTemplateSlot, type AppointmentTreeNode, BRACKET_DATA_LAYOUT, BRACKET_ERROR_CODES, BRACKET_FINAL_ALIGNMENT, BRACKET_ROUND_MIRROR_TYPE, BRACKET_SECTION_KEY, BRACKET_SWISS_GROUP_COLOR_TYPE, type Bracket, type BracketByeSlotSource, type BracketComponents, type BracketContinueComponent, type BracketDataLayout, type BracketDataSource, type BracketDrawing, type BracketEdge, type BracketExternalSlotSource, type BracketFinalAlignment, type BracketGradient, type BracketGradientStop, type BracketGridSection, type BracketLayoutSettings, BracketMap, type BracketMatch, type BracketMatchComponent, type BracketMatchFactor, type BracketMatchId, type BracketMatchInputs, type BracketMatchOutcomeSlotSource, type BracketMatchParticipant, type BracketMatchPosition, type BracketMatchRelation, type BracketMatchRelationNone, type BracketMatchRelationNothingToOne, type BracketMatchRelationOneToNothing, type BracketMatchRelationOneToOne, type BracketMatchRelationTwoToNothing, type BracketMatchRelationTwoToOne, type BracketMatchShortId, type BracketMatchSlot, type BracketMatchSource, type BracketMatchStatus, type BracketParticipant, type BracketParticipantMatch, type BracketPickMigration, type BracketPickMigrationOptions, type BracketPickSet, type BracketRect, type BracketRound, type BracketRoundHeaderComponent, type BracketRoundId, type BracketRoundMapWithSwissData, type BracketRoundMirrorType, type BracketRoundPosition, type BracketRoundRelation, type BracketRoundRelationNone, type BracketRoundRelationNothingToOne, type BracketRoundRelationOneToNothing, type BracketRoundRelationOneToOne, type BracketRoundRelationTwoToNothing, type BracketRoundRelationTwoToOne, type BracketRoundShortId, type BracketRoundSource, type BracketRoundSwissData, type BracketRoundSwissGroup, type BracketRoundSwissGroupId, type BracketRoundSwissGroupMap, type BracketRoundType, BracketRuntimeError, type BracketSectionKey, type BracketSectionTitleComponent, type BracketSeedSlotSource, type BracketSlotResolutionPolicy, type BracketSlotSource, type BracketSlotSourceKind, type BracketStandingRankSide, type BracketStandingRankSlotSource, type BracketSwissBucketSlotSource, type BracketSwissColors, type BracketSwissGroupColorType, type BracketWarning, COMMON_BRACKET_ROUND_TYPE, type CalendarBandPosition, type CalendarInterval, type CalendarPrecision, type CalendarSelectionFlags, type CalendarView, type CalendarWeekStartsOn, type CascaderCompareWith, type CascaderDataSource, type CascaderNode, type CommonBracketRoundType, type ComputedBracketGrid, type CreateBracketGridConfig, type CreateBracketOptions, type CreateGridAdapterOptions, DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE, type DateRangeSide, type DateRangeSide as TimeRangeInputSide, type DateRangeValue, type DateRangeValue as DateTimeRangeValue, type DateRangeValue as TimeRangeValue, type DoubleEliminationBracketRoundType, type DropzoneCropConfig, type DropzoneCropCorner, type DropzoneCropRect, type DropzoneCropShape, type DurationFormatSpec, type DurationSegment, type DurationUnit, GROUP_BRACKET_ROUND_TYPE, type GridAdapter, type GridAdapterBreakpoints, type GridConfig, type GroupBracketRoundType, type MatchParticipantId, type MatchParticipantShortId, type MatchParticipantSide, type ParticipantMatchResult, type PlaceholderBracketShape, type RichTextEditorHeadingLevel, type RichTextEditorImageFailure, type RichTextEditorImageFailureReason, type RichTextEditorImageUpload, type RichTextEditorImageUploadContext, type RichTextEditorImageUploadFn, type RichTextEditorTokenChip, type RichTextEditorTokenCodec, SINGLE_ELIMINATION_BRACKET_ROUND_TYPE, SWISS_BRACKET_ROUND_TYPE, type SchedulerAgendaDay, type SchedulerMonthDayCell, type SchedulerTimeGridAllDayEntry, type SchedulerTimeGridBlock, type SchedulerTimeGridDay, type SchedulerTimeGridSegment, type ScrollableActiveChildRef, type ScrollableButtonPosition, type ScrollableButtonsConfig, type ScrollableButtonsDefaults, type ScrollableChrome, type ScrollableChromeSlot, type ScrollableConfig, type ScrollableDirection, type ScrollableIntersectionChange, type ScrollableItemSize, type ScrollableLoadingTemplatePosition, type ScrollableLoadingTemplateRef, type ScrollableMaskVariant, type ScrollableNavigation, type ScrollableNavigationConfig, type ScrollableNavigationItem, type ScrollableResponsive, type ScrollableScrollMode, type ScrollableScrollOrigin, type ScrollableScrollState, type ScrollbarGeometry, type ScrollbarOrientation, type ScrollbarTarget, type SerializeOptions, type SingleEliminationBracketRoundType, type StandingPick, type StandingPickOutcome, type SwissBracketRoundType, TOURNAMENT_MODE, type TournamentMode, bracketSlot, createBracket, createPlaceholderBracketSource, injectRichTextEditorTools, isBracketSlotPredictable, migrateBracketPicks, resolveBracketSlot, standingRankSides, swapStandingRank, validateBracketSource };