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

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.
@@ -61,6 +61,11 @@
61
61
  "schema": "./migrate-state-token-names/schema.json",
62
62
  "description": "Rename the component state tokens to one pattern, state before property"
63
63
  },
64
+ "migrate-scrollable-end-space": {
65
+ "factory": "./migrate-scrollable-end-space/migration",
66
+ "schema": "./migrate-scrollable-end-space/schema.json",
67
+ "description": "Remove the removed --et-scrollable-buttons-end-space declaration from stylesheets and templates"
68
+ },
64
69
  "migrate-tabs-active-underline": {
65
70
  "factory": "./migrate-tabs-active-underline/migration",
66
71
  "schema": "./migrate-tabs-active-underline/schema.json",
@@ -0,0 +1,33 @@
1
+ import { formatFiles } from '@nx/devkit';
2
+ import { createMigrationScope } from '../migrate-query-error-labels/migration-scope.js';
3
+ import { isScrollableEndSpaceCandidate, removeScrollableEndSpace } from './scrollable-end-space.js';
4
+ export default async function migrateScrollableEndSpace(tree, schema) {
5
+ console.log('\nšŸ”Ž Removing --et-scrollable-buttons-end-space...');
6
+ const scope = createMigrationScope(tree, schema);
7
+ console.log(` Scope: ${scope.describe()}`);
8
+ const changed = [];
9
+ scope.visit(tree, (filePath) => {
10
+ if (!isScrollableEndSpaceCandidate(filePath))
11
+ return;
12
+ const content = tree.read(filePath, 'utf-8');
13
+ if (!content)
14
+ return;
15
+ const next = removeScrollableEndSpace(content);
16
+ if (next === null)
17
+ return;
18
+ tree.write(filePath, next);
19
+ changed.push(filePath);
20
+ });
21
+ if (!schema.skipFormat) {
22
+ await formatFiles(tree);
23
+ }
24
+ if (changed.length > 0) {
25
+ console.log(`\nāœ… Removed the end-space declaration in ${changed.length} file(s):`);
26
+ for (const filePath of changed)
27
+ console.log(` ${filePath}`);
28
+ }
29
+ else {
30
+ console.log('\nāœ… Nothing to do.');
31
+ }
32
+ }
33
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "migrate-scrollable-end-space",
4
+ "title": "Remove the removed --et-scrollable-buttons-end-space declaration from stylesheets and 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,11 @@
1
+ const SCANNED = /\.(css|scss|sass|less|html|ts)$/;
2
+ const DECLARATION = /[ \t]*--et-scrollable-buttons-end-space[ \t]*:[^;}"'`\n]*(?:;[ \t]*(?:\r?\n)?|(?=[}"'`\n]))/g;
3
+ export const isScrollableEndSpaceCandidate = (filePath) => SCANNED.test(filePath) && !filePath.endsWith('.d.ts');
4
+ /** Returns the content without any `--et-scrollable-buttons-end-space` declaration, or `null` when it holds none. */
5
+ export const removeScrollableEndSpace = (content) => {
6
+ if (!content.includes('--et-scrollable-buttons-end-space'))
7
+ return null;
8
+ const next = content.replace(DECLARATION, '');
9
+ return next === content ? null : next;
10
+ };
11
+ //# sourceMappingURL=scrollable-end-space.js.map
package/migrations.json CHANGED
@@ -224,6 +224,15 @@
224
224
  "description": "Move @ethlete/bracket imports to @ethlete/components/bracket and remove @ethlete/bracket, which is no longer published, from package.json.",
225
225
  "generator": "@ethlete/components:migrate-bracket-entry-point",
226
226
  "docs": "/bracket/index"
227
+ },
228
+ {
229
+ "name": "scrollable-end-space",
230
+ "version": "1.0.0-next.109",
231
+ "kind": "auto",
232
+ "level": "required",
233
+ "description": "Remove --et-scrollable-buttons-end-space, which is removed, from stylesheets and inline styles: the inside buttons lie over the items.",
234
+ "generator": "@ethlete/components:migrate-scrollable-end-space",
235
+ "docs": "/components/scrollable"
227
236
  }
228
237
  ]
229
238
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/components",
3
- "version": "1.0.0-next.108",
3
+ "version": "1.0.0-next.110",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/ethlete-io/ethdk",
@@ -5,12 +5,6 @@
5
5
  initial-value: 0px;
