@dcrackel/hematournamentui 1.0.711 → 1.0.712

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/README.md CHANGED
@@ -1,148 +1,152 @@
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. 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.
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.
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
+ ## Event waitlist setting
30
+
31
+ 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.
32
+
33
+ ## Person profile drafts and Save
34
+
35
+ `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.
36
+
37
+ ```vue
38
+ <PersonManagement
39
+ :personProfile="person"
40
+ :saving="saving"
41
+ :disabled="readOnly"
42
+ :draftResetKey="profileRevision"
43
+ @submit:person="savePerson"
44
+ @update:image="handleDraftImage"
45
+ @error:image="handleImageError"
46
+ />
47
+ ```
48
+
49
+ 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.
50
+
51
+ `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.
52
+
53
+ 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.
54
+
55
+ 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.
56
+
57
+ 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.
58
+
59
+ # 1. Setup & Prerequisites
60
+
61
+ Ensure you have an account on npm. If not, you can create one for free.
62
+ Verify node and npm installations:
63
+
64
+ ```
65
+ Copy code
66
+ node -v
67
+ npm -v
68
+ ```
69
+
70
+ # 2. Preparing Your Storybook Library
71
+
72
+ a. Building the Library
73
+ Compile your library with Vite or your bundler:
74
+
75
+ ```
76
+ vite build
77
+ ```
78
+
79
+ b. Update package.json
80
+ Ensure the following fields are set:
81
+
82
+ name: Name of your package.
83
+ version: Version number.
84
+ main: Main entry file (e.g., dist/index.js).
85
+ files: Files to include, e.g., ["dist"].
86
+
87
+ # 3. Logging in to NPM
88
+
89
+ Login to npm (if you haven't already):
90
+
91
+ ```
92
+ npm login
93
+ ```
94
+
95
+ Provide your username, password, and email.
96
+
97
+ # 4. Publishing to NPM
98
+
99
+ a. Default (Private Package)
100
+ For scoped private packages (@username/project-name):
101
+
102
+ ```
103
+ npm publish
104
+ ```
105
+
106
+ b. Public Package
107
+ For public packages:
108
+
109
+ ```
110
+ npm publish --access=public
111
+ ```
112
+
113
+ # 5. Verifying Your Package
114
+
115
+ Check on the npm website to verify your package's publication.
116
+
117
+ Check the registry name
118
+
119
+ ```
120
+ npm get registry
121
+ ```
122
+
123
+ # 6. Installing and Using the Library
124
+
125
+ To install the library:
126
+
127
+ ```
128
+ npm install your-library-name
129
+ ```
130
+
131
+ Users can then import and utilize your library's components.
132
+
133
+ Notes:
134
+
135
+ Always update the version in package.json before republishing.
136
+ Ensure only necessary files are bundled to prevent package bloat.
137
+
138
+ ## Existing-event step saves
139
+
140
+ `EditEventInfo` and `EditEventWizard` accept `editMode`, controlled `step` (1–5), `saving`, `saveError`, and `saveNotice` props.
141
+
142
+ 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.
143
+
144
+ `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`.
145
+
146
+ 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.
147
+
148
+ ## Tournament and event prices
149
+
150
+ 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.
151
+
152
+ `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.