courthive-components 6.12.1 → 6.13.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.
- package/dist/components/schedule-page/domain/matchUpCatalogProjections.d.ts +11 -1
- package/dist/components/schedule-page/engine/schedulePageStore.d.ts +3 -0
- package/dist/components/schedule-page/index.d.ts +1 -1
- package/dist/components/schedule-page/types.d.ts +8 -0
- package/dist/components/schedule-page/ui/matchUpCatalog.d.ts +2 -0
- package/dist/courthive-components.es.js +1205 -1186
- package/dist/courthive-components.umd.js +16 -16
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CatalogMatchUpItem, CatalogFilters, MatchUpCatalogGroupBy, ScheduledBehavior } from '../types';
|
|
1
|
+
import { CatalogMatchUpItem, CatalogFilters, MatchUpCatalogGroupBy, ScheduledBehavior, SchedulePageState } from '../types';
|
|
2
2
|
export declare function isCompletedStatus(status?: string): boolean;
|
|
3
3
|
export declare function filterMatchUpCatalog(catalog: CatalogMatchUpItem[], query: string, behavior?: ScheduledBehavior, filters?: CatalogFilters, showCompleted?: boolean): CatalogMatchUpItem[];
|
|
4
4
|
/**
|
|
@@ -13,3 +13,13 @@ export declare function filterMatchUpCatalog(catalog: CatalogMatchUpItem[], quer
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function computeBaseRoundByEvent(catalog: CatalogMatchUpItem[]): Map<string, number>;
|
|
15
15
|
export declare function groupMatchUpCatalog(items: CatalogMatchUpItem[], mode: MatchUpCatalogGroupBy): Map<string, CatalogMatchUpItem[]>;
|
|
16
|
+
/** The state a catalog view is derived from — every field `visibleCatalogGroups` reads. */
|
|
17
|
+
type CatalogViewState = Pick<SchedulePageState, 'matchUpCatalog' | 'catalogSearchQuery' | 'catalogFilters' | 'showCompleted' | 'showScheduled' | 'scheduledBehavior' | 'catalogGroupBy'>;
|
|
18
|
+
/**
|
|
19
|
+
* The groups the catalog shows for a state, in display order. One derivation for the panel that draws
|
|
20
|
+
* them and the store that collapses them, so "collapse all" collapses exactly what is on screen.
|
|
21
|
+
*/
|
|
22
|
+
export declare function visibleCatalogGroups(state: CatalogViewState): Map<string, CatalogMatchUpItem[]>;
|
|
23
|
+
/** True when the catalog shows at least one group and every group it shows is collapsed. */
|
|
24
|
+
export declare function allCatalogGroupsCollapsed(state: CatalogViewState & Pick<SchedulePageState, 'catalogCollapsedGroups'>): boolean;
|
|
25
|
+
export {};
|
|
@@ -36,6 +36,9 @@ export declare class SchedulePageStore {
|
|
|
36
36
|
selectMatchUp(matchUp: CatalogMatchUpItem | null): void;
|
|
37
37
|
setCatalogSearch(query: string): void;
|
|
38
38
|
setCatalogGroupBy(mode: MatchUpCatalogGroupBy): void;
|
|
39
|
+
toggleCatalogGroupCollapsed(groupKey: string): void;
|
|
40
|
+
/** Collapse every group the catalog currently shows, or expand them all. */
|
|
41
|
+
setAllCatalogGroupsCollapsed(collapsed: boolean): void;
|
|
39
42
|
setCatalogFilters(filters: CatalogFilters): void;
|
|
40
43
|
setShowCompleted(show: boolean): void;
|
|
41
44
|
setShowScheduled(show: boolean): void;
|
|
@@ -7,7 +7,7 @@ import { SchedulePageConfig } from './types';
|
|
|
7
7
|
*/
|
|
8
8
|
export { SchedulePageControl } from './controller/schedulePageControl';
|
|
9
9
|
export { SchedulePageStore } from './engine/schedulePageStore';
|
|
10
|
-
export { filterMatchUpCatalog, groupMatchUpCatalog, computeBaseRoundByEvent, isCompletedStatus } from './domain/matchUpCatalogProjections';
|
|
10
|
+
export { filterMatchUpCatalog, groupMatchUpCatalog, visibleCatalogGroups, allCatalogGroupsCollapsed, computeBaseRoundByEvent, isCompletedStatus } from './domain/matchUpCatalogProjections';
|
|
11
11
|
export { buildScheduleIssueIndex } from './domain/scheduleIssues';
|
|
12
12
|
export { matchUpLabel, participantLabel, matchUpSearchKey, memberNamesLabel, deepClone } from './domain/utils';
|
|
13
13
|
export { computeActiveStrip, computeActiveStripCell, computeActiveStripDropTarget, computeReschedulePlacements } from './domain/activeStrip';
|
|
@@ -119,6 +119,8 @@ export interface SchedulePageCatalogState {
|
|
|
119
119
|
catalogFilters?: CatalogFilters;
|
|
120
120
|
showCompleted?: boolean;
|
|
121
121
|
showScheduled?: boolean;
|
|
122
|
+
/** Keys of the catalog groups that are collapsed, under `catalogGroupBy`. */
|
|
123
|
+
catalogCollapsedGroups?: string[];
|
|
122
124
|
}
|
|
123
125
|
export type CatalogPlacement = 'left' | 'right' | 'bottom';
|
|
124
126
|
export type InspectorPlacement = 'docked' | 'floating';
|
|
@@ -203,6 +205,12 @@ export interface SchedulePageState {
|
|
|
203
205
|
catalogFilters: CatalogFilters;
|
|
204
206
|
showCompleted: boolean;
|
|
205
207
|
showScheduled: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Keys of the collapsed catalog groups. Store state rather than the panel's own, so a host that
|
|
210
|
+
* snapshots `SchedulePageCatalogState` keeps the operator's collapsed groups across a remount.
|
|
211
|
+
* Optional so a state built by hand (a story, a test) need not name it; absent means none.
|
|
212
|
+
*/
|
|
213
|
+
catalogCollapsedGroups?: string[];
|
|
206
214
|
scheduledBehavior: ScheduledBehavior;
|
|
207
215
|
schedulingMode: SchedulingMode;
|
|
208
216
|
pendingActions: PendingScheduleAction[];
|
|
@@ -11,5 +11,7 @@ export interface MatchUpCatalogCallbacks {
|
|
|
11
11
|
renderCardExtra?: (matchUp: CatalogMatchUpItem) => HTMLElement | null;
|
|
12
12
|
/** Forwarded to every card as `MatchUpCardOptions.relatedMatchUpIds`. See that contract. */
|
|
13
13
|
relatedMatchUpIds?: (matchUp: CatalogMatchUpItem) => string[];
|
|
14
|
+
/** A group header was clicked. The collapsed set is store state (`catalogCollapsedGroups`). */
|
|
15
|
+
onToggleGroupCollapsed?: (groupKey: string) => void;
|
|
14
16
|
}
|
|
15
17
|
export declare function buildMatchUpCatalog(callbacks: MatchUpCatalogCallbacks): UIPanel<SchedulePageState>;
|