@dcrackel/hematournamentui 1.0.711 → 1.0.713
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/.prettierignore +7 -7
- package/.storybook/main.js +3 -1
- package/README.md +182 -148
- package/dist/HemaTournamentUI-lib.es.js +4150 -4039
- package/dist/HemaTournamentUI-lib.umd.js +27 -27
- package/dist/hematournamentui-tailwind.css +11 -0
- package/package.json +96 -96
- package/prettier.config.js +16 -16
- package/src/main.js +1 -1
- package/src/mocks/getDEBouts-TableOf128.js +37 -37
- package/src/mocks/getDEBouts-TableOf64.js +35 -35
- package/src/stories/Atoms/Input/BaseInput.test.js +97 -97
- package/src/stories/Atoms/Input/BaseInput.vue +149 -149
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -23
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -35
- package/src/stories/Molecules/Indicators/RegistrationStatus/RegistrationStatus.vue +30 -0
- package/src/stories/Molecules/Menus/HoverActions/HoverActions.test.js +138 -0
- package/src/stories/Molecules/Menus/HoverActions/HoverActions.vue +212 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.stories.js +6 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -18
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +1 -1
- package/src/stories/Organisms/Cards/BoutCard/BoutCard.vue +5 -1
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +19 -10
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +11 -7
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -33
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -45
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -103
- package/src/stories/Organisms/Cards/Director/DirectorCard.test.js +82 -0
- package/src/stories/Organisms/Cards/Director/DirectorCard.vue +32 -51
- package/src/stories/Organisms/Cards/EditBout/EditBout.test.js +51 -51
- package/src/stories/Organisms/Cards/EventCard/EventCard.stories.js +41 -1
- package/src/stories/Organisms/Cards/EventCard/EventCard.test.js +106 -0
- package/src/stories/Organisms/Cards/EventCard/EventCard.vue +62 -30
- package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -298
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +77 -60
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +144 -143
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +289 -256
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -69
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -80
- package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +153 -153
- package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +4 -0
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +31 -31
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.test.js +109 -109
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +192 -192
- package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +1 -0
- package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +247 -204
- package/src/stories/Organisms/Containers/Tableau/Tableau.vue +89 -15
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -29
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -46
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -21
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -39
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -145
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -64
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +36 -57
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +101 -65
- package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +14 -1
- package/src/stories/Organisms/Headers/AttendanceSummary/AttendanceSummary.vue +12 -5
- package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js +52 -48
- package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.vue +256 -227
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectElimination/DirectElimination.vue +226 -226
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.vue +204 -204
- package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.stories.js +137 -133
- package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.test.js +221 -191
- package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.vue +372 -366
- package/src/stories/Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue +172 -172
- package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue +216 -216
- package/src/stories/Organisms/Wizards/EditEventWizard/PriceFields.test.js +79 -79
- package/src/stories/Organisms/Wizards/EditEventWizard/RuleSerialization.test.js +29 -0
- package/src/stories/Organisms/Wizards/EditEventWizard/WeaponSelection.test.js +138 -0
- package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +123 -12
- package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +178 -166
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +35 -7
- package/src/stories/Templates/EventManagement/Bracket/BracketDirectorAssignment.test.js +242 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketMobile.test.js +131 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +42 -39
- package/src/stories/Templates/EventManagement/Bracket/BracketStories.test.js +80 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.js +93 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.test.js +152 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -39
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -79
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +93 -93
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +91 -91
- package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.stories.js +31 -1
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.test.js +121 -121
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +9 -2
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +5 -4
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +81 -81
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.test.js +39 -39
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.vue +101 -101
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -71
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.vue +86 -86
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -86
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.vue +247 -247
- package/src/stories/Templates/PersonManagement/Basic/BasicEdit.vue +170 -170
- package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +156 -156
- package/src/stories/Templates/PersonManagement/PersonManagement.test.js +329 -329
- package/src/stories/Templates/PersonManagement/PersonManagement.vue +329 -329
- package/src/stories/Templates/PersonManagement/PersonManagementDraft.js +42 -42
- package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.stories.js +58 -45
- package/src/stories/Templates/TournamentManagement/TournamentManagement.stories.js +84 -84
- package/src/stories/Templates/TournamentManagement/TournamentManagement.test.js +114 -114
- package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +363 -363
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +116 -116
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +307 -307
- package/src/stories/Util/Validations/PersonManagementValidations.js +45 -45
- package/src/stories/Util/Validations/PriceValidation.js +6 -6
- package/src/stories/Util/boutDirectorAssignment.js +46 -0
- package/src/stories/Util/registrationStatus.js +11 -0
- package/src/stories/Util/tabs.js +19 -47
package/.prettierignore
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
node_modules/
|
|
2
|
-
dist/
|
|
3
|
-
storybook-static/
|
|
4
|
-
coverage/
|
|
5
|
-
tailwind/output.css
|
|
6
|
-
package-lock.json
|
|
7
|
-
*.log
|
|
1
|
+
node_modules/
|
|
2
|
+
dist/
|
|
3
|
+
storybook-static/
|
|
4
|
+
coverage/
|
|
5
|
+
tailwind/output.css
|
|
6
|
+
package-lock.json
|
|
7
|
+
*.log
|
package/.storybook/main.js
CHANGED
package/README.md
CHANGED
|
@@ -1,148 +1,182 @@
|
|
|
1
|
-
# Vue 3 + Vite
|
|
2
|
-
|
|
3
|
-
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
-
|
|
5
|
-
## Recommended IDE Setup
|
|
6
|
-
|
|
7
|
-
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
|
8
|
-
|
|
9
|
-
## Publishing a Storybook Library to NPM
|
|
10
|
-
|
|
11
|
-
Follow this guide to publish your Storybook library to NPM, making it available for others to easily npm install.
|
|
12
|
-
|
|
13
|
-
## Shared CSS
|
|
14
|
-
|
|
15
|
-
Build the package stylesheet as a separate step:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm run build:package-css
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
The generated file is `dist/hematournamentui-tailwind.css`. Consuming apps should import it from the package instead of manually copying `tailwind/output.css`:
|
|
22
|
-
|
|
23
|
-
```js
|
|
24
|
-
import '@dcrackel/hematournamentui/tailwind.css';
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Use `npm run build:tailwind` for Storybook's local `tailwind/output.css` workflow. Use `npm run build:package-css` when preparing CSS for the parent app or package publish.
|
|
28
|
-
|
|
29
|
-
##
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```vue
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
:
|
|
37
|
-
:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
1
|
+
# Vue 3 + Vite
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
4
|
+
|
|
5
|
+
## Recommended IDE Setup
|
|
6
|
+
|
|
7
|
+
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
|
8
|
+
|
|
9
|
+
## Publishing a Storybook Library to NPM
|
|
10
|
+
|
|
11
|
+
Follow this guide to publish your Storybook library to NPM, making it available for others to easily npm install.
|
|
12
|
+
|
|
13
|
+
## Shared CSS
|
|
14
|
+
|
|
15
|
+
Build the package stylesheet as a separate step:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm run build:package-css
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The generated file is `dist/hematournamentui-tailwind.css`. Consuming apps should import it from the package instead of manually copying `tailwind/output.css`:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import '@dcrackel/hematournamentui/tailwind.css';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Use `npm run build:tailwind` for Storybook's local `tailwind/output.css` workflow. Use `npm run build:package-css` when preparing CSS for the parent app or package publish.
|
|
28
|
+
|
|
29
|
+
## Single bracket bout director assignment
|
|
30
|
+
|
|
31
|
+
Hover over a bracket pairing for a compact action dropdown; clicking the pairing still opens the bout directly. The dropdown offers Open bout, Resume bout, or Edit bout according to status. Assign director is enabled by default for scheduled bouts except the final and grand final; a parent can explicitly disable `showBoutDirectorAssignment` when needed. When a director is assigned, the hover menu shows their name as static text in the assigned ring/connector color above Assign Director, with bright blue as a fallback when no color is supplied. Active and completed bouts show their saved director above Resume bout or Edit bout. Unassigned bouts omit the name. No permanent icon is rendered.
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<Bracket
|
|
35
|
+
v-bind="bracketProps"
|
|
36
|
+
:showBoutDirectorAssignment="canManageAssignments"
|
|
37
|
+
@request:bout-director="openStaffDirectorPicker"
|
|
38
|
+
/>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`request:bout-director` carries a detached copy of the current bout, including `BoutId` and `DEBoutId` when supplied. The app opens its Staff-based picker, saves the choice, and passes updated planned coverage through `plannedDirectingStations` and `plannedBoutAssignments`. This action does not start the bout or change referee, score, sequence, or completion fields. Active, completed, and unidentified bouts have no assignment action. Planning is independent of directing eligibility, so future slots represented as BYE placeholders can also be assigned. Scheduled future bouts can be assigned before both competitors are known.
|
|
42
|
+
|
|
43
|
+
The dropdown opens after a short hover delay and stays open while moving into it. Keyboard focus reveals it immediately; Arrow Down enters its actions, arrows move between actions, and Escape dismisses it and restores focus. It closes on outside clicks or scrolling. The `HoverBoutActions` Storybook example includes a mock parent picker. Production distribution and section assignment remain app-owned. For standalone `TableauBoutCard` usage, pass `plannedDirectorName` and `plannedDirectorColor` to display planned assignment context without changing the bout's saved referee fields. `TableauColumn` accepts the `plannedStationByBout` lookup used by `Tableau` and forwards each planned director name and color. Each complete connector uses the receiving bout's planned director/ring color, including both feeders and the joining line. A receiving bout with no planned director has a neutral connector.
|
|
44
|
+
|
|
45
|
+
## Storybook planned coverage
|
|
46
|
+
|
|
47
|
+
All bracket stories enable director assignment. The default examples start with two directors. The story parent splits scheduled main-bracket bouts into contiguous halves for two directors and quarters for four, through the semifinals, inclusive. Finals, placement, and consolation rounds receive no automatic assignments; eligible bouts there remain available for anyone to claim, including a fresh director.
|
|
48
|
+
|
|
49
|
+
Three, five, and six directors use near-equal contiguous groups within each round. Known opening BYEs add no work; future empty slots remain plannable. With two or four directors, section boundaries stay aligned with bracket halves or quarters even when BYEs make workloads uneven. With other counts, boundaries can shift as rounds narrow. Adding a director redistributes scheduled coverage and preserves existing plans for active and completed bouts. Manual bout assignment remains available through the semifinals. Finals cannot be preassigned and remain available to claim when both competitors are known.
|
|
50
|
+
|
|
51
|
+
The ThreeDirectors, FourDirectors, FiveDirectors, and SixDirectors stories demonstrate the counts. Distribution lives in the story parent simulation; reusable components still receive explicit `plannedDirectingStations` and `plannedBoutAssignments` from the consuming app.
|
|
52
|
+
|
|
53
|
+
## Phone directing view
|
|
54
|
+
|
|
55
|
+
Below 768px, the bracket shows the bout list with connection status and planned ring suggestions. The organising panel and assignment actions are unavailable on phones, even when their props are enabled. Completed bouts sit in a collapsed section for score corrections. Returning to desktop restores the selected List View or Tableau.
|
|
56
|
+
|
|
57
|
+
Phone event navigation keeps Pools, Pool Results, Bracket, Final Results, and Penalties accessible in a scrolling row. Edit, Staff, Displays, and Checkin remain in the desktop organiser menu. Selecting List View on desktop does not change the navigation. The PhoneDirector bracket story demonstrates this responsive layout; use a viewport narrower than 768px.
|
|
58
|
+
|
|
59
|
+
## Event waitlist setting
|
|
60
|
+
|
|
61
|
+
The event wizard exposes an Enable Waitlist toggle beneath Max Fencers on Basic Info. The boolean event field `WaitlistEnabled` defaults to `true` when absent and preserves an explicit `false`. Both `update:submit` and `save:step` include the field on the event payload, separately from `rules`. The consuming app persists it and returns the saved value through the `event` prop; registration availability and capacity enforcement remain app-owned.
|
|
62
|
+
|
|
63
|
+
## Person profile drafts and Save
|
|
64
|
+
|
|
65
|
+
`PersonManagement` edits a detached draft and emits `submit:person` with a detached snapshot only when the user saves a valid form. `BaseInput` emits `update:value` synchronously; consumers should debounce their own expensive searches or validation.
|
|
66
|
+
|
|
67
|
+
```vue
|
|
68
|
+
<PersonManagement
|
|
69
|
+
:personProfile="person"
|
|
70
|
+
:saving="saving"
|
|
71
|
+
:disabled="readOnly"
|
|
72
|
+
:draftResetKey="profileRevision"
|
|
73
|
+
@submit:person="savePerson"
|
|
74
|
+
@update:image="handleDraftImage"
|
|
75
|
+
@error:image="handleImageError"
|
|
76
|
+
/>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The parent owns API calls, save failures, and authoritative reloads. After a successful reload, supply the refreshed `personProfile` and increment `draftResetKey` in the same update. Selecting a different `PersonId` resets the draft automatically. Updates for the same person preserve unsaved edits until the reset key changes; remounting with a versioned Vue `key` also works.
|
|
80
|
+
|
|
81
|
+
`saving` and `disabled` disable the form's native controls and prevent new edits and save/delete/merge actions. An upload started earlier may still finish updating the draft. Saving shows accessible busy feedback. Image uploads temporarily disable Save until they finish. Validation failures show a summary across tabs, with links back to the invalid fields' tabs.
|
|
82
|
+
|
|
83
|
+
Draft `LegalName` and `EmailAddress` take precedence over legacy names and email relations, including explicit empty strings. The library continues emitting `EmailAddress`; the parent maps it to backend `Email` and omits stale `PersonEmails` as required by its API. An explicit `HemaRatingsId: null` displays blank and never falls back to old ratings. Blank ID edits remain blank in the draft; the parent converts them to `null` and normalizes valid positive integer IDs.
|
|
84
|
+
|
|
85
|
+
Successful uploads update the same draft's `ProfileImage` and emit `update:image` with the URL. That event is a draft notification and should not automatically persist the profile. `ImageCropper` emits successful edits as `update:url`, busy state as `update:uploading`, and failures separately as `error:load` or `error:upload`. `PersonManagement` displays image failures and forwards them as `error:image` with `{ type: 'load' | 'upload', message, url?, status? }`; failures never emit a null image edit.
|
|
86
|
+
|
|
87
|
+
UI regression tests cover the draft and event contracts. Live backend save/reload checks for email, HR ID changes/clears, first-time profiles, and images remain the consuming application's responsibility; a skipped ratings refresh is separate from profile save success.
|
|
88
|
+
|
|
89
|
+
# 1. Setup & Prerequisites
|
|
90
|
+
|
|
91
|
+
Ensure you have an account on npm. If not, you can create one for free.
|
|
92
|
+
Verify node and npm installations:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
Copy code
|
|
96
|
+
node -v
|
|
97
|
+
npm -v
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
# 2. Preparing Your Storybook Library
|
|
101
|
+
|
|
102
|
+
a. Building the Library
|
|
103
|
+
Compile your library with Vite or your bundler:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
vite build
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
b. Update package.json
|
|
110
|
+
Ensure the following fields are set:
|
|
111
|
+
|
|
112
|
+
name: Name of your package.
|
|
113
|
+
version: Version number.
|
|
114
|
+
main: Main entry file (e.g., dist/index.js).
|
|
115
|
+
files: Files to include, e.g., ["dist"].
|
|
116
|
+
|
|
117
|
+
# 3. Logging in to NPM
|
|
118
|
+
|
|
119
|
+
Login to npm (if you haven't already):
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
npm login
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Provide your username, password, and email.
|
|
126
|
+
|
|
127
|
+
# 4. Publishing to NPM
|
|
128
|
+
|
|
129
|
+
a. Default (Private Package)
|
|
130
|
+
For scoped private packages (@username/project-name):
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
npm publish
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
b. Public Package
|
|
137
|
+
For public packages:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
npm publish --access=public
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
# 5. Verifying Your Package
|
|
144
|
+
|
|
145
|
+
Check on the npm website to verify your package's publication.
|
|
146
|
+
|
|
147
|
+
Check the registry name
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
npm get registry
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
# 6. Installing and Using the Library
|
|
154
|
+
|
|
155
|
+
To install the library:
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
npm install your-library-name
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Users can then import and utilize your library's components.
|
|
162
|
+
|
|
163
|
+
Notes:
|
|
164
|
+
|
|
165
|
+
Always update the version in package.json before republishing.
|
|
166
|
+
Ensure only necessary files are bundled to prevent package bloat.
|
|
167
|
+
|
|
168
|
+
## Existing-event step saves
|
|
169
|
+
|
|
170
|
+
`EditEventInfo` and `EditEventWizard` accept `editMode`, controlled `step` (1–5), `saving`, `saveError`, and `saveNotice` props.
|
|
171
|
+
|
|
172
|
+
With `editMode` enabled, steps 1–4 display **Save and Continue** and step 5 displays **Save**. Every save emits `save:step` with `{ event, step }`. The component does not advance itself: the consuming app persists the section, supplies the saved event, and changes `step` after success. Keep `step` and the draft unchanged on failure. Set `saving` while pending to disable editing and show inline feedback.
|
|
173
|
+
|
|
174
|
+
`update:dirty` emits a boolean when the draft changes or is reset from saved props. `navigate:step` requests Back navigation; `update:cancel` requests cancellation. The consuming app owns unsaved-change protection and routing. These events are forwarded by `EditEventInfo`.
|
|
175
|
+
|
|
176
|
+
The default `editMode: false` retains creation's Next/Back navigation and one `update:submit` at the end. No API calls or persistence are implemented in this package. Storybook's EditWithStepSaves example simulates successful saves; SavingStep and StepSaveFailed show the pending and failure states.
|
|
177
|
+
|
|
178
|
+
## Tournament and event prices
|
|
179
|
+
|
|
180
|
+
TournamentManagement's Basic tab edits `tournament.BasePrice`; the event wizard's Basic Info step edits `event.EventPrice`. Both fields support decimal amounts and zero. Tournament base prices display two decimal places when loaded and after leaving the input. Missing or null prices show a `0.00` placeholder, and clearing a price saves zero. Negative and nonnumeric prices prevent submission.
|
|
181
|
+
|
|
182
|
+
`submit:tournament` includes numeric `BasePrice`. The wizard includes numeric `EventPrice` in both `update:submit` and `save:step.event`, separate from event rules. The consuming app owns currency, persistence, and supplying refreshed price values through props.
|