@dcrackel/hematournamentui 1.0.708 → 1.0.709
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 +132 -106
- package/dist/HemaTournamentUI-lib.es.js +6243 -6003
- package/dist/HemaTournamentUI-lib.umd.js +25 -25
- package/dist/hematournamentui-tailwind.css +13 -6
- package/package.json +1 -1
- package/src/stories/Atoms/Input/BaseInput.test.js +97 -85
- package/src/stories/Atoms/Input/BaseInput.vue +149 -150
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +31 -20
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.test.js +109 -0
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +192 -133
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +14 -0
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.test.js +39 -0
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.vue +13 -3
- package/src/stories/Templates/PersonManagement/Basic/BasicEdit.vue +170 -172
- package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +156 -103
- package/src/stories/Templates/PersonManagement/PersonManagement.test.js +329 -0
- package/src/stories/Templates/PersonManagement/PersonManagement.vue +329 -213
- package/src/stories/Templates/PersonManagement/PersonManagementDraft.js +42 -0
- package/src/stories/Util/Validations/PersonManagementValidations.js +45 -29
package/README.md
CHANGED
|
@@ -1,106 +1,132 @@
|
|
|
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
|
-
|
|
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
|
-
|
|
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.
|