@dcrackel/hematournamentui 1.0.708 → 1.0.710

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.
Files changed (38) hide show
  1. package/README.md +148 -106
  2. package/dist/HemaTournamentUI-lib.es.js +6678 -6196
  3. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  4. package/dist/hematournamentui-tailwind.css +16 -6
  5. package/package.json +1 -1
  6. package/src/stories/Atoms/Input/BaseInput.test.js +97 -85
  7. package/src/stories/Atoms/Input/BaseInput.vue +149 -150
  8. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +31 -20
  9. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.test.js +109 -0
  10. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +192 -133
  11. package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js +48 -41
  12. package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.vue +227 -206
  13. package/src/stories/Organisms/Wizards/EditEventWizard/DirectElimination/DirectElimination.vue +226 -225
  14. package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.vue +204 -204
  15. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.stories.js +133 -91
  16. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.test.js +191 -0
  17. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.vue +366 -309
  18. package/src/stories/Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue +172 -171
  19. package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue +216 -215
  20. package/src/stories/Organisms/Wizards/EditEventWizard/PriceFields.test.js +79 -0
  21. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +93 -52
  22. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +91 -75
  23. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +14 -0
  24. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.test.js +39 -0
  25. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.vue +13 -3
  26. package/src/stories/Templates/PersonManagement/Basic/BasicEdit.vue +170 -172
  27. package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +156 -103
  28. package/src/stories/Templates/PersonManagement/PersonManagement.test.js +329 -0
  29. package/src/stories/Templates/PersonManagement/PersonManagement.vue +329 -213
  30. package/src/stories/Templates/PersonManagement/PersonManagementDraft.js +42 -0
  31. package/src/stories/Templates/TournamentManagement/TournamentManagement.stories.js +84 -83
  32. package/src/stories/Templates/TournamentManagement/TournamentManagement.test.js +89 -0
  33. package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +363 -360
  34. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +116 -113
  35. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +292 -280
  36. package/src/stories/Util/Validations/PersonManagementValidations.js +45 -29
  37. package/src/stories/Util/Validations/PriceValidation.js +6 -0
  38. package/src/stories/Util/Validations/TournamentFieldsValidations.js +4 -0
package/README.md CHANGED
@@ -1,106 +1,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
- # 1. Setup & Prerequisites
30
-
31
- Ensure you have an account on npm. If not, you can create one for free.
32
- Verify node and npm installations:
33
-
34
- ```
35
- Copy code
36
- node -v
37
- npm -v
38
- ```
39
-
40
- # 2. Preparing Your Storybook Library
41
-
42
- a. Building the Library
43
- Compile your library with Vite or your bundler:
44
-
45
- ```
46
- vite build
47
- ```
48
-
49
- b. Update package.json
50
- Ensure the following fields are set:
51
-
52
- name: Name of your package.
53
- version: Version number.
54
- main: Main entry file (e.g., dist/index.js).
55
- files: Files to include, e.g., ["dist"].
56
-
57
- # 3. Logging in to NPM
58
-
59
- Login to npm (if you haven't already):
60
-
61
- ```
62
- npm login
63
- ```
64
-
65
- Provide your username, password, and email.
66
-
67
- # 4. Publishing to NPM
68
-
69
- a. Default (Private Package)
70
- For scoped private packages (@username/project-name):
71
-
72
- ```
73
- npm publish
74
- ```
75
-
76
- b. Public Package
77
- For public packages:
78
-
79
- ```
80
- npm publish --access=public
81
- ```
82
-
83
- # 5. Verifying Your Package
84
-
85
- Check on the npm website to verify your package's publication.
86
-
87
- Check the registry name
88
-
89
- ```
90
- npm get registry
91
- ```
92
-
93
- # 6. Installing and Using the Library
94
-
95
- To install the library:
96
-
97
- ```
98
- npm install your-library-name
99
- ```
100
-
101
- Users can then import and utilize your library's components.
102
-
103
- Notes:
104
-
105
- Always update the version in package.json before republishing.
106
- Ensure only necessary files are bundled to prevent package bloat.
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
+ ## Person profile drafts and Save
30
+
31
+ `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.
32
+
33
+ ```vue
34
+ <PersonManagement
35
+ :personProfile="person"
36
+ :saving="saving"
37
+ :disabled="readOnly"
38
+ :draftResetKey="profileRevision"
39
+ @submit:person="savePerson"
40
+ @update:image="handleDraftImage"
41
+ @error:image="handleImageError"
42
+ />
43
+ ```
44
+
45
+ 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.
46
+
47
+ `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.
48
+
49
+ 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.
50
+
51
+ 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.
52
+
53
+ 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.
54
+
55
+ # 1. Setup & Prerequisites
56
+
57
+ Ensure you have an account on npm. If not, you can create one for free.
58
+ Verify node and npm installations:
59
+
60
+ ```
61
+ Copy code
62
+ node -v
63
+ npm -v
64
+ ```
65
+
66
+ # 2. Preparing Your Storybook Library
67
+
68
+ a. Building the Library
69
+ Compile your library with Vite or your bundler:
70
+
71
+ ```
72
+ vite build
73
+ ```
74
+
75
+ b. Update package.json
76
+ Ensure the following fields are set:
77
+
78
+ name: Name of your package.
79
+ version: Version number.
80
+ main: Main entry file (e.g., dist/index.js).
81
+ files: Files to include, e.g., ["dist"].
82
+
83
+ # 3. Logging in to NPM
84
+
85
+ Login to npm (if you haven't already):
86
+
87
+ ```
88
+ npm login
89
+ ```
90
+
91
+ Provide your username, password, and email.
92
+
93
+ # 4. Publishing to NPM
94
+
95
+ a. Default (Private Package)
96
+ For scoped private packages (@username/project-name):
97
+
98
+ ```
99
+ npm publish
100
+ ```
101
+
102
+ b. Public Package
103
+ For public packages:
104
+
105
+ ```
106
+ npm publish --access=public
107
+ ```
108
+
109
+ # 5. Verifying Your Package
110
+
111
+ Check on the npm website to verify your package's publication.
112
+
113
+ Check the registry name
114
+
115
+ ```
116
+ npm get registry
117
+ ```
118
+
119
+ # 6. Installing and Using the Library
120
+
121
+ To install the library:
122
+
123
+ ```
124
+ npm install your-library-name
125
+ ```
126
+
127
+ Users can then import and utilize your library's components.
128
+
129
+ Notes:
130
+
131
+ Always update the version in package.json before republishing.
132
+ Ensure only necessary files are bundled to prevent package bloat.
133
+
134
+ ## Existing-event step saves
135
+
136
+ `EditEventInfo` and `EditEventWizard` accept `editMode`, controlled `step` (1–5), `saving`, `saveError`, and `saveNotice` props.
137
+
138
+ 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.
139
+
140
+ `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`.
141
+
142
+ 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.
143
+
144
+ ## Tournament and event prices
145
+
146
+ TournamentManagement's Basic tab edits `tournament.BasePrice`; the event wizard's Basic Info step edits `event.EventPrice`. Both fields support decimal amounts and zero. Missing or null prices show a `0.00` placeholder, and clearing a price saves zero. Negative and nonnumeric prices prevent submission.
147
+
148
+ `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.