courthive-components 1.0.4 → 1.1.1
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/assets/team-logos/index.d.ts +9 -0
- package/dist/components/burstChart/burstChart.d.ts +108 -0
- package/dist/components/burstChart/matchUpTransform.d.ts +11 -0
- package/dist/components/burstChart/textHelpers.d.ts +11 -0
- package/dist/components/button/barButton.d.ts +1 -0
- package/dist/components/button/cvaButton.d.ts +8 -0
- package/dist/components/button/dropDownButton.d.ts +5 -0
- package/dist/components/categories/ageCategory/ageCategory.d.ts +54 -0
- package/dist/components/categories/ageCategory/ageCategoryLogic.d.ts +55 -0
- package/dist/components/categories/category/category.d.ts +47 -0
- package/dist/components/composition-editor/compositionEditor.d.ts +6 -0
- package/dist/components/composition-editor/compositionEditorStore.d.ts +24 -0
- package/dist/components/composition-editor/compositionEditorTypes.d.ts +37 -0
- package/dist/components/composition-editor/compositionPreview.d.ts +2 -0
- package/dist/components/composition-editor/scaleConstants.d.ts +7 -0
- package/dist/components/composition-editor/sections/displaySection.d.ts +3 -0
- package/dist/components/composition-editor/sections/fieldBuilders.d.ts +20 -0
- package/dist/components/composition-editor/sections/layoutSection.d.ts +3 -0
- package/dist/components/composition-editor/sections/participantSection.d.ts +3 -0
- package/dist/components/composition-editor/sections/placeholderSection.d.ts +3 -0
- package/dist/components/composition-editor/sections/scaleSection.d.ts +3 -0
- package/dist/components/composition-editor/sections/scoreSection.d.ts +3 -0
- package/dist/components/composition-editor/sections/sectionBuilder.d.ts +8 -0
- package/dist/components/composition-editor/sections/themeSection.d.ts +3 -0
- package/dist/components/composition-editor/styles.d.ts +26 -0
- package/dist/components/controlBar/controlBar.d.ts +11 -0
- package/dist/components/controlBar/toggleOverlay.d.ts +3 -0
- package/dist/components/courts/courts.d.ts +7 -0
- package/dist/components/courts/index.d.ts +1 -0
- package/dist/components/drawer/drawer.d.ts +14 -0
- package/dist/components/flightProfile/flightProfileLogic.d.ts +51 -0
- package/dist/components/flightProfile/flightProfileNew.d.ts +34 -0
- package/dist/components/flightProfile/getFlightProfileFormItems.d.ts +13 -0
- package/dist/components/flightProfile/getFlightProfileFormRelationships.d.ts +1 -0
- package/dist/components/forms/createMultiSelect.d.ts +34 -0
- package/dist/components/forms/renderButtons.d.ts +3 -0
- package/dist/components/forms/renderField.d.ts +7 -0
- package/dist/components/forms/renderForm.d.ts +1 -0
- package/dist/components/forms/renderMenu.d.ts +3 -0
- package/dist/components/forms/renderValidator.d.ts +113 -0
- package/dist/components/forms/styles.d.ts +0 -0
- package/dist/components/generateRound.d.ts +6 -0
- package/dist/components/inline-scoring/engineToMatchUp.d.ts +6 -0
- package/dist/components/inline-scoring/index.d.ts +5 -0
- package/dist/components/inline-scoring/inlineScoringFooter.d.ts +18 -0
- package/dist/components/inline-scoring/inlineScoringManager.d.ts +49 -0
- package/dist/components/inline-scoring/inlineScoringTypes.d.ts +40 -0
- package/dist/components/inline-scoring/renderInlineMatchUp.d.ts +27 -0
- package/dist/components/interactive-scoring/buildInteractiveScoringShell.d.ts +28 -0
- package/dist/components/interactive-scoring/index.d.ts +2 -0
- package/dist/components/interactive-scoring/types.d.ts +60 -0
- package/dist/components/matchUpFormat/matchUpFormat.d.ts +81 -0
- package/dist/components/matchUpFormat/matchUpFormatLogic.d.ts +112 -0
- package/dist/components/modal/cmodal.d.ts +30 -0
- package/dist/components/modal/cmodalStyles.d.ts +8 -0
- package/dist/components/modal/compositionEditorModal.d.ts +46 -0
- package/dist/components/modal/generateTeamsModal.d.ts +26 -0
- package/dist/components/modal/mockParticipants.d.ts +91 -0
- package/dist/components/modal/scheduleCellConfigModal.d.ts +44 -0
- package/dist/components/modal/selectItem.d.ts +24 -0
- package/dist/components/notes-toolbar/notesToolbar.d.ts +20 -0
- package/dist/components/policy-catalog/controller/policyCatalogControl.d.ts +18 -0
- package/dist/components/policy-catalog/domain/catalogProjections.d.ts +11 -0
- package/dist/components/policy-catalog/domain/policyDefaults.d.ts +26 -0
- package/dist/components/policy-catalog/domain/utils.d.ts +4 -0
- package/dist/components/policy-catalog/editors/ranking/domain/emptyRankingPolicy.d.ts +2 -0
- package/dist/components/policy-catalog/editors/ranking/domain/rankingProjections.d.ts +32 -0
- package/dist/components/policy-catalog/editors/ranking/index.d.ts +9 -0
- package/dist/components/policy-catalog/editors/ranking/rankingPointsEditorControl.d.ts +27 -0
- package/dist/components/policy-catalog/editors/ranking/rankingPointsEditorPanel.d.ts +8 -0
- package/dist/components/policy-catalog/editors/ranking/rankingPointsEditorStore.d.ts +53 -0
- package/dist/components/policy-catalog/editors/ranking/sections/aggregationSection.d.ts +6 -0
- package/dist/components/policy-catalog/editors/ranking/sections/bonusPointsRow.d.ts +6 -0
- package/dist/components/policy-catalog/editors/ranking/sections/metadataSection.d.ts +6 -0
- package/dist/components/policy-catalog/editors/ranking/sections/perWinPointsRow.d.ts +6 -0
- package/dist/components/policy-catalog/editors/ranking/sections/positionPointsTable.d.ts +6 -0
- package/dist/components/policy-catalog/editors/ranking/sections/profileCard.d.ts +6 -0
- package/dist/components/policy-catalog/editors/ranking/sections/qualityWinSection.d.ts +6 -0
- package/dist/components/policy-catalog/editors/ranking/sections/scopeBadges.d.ts +2 -0
- package/dist/components/policy-catalog/editors/ranking/sections/scopeEditor.d.ts +6 -0
- package/dist/components/policy-catalog/editors/ranking/styles.d.ts +25 -0
- package/dist/components/policy-catalog/editors/ranking/types.d.ts +146 -0
- package/dist/components/policy-catalog/editors/scheduling/domain/schedulingProjections.d.ts +5 -0
- package/dist/components/policy-catalog/editors/scheduling/domain/schedulingValidation.d.ts +2 -0
- package/dist/components/policy-catalog/editors/scheduling/index.d.ts +11 -0
- package/dist/components/policy-catalog/editors/scheduling/schedulingEditorControl.d.ts +26 -0
- package/dist/components/policy-catalog/editors/scheduling/schedulingEditorPanel.d.ts +6 -0
- package/dist/components/policy-catalog/editors/scheduling/schedulingEditorStore.d.ts +32 -0
- package/dist/components/policy-catalog/editors/scheduling/sections/averageTimesSection.d.ts +6 -0
- package/dist/components/policy-catalog/editors/scheduling/sections/dailyLimitsSection.d.ts +6 -0
- package/dist/components/policy-catalog/editors/scheduling/sections/defaultTimesSection.d.ts +6 -0
- package/dist/components/policy-catalog/editors/scheduling/sections/formatTimeRow.d.ts +22 -0
- package/dist/components/policy-catalog/editors/scheduling/sections/modificationFlagsSection.d.ts +6 -0
- package/dist/components/policy-catalog/editors/scheduling/sections/recoveryTimesSection.d.ts +6 -0
- package/dist/components/policy-catalog/editors/scheduling/styles.d.ts +27 -0
- package/dist/components/policy-catalog/editors/scheduling/types.d.ts +65 -0
- package/dist/components/policy-catalog/engine/policyCatalogStore.d.ts +25 -0
- package/dist/components/policy-catalog/index.d.ts +22 -0
- package/dist/components/policy-catalog/types.d.ts +57 -0
- package/dist/components/policy-catalog/ui/editorShell.d.ts +11 -0
- package/dist/components/policy-catalog/ui/jsonEditor.d.ts +5 -0
- package/dist/components/policy-catalog/ui/policyCatalogLayout.d.ts +6 -0
- package/dist/components/policy-catalog/ui/policyCatalogPanel.d.ts +10 -0
- package/dist/components/policy-catalog/ui/styles.d.ts +28 -0
- package/dist/components/popover/tipster.d.ts +14 -0
- package/dist/components/print-composition-editor/printCompositionEditor.d.ts +2 -0
- package/dist/components/print-composition-editor/printCompositionEditorTypes.d.ts +77 -0
- package/dist/components/renderSchematicStructure/index.d.ts +4 -0
- package/dist/components/renderSchematicStructure/renderSchematicMatchUp.d.ts +26 -0
- package/dist/components/renderSchematicStructure/renderSchematicRound.d.ts +15 -0
- package/dist/components/renderSchematicStructure/renderSchematicStructure.d.ts +12 -0
- package/dist/components/renderStructure/isLuckyDraw.d.ts +9 -0
- package/dist/components/renderStructure/renderAddress.d.ts +5 -0
- package/dist/components/renderStructure/renderCenterInfo.d.ts +10 -0
- package/dist/components/renderStructure/renderContainer.d.ts +4 -0
- package/dist/components/renderStructure/renderFlag.d.ts +6 -0
- package/dist/components/renderStructure/renderFrill.d.ts +10 -0
- package/dist/components/renderStructure/renderGameScore.d.ts +3 -0
- package/dist/components/renderStructure/renderIndividual.d.ts +12 -0
- package/dist/components/renderStructure/renderMatchUp.d.ts +14 -0
- package/dist/components/renderStructure/renderParticipant.d.ts +11 -0
- package/dist/components/renderStructure/renderParticipantDetail.d.ts +7 -0
- package/dist/components/renderStructure/renderParticipantInput.d.ts +10 -0
- package/dist/components/renderStructure/renderPersonAttribute.d.ts +6 -0
- package/dist/components/renderStructure/renderRound.d.ts +17 -0
- package/dist/components/renderStructure/renderRoundHeader.d.ts +8 -0
- package/dist/components/renderStructure/renderScale.d.ts +8 -0
- package/dist/components/renderStructure/renderSchedule.d.ts +5 -0
- package/dist/components/renderStructure/renderSeeding.d.ts +6 -0
- package/dist/components/renderStructure/renderSide.d.ts +9 -0
- package/dist/components/renderStructure/renderSideScore.d.ts +16 -0
- package/dist/components/renderStructure/renderStatusPill.d.ts +3 -0
- package/dist/components/renderStructure/renderStructure.d.ts +13 -0
- package/dist/components/renderStructure/renderTeam.d.ts +5 -0
- package/dist/components/renderStructure/renderTeamLogo.d.ts +4 -0
- package/dist/components/renderStructure/renderTick.d.ts +3 -0
- package/dist/components/schedule-page/controller/schedulePageControl.d.ts +18 -0
- package/dist/components/schedule-page/domain/matchUpCatalogProjections.d.ts +4 -0
- package/dist/components/schedule-page/domain/scheduleIssues.d.ts +2 -0
- package/dist/components/schedule-page/domain/utils.d.ts +5 -0
- package/dist/components/schedule-page/engine/schedulePageStore.d.ts +34 -0
- package/dist/components/schedule-page/index.d.ts +24 -0
- package/dist/components/schedule-page/types.d.ts +218 -0
- package/dist/components/schedule-page/ui/courtGridSlot.d.ts +8 -0
- package/dist/components/schedule-page/ui/dateStrip.d.ts +5 -0
- package/dist/components/schedule-page/ui/inspectorPanel.d.ts +2 -0
- package/dist/components/schedule-page/ui/issuesPanel.d.ts +2 -0
- package/dist/components/schedule-page/ui/matchUpCard.d.ts +5 -0
- package/dist/components/schedule-page/ui/matchUpCatalog.d.ts +11 -0
- package/dist/components/schedule-page/ui/scheduleCellTypeAhead.d.ts +23 -0
- package/dist/components/schedule-page/ui/scheduleGridCell.d.ts +8 -0
- package/dist/components/schedule-page/ui/schedulePageLayout.d.ts +18 -0
- package/dist/components/schedule-page/ui/styles.d.ts +41 -0
- package/dist/components/scheduling-profile/controller/schedulingProfileControl.d.ts +14 -0
- package/dist/components/scheduling-profile/domain/catalogProjections.d.ts +16 -0
- package/dist/components/scheduling-profile/domain/dndApply.d.ts +2 -0
- package/dist/components/scheduling-profile/domain/issueIndex.d.ts +2 -0
- package/dist/components/scheduling-profile/domain/profileProjections.d.ts +6 -0
- package/dist/components/scheduling-profile/domain/utils.d.ts +7 -0
- package/dist/components/scheduling-profile/domain/validateProfile.d.ts +13 -0
- package/dist/components/scheduling-profile/engine/profileStore.d.ts +27 -0
- package/dist/components/scheduling-profile/index.d.ts +25 -0
- package/dist/components/scheduling-profile/types.d.ts +197 -0
- package/dist/components/scheduling-profile/ui/cardPopover.d.ts +11 -0
- package/dist/components/scheduling-profile/ui/dateStrip.d.ts +5 -0
- package/dist/components/scheduling-profile/ui/inspectorPanel.d.ts +2 -0
- package/dist/components/scheduling-profile/ui/issuesPanel.d.ts +5 -0
- package/dist/components/scheduling-profile/ui/roundCard.d.ts +12 -0
- package/dist/components/scheduling-profile/ui/roundCatalog.d.ts +8 -0
- package/dist/components/scheduling-profile/ui/schedulingProfileLayout.d.ts +15 -0
- package/dist/components/scheduling-profile/ui/styles.d.ts +46 -0
- package/dist/components/scheduling-profile/ui/venueBoard.d.ts +7 -0
- package/dist/components/scorecard/index.d.ts +2 -0
- package/dist/components/scorecard/renderScorecard.d.ts +26 -0
- package/dist/components/scoring/approaches/dialPadApproach.d.ts +2 -0
- package/dist/components/scoring/approaches/dialPadLogic.d.ts +12 -0
- package/dist/components/scoring/approaches/dynamicSetsApproach.d.ts +2 -0
- package/dist/components/scoring/approaches/freeScoreApproach.d.ts +2 -0
- package/dist/components/scoring/approaches/inlineScoringApproach.d.ts +2 -0
- package/dist/components/scoring/config.d.ts +28 -0
- package/dist/components/scoring/index.d.ts +6 -0
- package/dist/components/scoring/logic/dynamicSetsLogic.d.ts +124 -0
- package/dist/components/scoring/scoringModal.d.ts +2 -0
- package/dist/components/scoring/types.d.ts +60 -0
- package/dist/components/scoring/utils/scoreFormatters.d.ts +12 -0
- package/dist/components/scoring/utils/scoreValidator.d.ts +16 -0
- package/dist/components/scoring/utils/setExpansionLogic.d.ts +24 -0
- package/dist/components/temporal-grid/controller/temporalGridControl.d.ts +137 -0
- package/dist/components/temporal-grid/controller/viewProjections.d.ts +220 -0
- package/dist/components/temporal-grid/engine/viewState.d.ts +34 -0
- package/dist/components/temporal-grid/index.d.ts +18 -0
- package/dist/components/temporal-grid/timeline/CourtTimeline.d.ts +77 -0
- package/dist/components/temporal-grid/timeline/InteractionManager.d.ts +59 -0
- package/dist/components/temporal-grid/timeline/ItemRenderer.d.ts +35 -0
- package/dist/components/temporal-grid/timeline/RowLayout.d.ts +38 -0
- package/dist/components/temporal-grid/timeline/TimeAxis.d.ts +41 -0
- package/dist/components/temporal-grid/timeline/TimeScale.d.ts +106 -0
- package/dist/components/temporal-grid/timeline/types.d.ts +124 -0
- package/dist/components/temporal-grid/ui/blockPopover.d.ts +29 -0
- package/dist/components/temporal-grid/ui/courtAvailabilityModal.d.ts +29 -0
- package/dist/components/temporal-grid/ui/modernTimePicker.d.ts +46 -0
- package/dist/components/temporal-grid/ui/statsBar.d.ts +21 -0
- package/dist/components/temporal-grid/ui/temporalGrid.d.ts +149 -0
- package/dist/components/temporal-grid/ui/viewToolbar.d.ts +37 -0
- package/dist/components/topology-builder/controller/topologyBuilderControl.d.ts +19 -0
- package/dist/components/topology-builder/domain/feedRounds.d.ts +42 -0
- package/dist/components/topology-builder/domain/generateDrawFromTopology.d.ts +16 -0
- package/dist/components/topology-builder/domain/playoffProfilesCache.d.ts +16 -0
- package/dist/components/topology-builder/domain/previewGenerator.d.ts +9 -0
- package/dist/components/topology-builder/domain/templates.d.ts +2 -0
- package/dist/components/topology-builder/domain/topologyToDrawOptions.d.ts +6 -0
- package/dist/components/topology-builder/domain/topologyValidator.d.ts +8 -0
- package/dist/components/topology-builder/engine/topologyStore.d.ts +30 -0
- package/dist/components/topology-builder/index.d.ts +23 -0
- package/dist/components/topology-builder/types.d.ts +59 -0
- package/dist/components/topology-builder/ui/edgeEditor.d.ts +7 -0
- package/dist/components/topology-builder/ui/nodeEditor.d.ts +9 -0
- package/dist/components/topology-builder/ui/structureCard.d.ts +39 -0
- package/dist/components/topology-builder/ui/toolbar.d.ts +15 -0
- package/dist/components/topology-builder/ui/topologyBuilderLayout.d.ts +7 -0
- package/dist/components/topology-builder/ui/topologyCanvas.d.ts +10 -0
- package/dist/components/validators/numericRange.d.ts +1 -0
- package/dist/components/validators/numericValidator.d.ts +1 -0
- package/dist/compositions/compositions.d.ts +2 -0
- package/dist/compositions/lineHeights.d.ts +5 -0
- package/dist/compositions/resolvePublishedComposition.d.ts +12 -0
- package/dist/constants/matchUpFormats.d.ts +34 -0
- package/dist/courthive-components.css +1 -1
- package/dist/courthive-components.es.js +4823 -4605
- package/dist/courthive-components.umd.js +42 -42
- package/dist/data/componentConstants.d.ts +1 -0
- package/dist/data/generateEventData.d.ts +15 -0
- package/dist/data/generateMatchUps.d.ts +25 -0
- package/dist/helpers/createTypeAhead.d.ts +14 -0
- package/dist/helpers/drawStateManager.d.ts +91 -0
- package/dist/helpers/getAttr.d.ts +4 -0
- package/dist/helpers/typeOf.d.ts +4 -0
- package/dist/index.d.ts +80 -3913
- package/dist/styles/centerInfoStyle.d.ts +6 -0
- package/dist/styles/containerStyle.d.ts +1 -0
- package/dist/styles/flagStyle.d.ts +3 -0
- package/dist/styles/getChevronStyle.d.ts +4 -0
- package/dist/styles/getLinkStyle.d.ts +25 -0
- package/dist/styles/getMatchUpStyle.d.ts +4 -0
- package/dist/styles/getSelectedMatchUpStyle.d.ts +1 -0
- package/dist/styles/groupNameStyle.d.ts +1 -0
- package/dist/styles/groupSeparatorStyle.d.ts +4 -0
- package/dist/styles/matchUpContainerStyle.d.ts +1 -0
- package/dist/styles/participantDetailStyle.d.ts +1 -0
- package/dist/styles/participantStyle.d.ts +17 -0
- package/dist/styles/pillStyle.d.ts +3 -0
- package/dist/styles/resultStyles.d.ts +4 -0
- package/dist/styles/roundContainerStyle.d.ts +1 -0
- package/dist/styles/roundHeaderStyle.d.ts +1 -0
- package/dist/styles/roundStyle.d.ts +3 -0
- package/dist/styles/scaleStyle.d.ts +3 -0
- package/dist/styles/schedulingStyle.d.ts +1 -0
- package/dist/styles/scoreStyles.d.ts +9 -0
- package/dist/styles/scoreWrapperStyle.d.ts +4 -0
- package/dist/styles/seedStyle.d.ts +1 -0
- package/dist/styles/sideStyles.d.ts +3 -0
- package/dist/styles/structureStyle.d.ts +1 -0
- package/dist/styles/teamLogoStyle.d.ts +1 -0
- package/dist/styles/themes/australianTheme.d.ts +1 -0
- package/dist/styles/themes/basicCardTheme.d.ts +1 -0
- package/dist/styles/themes/basicTheme.d.ts +1 -0
- package/dist/styles/themes/createTheme.d.ts +5 -0
- package/dist/styles/themes/frenchTheme.d.ts +1 -0
- package/dist/styles/themes/index.d.ts +7 -0
- package/dist/styles/themes/itfTheme.d.ts +1 -0
- package/dist/styles/themes/usOpenTheme.d.ts +1 -0
- package/dist/styles/themes/wimbledonTheme.d.ts +1 -0
- package/dist/tools/freeScore/freeScore.d.ts +79 -0
- package/dist/types.d.ts +321 -0
- package/dist/utilities/isElement.d.ts +1 -0
- package/dist/validators/dateValidator.d.ts +1 -0
- package/dist/validators/emailValidator.d.ts +1 -0
- package/dist/validators/index.d.ts +7 -0
- package/dist/validators/nameValidator.d.ts +1 -0
- package/dist/validators/numericRange.d.ts +1 -0
- package/dist/validators/numericValidator.d.ts +1 -0
- package/dist/validators/passwordValidator.d.ts +1 -0
- package/dist/validators/wordValidator.d.ts +1 -0
- package/dist/version.d.ts +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom multi-select dropdown with tag chips and checkbox panel.
|
|
3
|
+
*
|
|
4
|
+
* Visual structure:
|
|
5
|
+
* ┌──────────────────────────────────────┐
|
|
6
|
+
* │ WTN × UTR × ▼ │ ← trigger: tags + chevron
|
|
7
|
+
* ├──────────────────────────────────────┤
|
|
8
|
+
* │ ✓ WTN │ ← dropdown (checkboxes)
|
|
9
|
+
* │ ✓ UTR │
|
|
10
|
+
* │ DUPR │
|
|
11
|
+
* └──────────────────────────────────────┘
|
|
12
|
+
*
|
|
13
|
+
* All colors use --chc-* CSS variables for automatic dark-mode support.
|
|
14
|
+
*/
|
|
15
|
+
interface MultiSelectOption {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
selected?: boolean;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface MultiSelectItem {
|
|
22
|
+
options: MultiSelectOption[];
|
|
23
|
+
onChange?: (e: Event, item: any) => void;
|
|
24
|
+
id?: string;
|
|
25
|
+
}
|
|
26
|
+
type MultiSelectElement = HTMLDivElement & {
|
|
27
|
+
selectedValues: string[];
|
|
28
|
+
value: string;
|
|
29
|
+
};
|
|
30
|
+
export declare function createMultiSelect(item: MultiSelectItem): {
|
|
31
|
+
container: HTMLDivElement;
|
|
32
|
+
element: MultiSelectElement;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderForm(elem: HTMLElement, items: any[], relationships?: any[]): any;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate input field and update UI with success/error styling.
|
|
3
|
+
*
|
|
4
|
+
* OVERVIEW:
|
|
5
|
+
* Runs a validation function on input value and updates the input field and help text
|
|
6
|
+
* with appropriate styling (success=green, error=red) and error messages. Used by
|
|
7
|
+
* renderField to provide real-time validation feedback.
|
|
8
|
+
*
|
|
9
|
+
* PARAMETERS:
|
|
10
|
+
* @param item - Field configuration object containing error message
|
|
11
|
+
* @param e - Event object with target.value containing input value
|
|
12
|
+
* @param input - Input element to add success/error classes to
|
|
13
|
+
* @param help - Help text element to display error message
|
|
14
|
+
* @param fx - Validation function that returns true if valid, false if invalid
|
|
15
|
+
*
|
|
16
|
+
* ============================================================================
|
|
17
|
+
* BEHAVIOR
|
|
18
|
+
* ============================================================================
|
|
19
|
+
*
|
|
20
|
+
* VALIDATION FLOW:
|
|
21
|
+
* 1. Extract value from e.target.value
|
|
22
|
+
* 2. Call validation function fx(value)
|
|
23
|
+
* 3. If invalid (fx returns false):
|
|
24
|
+
* - Set help text to item.error or 'Invalid'
|
|
25
|
+
* - Remove 'is-success' class from input
|
|
26
|
+
* - Add 'is-danger' class to input (red border)
|
|
27
|
+
* - Add 'is-danger' class to help (red text)
|
|
28
|
+
* 4. If valid (fx returns true):
|
|
29
|
+
* - Clear help text
|
|
30
|
+
* - Remove 'is-danger' classes
|
|
31
|
+
* - Add 'is-success' class to input (green border)
|
|
32
|
+
*
|
|
33
|
+
* VISUAL FEEDBACK:
|
|
34
|
+
* - Invalid: Red border on input + red error message below
|
|
35
|
+
* - Valid: Green border on input + no message
|
|
36
|
+
* - Neutral: No border color + no message (before first input)
|
|
37
|
+
*
|
|
38
|
+
* ============================================================================
|
|
39
|
+
* VALIDATION FUNCTIONS
|
|
40
|
+
* ============================================================================
|
|
41
|
+
*
|
|
42
|
+
* Validation functions should:
|
|
43
|
+
* - Accept a string value parameter
|
|
44
|
+
* - Return true if valid, false if invalid
|
|
45
|
+
* - Be synchronous (no async validation)
|
|
46
|
+
*
|
|
47
|
+
* COMMON VALIDATORS:
|
|
48
|
+
* - nameValidator(minLength) - checks minimum character length
|
|
49
|
+
* - emailValidator() - validates email format
|
|
50
|
+
* - passwordValidator() - checks password requirements
|
|
51
|
+
* - numericRange(min, max) - validates number is in range
|
|
52
|
+
* - Custom: (value) => value.length > 0 && value.includes('@')
|
|
53
|
+
*
|
|
54
|
+
* ============================================================================
|
|
55
|
+
* USAGE NOTES
|
|
56
|
+
* ============================================================================
|
|
57
|
+
*
|
|
58
|
+
* TYPICAL USAGE:
|
|
59
|
+
* - Called automatically by renderField when validator property is set
|
|
60
|
+
* - Attached to 'input' event for real-time validation
|
|
61
|
+
* - Rarely called directly - use via renderField configuration
|
|
62
|
+
*
|
|
63
|
+
* ERROR MESSAGES:
|
|
64
|
+
* - Set via item.error property in field configuration
|
|
65
|
+
* - Default message is 'Invalid' if item.error not provided
|
|
66
|
+
* - Should be clear and actionable (e.g., "Minimum 5 characters")
|
|
67
|
+
*
|
|
68
|
+
* STYLING:
|
|
69
|
+
* - Uses CSS classes: is-success, is-danger
|
|
70
|
+
* - Input field gets colored border
|
|
71
|
+
* - Help text appears below input with matching color
|
|
72
|
+
*
|
|
73
|
+
* ============================================================================
|
|
74
|
+
* EXAMPLE USAGE
|
|
75
|
+
* ============================================================================
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* // Automatic usage via renderField
|
|
79
|
+
* const field = renderField({
|
|
80
|
+
* label: 'Username',
|
|
81
|
+
* field: 'username',
|
|
82
|
+
* validator: (value) => value.length >= 5,
|
|
83
|
+
* error: 'Username must be at least 5 characters'
|
|
84
|
+
* });
|
|
85
|
+
* // validator() is called automatically on input event
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* // Direct usage (rare)
|
|
89
|
+
* const input = document.getElementById('email');
|
|
90
|
+
* const help = document.getElementById('email-help');
|
|
91
|
+
* const item = { error: 'Invalid email format' };
|
|
92
|
+
* const emailValidator = (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
|
|
93
|
+
*
|
|
94
|
+
* input.addEventListener('input', (e) => {
|
|
95
|
+
* validator(item, e, input, help, emailValidator);
|
|
96
|
+
* });
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* // Custom validator with multiple conditions
|
|
100
|
+
* const passwordValidator = (value) => {
|
|
101
|
+
* return value.length >= 8 &&
|
|
102
|
+
* /[A-Z]/.test(value) &&
|
|
103
|
+
* /[0-9]/.test(value);
|
|
104
|
+
* };
|
|
105
|
+
* const field = renderField({
|
|
106
|
+
* label: 'Password',
|
|
107
|
+
* field: 'password',
|
|
108
|
+
* type: 'password',
|
|
109
|
+
* validator: passwordValidator,
|
|
110
|
+
* error: 'Password must be 8+ chars with uppercase and number'
|
|
111
|
+
* });
|
|
112
|
+
*/
|
|
113
|
+
export declare function validator(item: any, e: any, input: HTMLElement, help: HTMLElement, fx?: (value: string) => boolean): void;
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MatchUp } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Bridge: converts ScoringEngine state into a TODS-compatible MatchUp object
|
|
4
|
+
* suitable for renderMatchUp(). Injects live point display into the active set.
|
|
5
|
+
*/
|
|
6
|
+
export declare function engineToMatchUp(engine: any, baseMatchUp: MatchUp): MatchUp;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { InlineScoringManager } from './inlineScoringManager';
|
|
2
|
+
export { renderInlineMatchUp } from './renderInlineMatchUp';
|
|
3
|
+
export { engineToMatchUp } from './engineToMatchUp';
|
|
4
|
+
export { createInlineScoringFooter } from './inlineScoringFooter';
|
|
5
|
+
export type { InlineScoringMode, InlineScoringConfig, InlineScoringCallbacks, InlineScoringEngineState } from './inlineScoringTypes';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InlineScoringManager } from './inlineScoringManager';
|
|
2
|
+
import { MatchUp } from '../../types';
|
|
3
|
+
interface FooterParams {
|
|
4
|
+
matchUpId: string;
|
|
5
|
+
manager: InlineScoringManager;
|
|
6
|
+
baseMatchUp: MatchUp;
|
|
7
|
+
onUpdate: (matchUp: MatchUp) => void;
|
|
8
|
+
showSituation?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates an interactive footer bar for inline scoring:
|
|
12
|
+
* [Undo] [Redo] [Clear] [Submit] | situation flags
|
|
13
|
+
*/
|
|
14
|
+
export declare function createInlineScoringFooter(params: FooterParams): {
|
|
15
|
+
element: HTMLElement;
|
|
16
|
+
update: () => void;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MatchUp } from '../../types';
|
|
2
|
+
import { InlineScoringCallbacks, InlineScoringEngineState } from './inlineScoringTypes';
|
|
3
|
+
/**
|
|
4
|
+
* Manages ScoringEngine instances for inline scoring in draw brackets.
|
|
5
|
+
* One engine per matchUpId; lazily created on first interaction.
|
|
6
|
+
*/
|
|
7
|
+
export declare class InlineScoringManager {
|
|
8
|
+
private engines;
|
|
9
|
+
readonly callbacks: InlineScoringCallbacks;
|
|
10
|
+
constructor(callbacks?: InlineScoringCallbacks);
|
|
11
|
+
/**
|
|
12
|
+
* Get or create a ScoringEngine for a matchUp.
|
|
13
|
+
* If the matchUp has existing score data, initializes the engine with it.
|
|
14
|
+
*/
|
|
15
|
+
getOrCreate(matchUpId: string, matchUpFormat: string, existingMatchUp?: MatchUp): InlineScoringEngineState;
|
|
16
|
+
get(matchUpId: string): InlineScoringEngineState | undefined;
|
|
17
|
+
has(matchUpId: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Add a point for a side. Used in 'points' mode.
|
|
20
|
+
* @param winner - 0 for side 1, 1 for side 2
|
|
21
|
+
*/
|
|
22
|
+
addPoint(matchUpId: string, winner: 0 | 1, baseMatchUp: MatchUp): MatchUp | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Add a game for a side. Used in 'games' mode.
|
|
25
|
+
* @param winner - 0 for side 1, 1 for side 2
|
|
26
|
+
*/
|
|
27
|
+
addGame(matchUpId: string, winner: 0 | 1, baseMatchUp: MatchUp): MatchUp | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Add a set score. Used in 'entry' mode.
|
|
30
|
+
*/
|
|
31
|
+
addSet(matchUpId: string, side1Score: number, side2Score: number, baseMatchUp: MatchUp): MatchUp | undefined;
|
|
32
|
+
undo(matchUpId: string, baseMatchUp: MatchUp): MatchUp | undefined;
|
|
33
|
+
redo(matchUpId: string, baseMatchUp: MatchUp): MatchUp | undefined;
|
|
34
|
+
reset(matchUpId: string, baseMatchUp: MatchUp): MatchUp | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Get the current engine-derived matchUp data.
|
|
37
|
+
*/
|
|
38
|
+
getMatchUp(matchUpId: string, baseMatchUp: MatchUp): MatchUp;
|
|
39
|
+
/**
|
|
40
|
+
* Get situation flags (break point, set point, etc.) for display.
|
|
41
|
+
*/
|
|
42
|
+
getSituation(matchUpId: string): Record<string, boolean> | undefined;
|
|
43
|
+
canUndo(matchUpId: string): boolean;
|
|
44
|
+
canRedo(matchUpId: string): boolean;
|
|
45
|
+
isComplete(matchUpId: string): boolean;
|
|
46
|
+
remove(matchUpId: string): void;
|
|
47
|
+
clear(): void;
|
|
48
|
+
private notifyAndReturn;
|
|
49
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { MatchUp } from '../../types';
|
|
2
|
+
export type InlineScoringMode = 'points' | 'games';
|
|
3
|
+
export interface InlineScoringConfig {
|
|
4
|
+
mode: InlineScoringMode;
|
|
5
|
+
showFooter?: boolean;
|
|
6
|
+
showSituation?: boolean;
|
|
7
|
+
/** Runtime state for footer buttons — set by renderInlineMatchUp before calling renderMatchUp */
|
|
8
|
+
canUndo?: boolean;
|
|
9
|
+
canRedo?: boolean;
|
|
10
|
+
isComplete?: boolean;
|
|
11
|
+
situationText?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface InlineScoringCallbacks {
|
|
14
|
+
onScoreChange?: (params: {
|
|
15
|
+
matchUpId: string;
|
|
16
|
+
matchUp: MatchUp;
|
|
17
|
+
engine: any;
|
|
18
|
+
}) => void;
|
|
19
|
+
onMatchComplete?: (params: {
|
|
20
|
+
matchUpId: string;
|
|
21
|
+
winningSide: number;
|
|
22
|
+
engine: any;
|
|
23
|
+
}) => void;
|
|
24
|
+
onEndMatch?: (params: {
|
|
25
|
+
matchUpId: string;
|
|
26
|
+
matchUpStatus: string;
|
|
27
|
+
sideNumber?: number;
|
|
28
|
+
engine: any;
|
|
29
|
+
}) => void;
|
|
30
|
+
onSubmit?: (params: {
|
|
31
|
+
matchUpId: string;
|
|
32
|
+
matchUp: MatchUp;
|
|
33
|
+
engine: any;
|
|
34
|
+
}) => void;
|
|
35
|
+
}
|
|
36
|
+
export interface InlineScoringEngineState {
|
|
37
|
+
engine: any;
|
|
38
|
+
matchUpFormat: string;
|
|
39
|
+
pointCount: number;
|
|
40
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InlineScoringManager } from './inlineScoringManager';
|
|
2
|
+
import { Composition, EventHandlers, MatchUp } from '../../types';
|
|
3
|
+
interface RenderInlineMatchUpParams {
|
|
4
|
+
matchUp: MatchUp;
|
|
5
|
+
composition: Composition;
|
|
6
|
+
manager: InlineScoringManager;
|
|
7
|
+
matchUpFormat?: string;
|
|
8
|
+
eventHandlers?: EventHandlers;
|
|
9
|
+
isLucky?: boolean;
|
|
10
|
+
isAdHoc?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
moiety?: boolean;
|
|
13
|
+
initialRoundNumber?: number;
|
|
14
|
+
isFinalRound?: boolean;
|
|
15
|
+
searchActive?: boolean;
|
|
16
|
+
selectedMatchUpId?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Renders a matchUp with inline scoring interactivity.
|
|
20
|
+
* Sets up event handlers and configuration state, then delegates to `renderMatchUp`.
|
|
21
|
+
* The footer buttons (Undo/Redo/Clear/Submit) are rendered by `renderMatchUp` itself,
|
|
22
|
+
* driven by the inlineScoring config state and eventHandlers passed down.
|
|
23
|
+
*
|
|
24
|
+
* Returns a container element that re-renders itself after each scoring action.
|
|
25
|
+
*/
|
|
26
|
+
export declare function renderInlineMatchUp(params: RenderInlineMatchUpParams): HTMLElement;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { InteractiveScoringShell, InteractiveScoringShellConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Build a mobile-first full-page interactive scoring shell around a
|
|
4
|
+
* `ScoringEngine` (wrapped by the existing `InlineScoringManager`).
|
|
5
|
+
*
|
|
6
|
+
* This is the courthive-public Phase 2 scoring UI: anonymous,
|
|
7
|
+
* local-only, mobile-first. It does NOT persist state itself —
|
|
8
|
+
* consumers subscribe to `stateChanged` events and handle
|
|
9
|
+
* persistence (IndexedDB in courthive-public's case).
|
|
10
|
+
*
|
|
11
|
+
* Phase 2 targets standard tennis matchUpFormats (`SET3-S:6/TB7`,
|
|
12
|
+
* `SET5-S:6/TB7`, etc.). INTENNSE bolt scoring, pickleball score
|
|
13
|
+
* caps, doubles lineup changes, and other format-specific behaviors
|
|
14
|
+
* are deferred to Phase 2.5+.
|
|
15
|
+
*
|
|
16
|
+
* The DOM structure:
|
|
17
|
+
* ```
|
|
18
|
+
* .chc-interactive-scoring-shell
|
|
19
|
+
* .chc-iss-header (side names + format indicator)
|
|
20
|
+
* .chc-iss-score-display (current set scores + game score)
|
|
21
|
+
* .chc-iss-point-buttons (big Side 1 / Side 2 point-won buttons)
|
|
22
|
+
* .chc-iss-control-bar (undo, reset, complete indicator)
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* All styling lives in `interactive-scoring.css` using the shared
|
|
26
|
+
* `--sp-*` / `--chc-*` theme variables.
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildInteractiveScoringShell(config: InteractiveScoringShellConfig): InteractiveScoringShell;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { MatchUp } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for `buildInteractiveScoringShell`.
|
|
4
|
+
*
|
|
5
|
+
* The shell is a mobile-first, full-page interactive scoring UI that
|
|
6
|
+
* wraps a `ScoringEngine` (via the existing `InlineScoringManager`)
|
|
7
|
+
* and presents two large point-entry buttons, a current score
|
|
8
|
+
* display, and a control bar with undo/reset.
|
|
9
|
+
*
|
|
10
|
+
* The shell is stateful but emits a `stateChanged` CustomEvent on
|
|
11
|
+
* every point so consumers (courthive-public for Phase 2) can
|
|
12
|
+
* persist the current MatchUp to IndexedDB or any other store.
|
|
13
|
+
*
|
|
14
|
+
* Phase 2 targets standard tennis matchUpFormats. INTENNSE, pickleball,
|
|
15
|
+
* and other formats are deferred to Phase 2.5+.
|
|
16
|
+
*/
|
|
17
|
+
export interface InteractiveScoringShellConfig {
|
|
18
|
+
/** Unique matchUp id — used as the engine key and the persistence key. */
|
|
19
|
+
matchUpId: string;
|
|
20
|
+
/** matchUpFormat code, e.g. `'SET3-S:6/TB7'`. */
|
|
21
|
+
matchUpFormat: string;
|
|
22
|
+
/** Tournament id, for context display only (never sent anywhere). */
|
|
23
|
+
tournamentId: string;
|
|
24
|
+
/** Display name for side 1 (singles player or doubles pair). */
|
|
25
|
+
side1Name: string;
|
|
26
|
+
/** Display name for side 2. */
|
|
27
|
+
side2Name: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional initial MatchUp to resume from — typically loaded from
|
|
30
|
+
* IndexedDB. If omitted, the shell starts at 0-0.
|
|
31
|
+
*/
|
|
32
|
+
initialMatchUp?: MatchUp;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Detail payload for the `stateChanged` CustomEvent.
|
|
36
|
+
*/
|
|
37
|
+
export interface StateChangedDetail {
|
|
38
|
+
matchUpId: string;
|
|
39
|
+
matchUp: MatchUp;
|
|
40
|
+
isComplete: boolean;
|
|
41
|
+
winningSide?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Handle returned by `buildInteractiveScoringShell`. Consumers mount
|
|
45
|
+
* `element` into the DOM, subscribe to state changes via
|
|
46
|
+
* `addEventListener`, and call `destroy()` on unmount.
|
|
47
|
+
*/
|
|
48
|
+
export interface InteractiveScoringShell {
|
|
49
|
+
/** The root DOM element for the scoring UI. Mount this into the page. */
|
|
50
|
+
element: HTMLElement;
|
|
51
|
+
/** Get the current MatchUp snapshot (for persistence). */
|
|
52
|
+
getState(): MatchUp;
|
|
53
|
+
/** Reset the scoring engine to 0-0. */
|
|
54
|
+
reset(): void;
|
|
55
|
+
/** Remove all listeners and release engine resources. */
|
|
56
|
+
destroy(): void;
|
|
57
|
+
/** Subscribe to state change events. */
|
|
58
|
+
addEventListener(type: 'stateChanged', listener: (event: CustomEvent<StateChangedDetail>) => void): void;
|
|
59
|
+
removeEventListener(type: 'stateChanged', listener: (event: CustomEvent<StateChangedDetail>) => void): void;
|
|
60
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
interface MatchUpFormatConfig {
|
|
2
|
+
labels?: {
|
|
3
|
+
title?: string;
|
|
4
|
+
setFormatLabel?: string;
|
|
5
|
+
finalSetLabel?: string;
|
|
6
|
+
tiebreakLabel?: string;
|
|
7
|
+
finalSetToggleLabel?: string;
|
|
8
|
+
standardFormatsLabel?: string;
|
|
9
|
+
cancel?: string;
|
|
10
|
+
select?: string;
|
|
11
|
+
custom?: string;
|
|
12
|
+
aggregate?: string;
|
|
13
|
+
game?: string;
|
|
14
|
+
gameType?: string;
|
|
15
|
+
deuceRule?: string;
|
|
16
|
+
none?: string;
|
|
17
|
+
traditional?: string;
|
|
18
|
+
consecutive2?: string;
|
|
19
|
+
consecutive3?: string;
|
|
20
|
+
consecutive4?: string;
|
|
21
|
+
goldenPoint?: string;
|
|
22
|
+
starPoint?: string;
|
|
23
|
+
games?: string;
|
|
24
|
+
points?: string;
|
|
25
|
+
descriptors?: {
|
|
26
|
+
bestOf?: string;
|
|
27
|
+
exactly?: string;
|
|
28
|
+
};
|
|
29
|
+
what?: {
|
|
30
|
+
sets?: string;
|
|
31
|
+
tiebreaks?: string;
|
|
32
|
+
timedSets?: string;
|
|
33
|
+
};
|
|
34
|
+
advantage?: {
|
|
35
|
+
ad?: string;
|
|
36
|
+
noAd?: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
options?: {
|
|
40
|
+
bestOf?: number[];
|
|
41
|
+
exactly?: number[];
|
|
42
|
+
setTo?: number[];
|
|
43
|
+
tiebreakTo?: number[];
|
|
44
|
+
tiebreakToExactly?: number[];
|
|
45
|
+
tiebreakAt?: number[];
|
|
46
|
+
minutes?: number[];
|
|
47
|
+
winBy?: number[];
|
|
48
|
+
matchRoots?: string[];
|
|
49
|
+
gameFormats?: string[];
|
|
50
|
+
modifiers?: string[];
|
|
51
|
+
};
|
|
52
|
+
preDefinedFormats?: Array<{
|
|
53
|
+
code: string;
|
|
54
|
+
text: string;
|
|
55
|
+
}>;
|
|
56
|
+
}
|
|
57
|
+
export declare function getMatchUpFormatModal({ existingMatchUpFormat, callback, config, modalConfig }?: {
|
|
58
|
+
existingMatchUpFormat?: string;
|
|
59
|
+
callback?: (format: string) => void;
|
|
60
|
+
config?: MatchUpFormatConfig;
|
|
61
|
+
modalConfig?: any;
|
|
62
|
+
}): {
|
|
63
|
+
setContent: ({ content: newContent, config }: {
|
|
64
|
+
content?: string | HTMLElement | ((container: HTMLElement) => any);
|
|
65
|
+
config?: import('../../types').ModalConfig;
|
|
66
|
+
}) => void;
|
|
67
|
+
setButtons: ({ buttons, config }: {
|
|
68
|
+
buttons: import('../../types').ModalButton[];
|
|
69
|
+
config?: import('../../types').ModalConfig;
|
|
70
|
+
}) => void;
|
|
71
|
+
update: ({ content: newContent, buttons, title, config: newConfig, onClose }: {
|
|
72
|
+
content?: string | HTMLElement | ((container: HTMLElement) => any);
|
|
73
|
+
buttons?: import('../../types').ModalButton[];
|
|
74
|
+
title?: string;
|
|
75
|
+
config?: import('../../types').ModalConfig;
|
|
76
|
+
onClose?: (params: {
|
|
77
|
+
content?: any;
|
|
78
|
+
}) => void;
|
|
79
|
+
}) => void;
|
|
80
|
+
};
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure logic for match format configuration
|
|
3
|
+
* Extracted from matchUpFormat.ts for testability
|
|
4
|
+
*/
|
|
5
|
+
export declare const TIMED_SETS = "Timed set";
|
|
6
|
+
export declare const TIEBREAKS = "Tiebreak";
|
|
7
|
+
export declare const NOAD = "No-Ad";
|
|
8
|
+
export declare const SETS = "Set";
|
|
9
|
+
export declare const AD = "Ad";
|
|
10
|
+
export declare const MATCH_ROOTS: readonly ["SET", "HAL", "QTR", "PER", "INN", "RND", "FRM", "MAP"];
|
|
11
|
+
export declare const MATCH_ROOT_LABELS: Record<string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Returns valid bestOf options for a given match root.
|
|
14
|
+
* SET root: [1,3,5] (standard tennis)
|
|
15
|
+
* Other roots: [1..12] (wide range for cross-sport)
|
|
16
|
+
*/
|
|
17
|
+
export declare function getBestOfOptionsForRoot(matchRoot?: string): number[];
|
|
18
|
+
export interface SetFormatConfig {
|
|
19
|
+
descriptor: string;
|
|
20
|
+
bestOf?: number;
|
|
21
|
+
exactly?: number;
|
|
22
|
+
advantage: string;
|
|
23
|
+
what: string;
|
|
24
|
+
setTo: number;
|
|
25
|
+
tiebreakAt: number;
|
|
26
|
+
tiebreakTo: number;
|
|
27
|
+
winBy: number;
|
|
28
|
+
minutes: number;
|
|
29
|
+
based?: string;
|
|
30
|
+
modifier?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface FormatConfig {
|
|
33
|
+
matchRoot?: string;
|
|
34
|
+
aggregate?: boolean;
|
|
35
|
+
gameFormat?: {
|
|
36
|
+
type: 'CONSECUTIVE';
|
|
37
|
+
count: number;
|
|
38
|
+
deuceAfter?: number;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'TRADITIONAL';
|
|
41
|
+
deuceAfter?: number;
|
|
42
|
+
};
|
|
43
|
+
setFormat: SetFormatConfig;
|
|
44
|
+
finalSetFormat: SetFormatConfig;
|
|
45
|
+
}
|
|
46
|
+
export interface ParsedMatchUpFormat {
|
|
47
|
+
matchRoot?: string;
|
|
48
|
+
aggregate?: boolean;
|
|
49
|
+
gameFormat?: {
|
|
50
|
+
type: 'CONSECUTIVE';
|
|
51
|
+
count: number;
|
|
52
|
+
deuceAfter?: number;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'TRADITIONAL';
|
|
55
|
+
deuceAfter?: number;
|
|
56
|
+
};
|
|
57
|
+
bestOf?: number;
|
|
58
|
+
exactly?: number;
|
|
59
|
+
setFormat: any;
|
|
60
|
+
finalSetFormat?: any;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Create default set format configuration
|
|
64
|
+
*/
|
|
65
|
+
export declare function createDefaultSetFormat(isFinalSet?: boolean): SetFormatConfig;
|
|
66
|
+
/**
|
|
67
|
+
* Create default format configuration
|
|
68
|
+
*/
|
|
69
|
+
export declare function createDefaultFormat(): FormatConfig;
|
|
70
|
+
/**
|
|
71
|
+
* Check if a set format is tiebreak-only (e.g., F:TB10)
|
|
72
|
+
*/
|
|
73
|
+
export declare function isTiebreakOnlySet(setFormat: any): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Generate a setFormat object from FormatConfig
|
|
76
|
+
* Pure function - no DOM dependencies
|
|
77
|
+
*/
|
|
78
|
+
export declare function buildSetFormat(config: SetFormatConfig, hasTiebreak: boolean): any;
|
|
79
|
+
/**
|
|
80
|
+
* Build parsed matchUp format from current configuration
|
|
81
|
+
* Pure function - no DOM dependencies
|
|
82
|
+
*/
|
|
83
|
+
export declare function buildParsedFormat(config: FormatConfig, hasSetTiebreak: boolean, hasFinalSet: boolean, hasFinalSetTiebreak: boolean): ParsedMatchUpFormat;
|
|
84
|
+
/**
|
|
85
|
+
* Determine which components should be visible based on the current 'what' value
|
|
86
|
+
*/
|
|
87
|
+
export declare function getComponentVisibility(what: string): {
|
|
88
|
+
setTo: boolean;
|
|
89
|
+
tiebreakAt: boolean;
|
|
90
|
+
tiebreakTo: boolean;
|
|
91
|
+
winBy: boolean;
|
|
92
|
+
advantage: boolean;
|
|
93
|
+
minutes: boolean;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Calculate valid tiebreakAt options based on setTo value
|
|
97
|
+
*/
|
|
98
|
+
export declare function getTiebreakAtOptions(setTo: number): number[];
|
|
99
|
+
/**
|
|
100
|
+
* Auto-adjust tiebreakAt when setTo changes
|
|
101
|
+
* Returns the new tiebreakAt value that should be used
|
|
102
|
+
*/
|
|
103
|
+
export declare function autoAdjustTiebreakAt(newSetTo: number, currentTiebreakAt: number): number;
|
|
104
|
+
/**
|
|
105
|
+
* Validate that a tiebreakAt value is valid for the given setTo
|
|
106
|
+
*/
|
|
107
|
+
export declare function isValidTiebreakAt(setTo: number, tiebreakAt: number): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Check if final set option should be shown
|
|
110
|
+
*/
|
|
111
|
+
export declare function shouldShowFinalSetOption(bestOf: number): boolean;
|
|
112
|
+
export declare function initializeFormatFromString(matchUpFormat: string, parseFunction: (format: string) => any): FormatConfig;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ModalButton, ModalConfig, ModalParams } from '../../types';
|
|
2
|
+
type ModalContent = string | HTMLElement | ((container: HTMLElement) => any);
|
|
3
|
+
export declare function isFunction(fx: any): fx is (...args: any[]) => any;
|
|
4
|
+
export declare function isString(item: any): item is string;
|
|
5
|
+
export declare function isArray(item: any): item is any[];
|
|
6
|
+
export declare function isObject(item: any): item is object;
|
|
7
|
+
export declare function removeAllChildNodes(parent: HTMLElement | null): void;
|
|
8
|
+
export declare const cModal: {
|
|
9
|
+
close: (conditional?: boolean) => void;
|
|
10
|
+
open: ({ title, content, buttons, footer, config, onClose }?: ModalParams) => {
|
|
11
|
+
setContent: ({ content: newContent, config }: {
|
|
12
|
+
content?: ModalContent;
|
|
13
|
+
config?: ModalConfig;
|
|
14
|
+
}) => void;
|
|
15
|
+
setButtons: ({ buttons, config }: {
|
|
16
|
+
buttons: ModalButton[];
|
|
17
|
+
config?: ModalConfig;
|
|
18
|
+
}) => void;
|
|
19
|
+
update: ({ content: newContent, buttons, title, config: newConfig, onClose }: {
|
|
20
|
+
content?: ModalContent;
|
|
21
|
+
buttons?: ModalButton[];
|
|
22
|
+
title?: string;
|
|
23
|
+
config?: ModalConfig;
|
|
24
|
+
onClose?: (params: {
|
|
25
|
+
content?: any;
|
|
26
|
+
}) => void;
|
|
27
|
+
}) => void;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const backdropStyle: () => string;
|
|
2
|
+
export declare const modalStyle: () => string;
|
|
3
|
+
export declare const bodyFreeze: () => string;
|
|
4
|
+
export declare const modalContainerStyle: () => string;
|
|
5
|
+
export declare const modalDialogStyle: () => string;
|
|
6
|
+
export declare const modalHeaderStyle: () => string;
|
|
7
|
+
export declare const modalTitleStyle: () => string;
|
|
8
|
+
export declare const modalFooterStyle: () => string;
|