6
6
  }
7
7
 
8
- @property --et-scrollable-buttons-end-space {
9
- syntax: '<length>';
10
- inherits: true;
11
- initial-value: 0px;
12
- }
13
-
14
8
  @property --et-scrollable-buttons-extent {
15
9
  syntax: '*';
16
10
  inherits: true;
@@ -127,68 +121,6 @@
127
121
  }
128
122
  }
129
123
 
130
- &.et-scrollable--can-scroll:not(.et-scrollable--masked):has(
131
- > .et-scrollable-wrapper > .et-scrollable-buttons--inside
132
- ) {
133
- & > .et-scrollable-wrapper > .et-scrollable-container {
134
- --_et-scrollable-button-space: clamp(0px, var(--et-scrollable-buttons-end-space), 50%);
135
- --_et-scrollable-start-clip: 0px;
136
- --_et-scrollable-end-clip: 0px;
137
- --_et-scrollable-scrollbar-edge: calc(100% - var(--_et-scrollable-scrollbar-size, 0px));
138
- }
139
-
140
- &:not(.et-scrollable--is-at-start) > .et-scrollable-wrapper > .et-scrollable-container {
141
- --_et-scrollable-start-clip: var(--_et-scrollable-button-space);
142
- }
143
-
144
- &:not(.et-scrollable--is-at-end) > .et-scrollable-wrapper > .et-scrollable-container {
145
- --_et-scrollable-end-clip: var(--_et-scrollable-button-space);
146
- }
147
-
148
- /* Clip only the content area. Padding changes can clamp the scroll offset at the end,
149
- and insetting the scrollport itself can move the items or trim the native scrollbar. */
150
- &:is([direction='horizontal'], :not([direction])) > .et-scrollable-wrapper > .et-scrollable-container {
151
- --_et-scrollable-left-clip: var(--_et-scrollable-start-clip);
152
- --_et-scrollable-right-clip: calc(100% - var(--_et-scrollable-end-clip));
153
-
154
- clip-path: polygon(
155
- var(--_et-scrollable-left-clip) 0,
156
- var(--_et-scrollable-right-clip) 0,
157
- var(--_et-scrollable-right-clip) var(--_et-scrollable-scrollbar-edge),
158
- 100% var(--_et-scrollable-scrollbar-edge),
159
- 100% 100%,
160
- 0 100%,
161
- 0 var(--_et-scrollable-scrollbar-edge),
162
- var(--_et-scrollable-left-clip) var(--_et-scrollable-scrollbar-edge)
163
- );
164
-
165
- &:dir(rtl) {
166
- --_et-scrollable-left-clip: var(--_et-scrollable-end-clip);
167
- --_et-scrollable-right-clip: calc(100% - var(--_et-scrollable-start-clip));
168
- }
169
- }
170
-
171
- &[direction='vertical'] > .et-scrollable-wrapper > .et-scrollable-container {
172
- --_et-scrollable-scrollbar-outer-edge: 100%;
173
-
174
- clip-path: polygon(
175
- var(--_et-scrollable-scrollbar-outer-edge) 0,
176
- var(--_et-scrollable-scrollbar-edge) 0,
177
- var(--_et-scrollable-scrollbar-edge) var(--_et-scrollable-start-clip),
178
- calc(100% - var(--_et-scrollable-scrollbar-outer-edge)) var(--_et-scrollable-start-clip),
179
- calc(100% - var(--_et-scrollable-scrollbar-outer-edge)) calc(100% - var(--_et-scrollable-end-clip)),
180
- var(--_et-scrollable-scrollbar-edge) calc(100% - var(--_et-scrollable-end-clip)),
181
- var(--_et-scrollable-scrollbar-edge) 100%,
182
- var(--_et-scrollable-scrollbar-outer-edge) 100%
183
- );
184
-
185
- &:dir(rtl) {
186
- --_et-scrollable-scrollbar-outer-edge: 0%;
187
- --_et-scrollable-scrollbar-edge: var(--_et-scrollable-scrollbar-size, 0px);
188
- }
189
- }
190
- }
191
-
192
124
  &.et-scrollable--sticky-buttons {
193
125
  --_sticky-margin: 10%;
194
126
 
@@ -281,6 +213,25 @@
281
213
  }
282
214
  }
283
215
 
216
+ & .et-scrollable-buttons.et-scrollable-buttons--corner {
217
+ display: flex;
218
+ gap: 0.8rem;
219
+ align-self: end;
220
+ justify-self: end;
221
+ padding-block-end: 1.6rem;
222
+ padding-inline-end: 1.6rem;
223
+
224
+ & .et-scrollable-button {
225
+ position: static;
226
+ transform: none;
227
+ }
228
+ }
229
+
230
+ &.et-scrollable--sticky-corner-buttons .et-scrollable-buttons--corner {
231
+ position: sticky;
232
+ inset-block-end: 0;
233
+ }
234
+
284
235
  /* Wins the equal-weight tie with the direction rules above only by coming after them - keep the
285
236
  footer overrides in this file, below them. */
286
237
  & .et-scrollable-footer {
@@ -265,8 +265,11 @@ export declare const TOURNAMENT_MODE: {
265
265
  readonly SINGLE_ELIMINATION: "single-elimination";
266
266
  readonly DOUBLE_ELIMINATION: "double-elimination";
267
267
  readonly SWISS_WITH_ELIMINATION: "swiss-with-elimination";
268
+ readonly SWISS: "swiss";
268
269
  };
269
270
  export type TournamentMode = (typeof TOURNAMENT_MODE)[keyof typeof TOURNAMENT_MODE];
271
+ /** Whether a stage is drawn as swiss record groups: `'swiss-with-elimination'` or `'swiss'`, which eliminates nobody. */
272
+ export declare const isSwissMode: (mode: TournamentMode) => mode is "swiss-with-elimination" | "swiss";
270
273
  /** Wins that advance a participant out of a swiss stage. */
271
274
  export declare const SWISS_ADVANCE_WINS = 3;
272
275
  /** Losses that eliminate a participant from a swiss stage. */
@@ -464,6 +467,8 @@ export type BracketRoundSwissGroup<TRoundData, TMatchData> = {
464
467
  name: string;
465
468
  matches: BracketMap<BracketMatchId, BracketMatch<TRoundData, TMatchData>>;
466
469
  allowedMatchCount: number;
470
+ /** The record tone of the group - see {@link getSwissGroupColorType}. */
471
+ colorType: BracketSwissGroupColorType;
467
472
  };
468
473
  export type BracketRoundSwissGroupMap<TRoundData, TMatchData> = Map<BracketRoundSwissGroupId, BracketRoundSwissGroup<TRoundData, TMatchData>>;
469
474
  export type BracketRoundSwissData<TRoundData, TMatchData> = {
@@ -490,8 +495,11 @@ export type BracketSwissGroupColorType = (typeof BRACKET_SWISS_GROUP_COLOR_TYPE)
490
495
  * which default to `--et-surface-border`).
491
496
  */
492
497
  export type BracketSwissColors = Partial<Record<BracketSwissGroupColorType, string>>;
493
- export declare const getSwissGroupColorType: (wins: number, losses: number) => BracketSwissGroupColorType;
494
- export declare const getAvailableSwissGroupsForRound: (roundNumber: number, totalMatchesInRound: number) => {
498
+ /** The record tone of a swiss group. A `'swiss'` stage eliminates nobody, so it has no negative tone. */
499
+ export declare const getSwissGroupColorType: (wins: number, losses: number, mode?: TournamentMode) => BracketSwissGroupColorType;
500
+ export declare const getAvailableSwissGroupsForRound: (roundNumber: number, totalMatchesInRound: number, mode?: TournamentMode) => {
501
+ wins: number;
502
+ losses: number;
495
503
  id: BracketRoundSwissGroupId;
496
504
  name: string;
497
505
  matchesInGroup: number;
@@ -1079,6 +1087,7 @@ export declare const gutterPath: (from: BracketPosition, to: BracketPosition, op
1079
1087
  export type BracketLayoutRegistration = {
1080
1088
  name: string;
1081
1089
  mode: TournamentMode;
1090
+ extraModes?: readonly TournamentMode[];
1082
1091
  };
1083
1092
  /** Returns the first registered layout matching the tournament mode. */
1084
1093
  export declare const resolveBracketLayout: <TLayout extends BracketLayoutRegistration>(layouts: readonly TLayout[] | undefined, mode: TournamentMode) => TLayout;
@@ -2205,6 +2205,8 @@ export type BracketLayout<TRoundData = any, TMatchData = any> = {
2205
2205
  * match in the registered array wins.
2206
2206
  */
2207
2207
  mode: TournamentMode$1;
2208
+ /** More tournament modes this layout draws - `swissBracketLayout()` draws `'swiss'` too. */
2209
+ extraModes?: readonly TournamentMode$1[];
2208
2210
  /** Positions the linked bracket's rounds and matches into a grid of columns. */
2209
2211
  createGrid: (bracket: Bracket$1<TRoundData, TMatchData>, options: CreateBracketGridConfig$1, components: BracketComponents$1<TRoundData, TMatchData>) => ComputedBracketGrid$1<TRoundData, TMatchData>;
2210
2212
  /**
@@ -3623,9 +3625,9 @@ export type SwissBracketLayoutOptions<TRoundData = any, TMatchData = any> = {
3623
3625
  roundHeaderComponent?: BracketRoundHeaderComponent$1<TRoundData, TMatchData>;
3624
3626
  };
3625
3627
  /**
3626
- * Draws a swiss stage (with elimination) as standings groups per round - winners climbing, losers
3627
- * sinking, group-to-group connection lines instead of match-to-match. What a `mode` of
3628
- * `'swiss-with-elimination'` renders once this is registered.
3628
+ * Draws a swiss stage as standings groups per round - winners climbing, losers sinking, group-to-group
3629
+ * connection lines instead of match-to-match. What a `mode` of `'swiss-with-elimination'` or `'swiss'`
3630
+ * renders once this is registered.
3629
3631
  *
3630
3632
  * @example
3631
3633
  * provideBracketConfig({ layouts: [swissBracketLayout()] });
@@ -5473,6 +5475,7 @@ declare const SCROLLABLE_BUTTON_POSITIONS: {
5473
5475
  readonly INSIDE: "inside";
5474
5476
  readonly INLINE: "inline";
5475
5477
  readonly FOOTER: "footer";
5478
+ readonly CORNER: "corner";
5476
5479
  };
5477
5480
  type ScrollableButtonPosition = (typeof SCROLLABLE_BUTTON_POSITIONS)[keyof typeof SCROLLABLE_BUTTON_POSITIONS];
5478
5481
  declare const SCROLLABLE_MASK_VARIANTS: {
@@ -5679,12 +5682,13 @@ type ScrollableButtonsConfig = {
5679
5682
  /**
5680
5683
  * `'inside'` floats the two buttons over the track's edges; `'inline'` puts them beside the track at
5681
5684
  * the row's ends; `'footer'` puts them in a row below it, next to the dots when `etScrollableNavigation`
5682
- * is on too. A value per breakpoint is allowed. Falls back to `provideScrollableConfig`. @default 'inside'
5685
+ * is on too; `'corner'` groups both buttons in the block-end/inline-end corner over the track. Set
5686
+ * `padding` and `gap` on `.et-scrollable-buttons` to move the group and space its buttons. A value per breakpoint is allowed. Falls back to `provideScrollableConfig`. @default 'inside'
5683
5687
  */
5684
5688
  position?: ScrollableResponsive<ScrollableButtonPosition>;
5685
5689
  /**
5686
5690
  * Keep the buttons in view while the page scrolls past a tall track, rather than letting them travel
5687
- * off with it. Only meaningful with `position: 'inside'`. @default false
5691
+ * off with it. Only meaningful with `position: 'inside'` or `'corner'`. @default false
5688
5692
  */
5689
5693
  sticky?: boolean;
5690
5694
  /** Size of the two icon buttons. @default 'xs' */
@@ -37594,5 +37598,5 @@ export declare const provideUnsavedChangesLabels: (labels: import("@ethlete/core
37594
37598
  export declare const injectUnsavedChangesLabels: () => import("@angular/core").Signal<UnsavedChangesLabels>;
37595
37599
  export declare const UNSAVED_CHANGES_LABELS: import("@angular/core").InjectionToken<import("@ethlete/core").LabelsSource<UnsavedChangesLabels>>;
37596
37600
  /** The version of `@ethlete/components` this build was cut from. */
37597
- export declare const COMPONENTS_VERSION = "1.0.0-next.108";
37601
+ export declare const COMPONENTS_VERSION = "1.0.0-next.110";
37598
37602
  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 };