@dcrackel/hematournamentui 1.0.31 → 1.0.35

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 (36) hide show
  1. package/dist/HemaTouranmentUI-lib.es.js +5867 -5811
  2. package/dist/HemaTouranmentUI-lib.umd.js +24 -24
  3. package/dist/style.css +1 -1
  4. package/package.json +29 -29
  5. package/src/index.js +12 -12
  6. package/src/stories/Atoms/Input/BaseInput.vue +10 -6
  7. package/src/stories/Molecules/{Button → Buttons/BaseButton}/BaseButton.stories.js +1 -1
  8. package/src/stories/Molecules/{Button → Buttons/BaseButton}/BaseButton.vue +3 -3
  9. package/src/stories/Molecules/Cards/Detail/TournamentCardDetail.vue +1 -1
  10. package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.stories.js +0 -10
  11. package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.vue +2 -2
  12. package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +2 -2
  13. package/src/stories/Molecules/{Modal/Modal.stories.js → Modals/BaseModal/BaseModal.stories.js} +3 -3
  14. package/src/stories/Organisms/{TournamentCard → Cards/TournamentCard}/TournamentCard.stories.js +1 -1
  15. package/src/stories/Organisms/{TournamentCard → Cards/TournamentCard}/TournamentCard.vue +2 -2
  16. package/src/stories/Organisms/{Grid → Grids}/GridContainer.stories.js +1 -1
  17. package/src/stories/Organisms/{Grid → Grids}/GridContainer.vue +1 -1
  18. package/src/stories/Organisms/{AddressAutocomplete → Inputs/AddressAutocomplete}/AddressAutocomplete.stories.js +1 -1
  19. package/src/stories/Organisms/{DatePicker → Inputs/DatePicker}/DatePicker.stories.js +1 -1
  20. package/src/stories/Organisms/{DatePicker → Inputs/DatePicker}/DatePicker.vue +14 -14
  21. package/src/stories/Organisms/{DropDown → Inputs/DropDown}/DropDownMenu.stories.js +1 -1
  22. package/src/stories/Organisms/{DropDown → Inputs/DropDown}/DropDownMenu.vue +1 -1
  23. package/src/stories/Organisms/{ImageCropper → Inputs/ImageCropper}/ImageCropper.stories.js +1 -1
  24. package/src/stories/Organisms/{TextBoxEditor → Inputs/TextBoxEditor}/TextBoxEditor.stories.js +1 -1
  25. package/src/stories/Organisms/{TextBoxEditor → Inputs/TextBoxEditor}/TextBoxEditor.vue +1 -1
  26. package/src/stories/Templates/{Menu → Menus}/Admin/AdminLeftMenu.vue +1 -1
  27. package/src/stories/Templates/{Forms/AddTournamentPageOne → TournamentManagement/AddTournament/PageOne}/AddTournamentPageOne.stories.js +5 -8
  28. package/src/stories/Templates/TournamentManagement/AddTournament/PageOne/AddTournamentPageOne.vue +156 -0
  29. package/src/stories/Templates/{Forms/AddTournamentPageTwo → TournamentManagement/AddTournament/PageTwo}/AddTournamentPageTwo.stories.js +6 -6
  30. package/src/stories/Templates/{Forms/AddTournamentPageTwo → TournamentManagement/AddTournament/PageTwo}/AddTournamentPageTwo.vue +14 -12
  31. package/src/stories/Templates/Forms/AddTournamentPageOne/AddTournamentPageOne.vue +0 -140
  32. /package/src/stories/Molecules/{Button → Buttons/BaseButton}/BaseButton.test.js +0 -0
  33. /package/src/stories/Molecules/{Modal/Modal.vue → Modals/BaseModal/BaseModal.vue} +0 -0
  34. /package/src/stories/Organisms/{AddressAutocomplete → Inputs/AddressAutocomplete}/AddressAutocomplete.vue +0 -0
  35. /package/src/stories/Organisms/{ImageCropper → Inputs/ImageCropper}/ImageCropper.vue +0 -0
  36. /package/src/stories/Templates/{Menu → Menus}/Admin/AdminLeftMenu.stories.js +0 -0
@@ -0,0 +1,156 @@
1
+ <template>
2
+ <div class="border border-dropdownSelect rounded-lg p-9 bg-neutral">
3
+ <div class="w-full flex flex-row justify-center">
4
+ <BaseText :color="'quaternary'" :size="'sm'" :text="'Step 1 out of 2'" :weight="'normal'"
5
+ data-testid="text-step"/>
6
+ </div>
7
+ <div class="w-full flex flex-row justify-center my-4">
8
+ <BaseText :color="'primaryHighlight'" :size="'2xl'" :text="'Add Tournament'" :weight="'normal'"
9
+ data-testid="text-add-tournament"/>
10
+ </div>
11
+ <div class="w-full flex flex-row justify-center my-4">
12
+ <ImageCropper :personID="1"/>
13
+ </div>
14
+
15
+ <div class="w-full flex flex-row justify-center">
16
+ <section class="w-96">
17
+ <div class="flex flex-col mb-3">
18
+ <BaseText :invalid="validation.name" :size="'sm'" :text="'Tournament Name'" :weight="'normal'"
19
+ class="mb-1" color="primary" data-testid="text-tournament-name"/>
20
+ <BaseInput :invalid="validation.name" :value="tournament.name" placeholder="Enter Tournament Name"
21
+ type="formInput" @update:value="value => tournament.name = value"/>
22
+ </div>
23
+ <div class="flex flex-col mb-3">
24
+ <BaseText :color="'primaryHighlight'" :invalid="validation.address" :size="'sm'" :text="'Address'"
25
+ :weight="'normal'" class="mb-1" data-testid="text-address"/>
26
+ <AddressAutocomplete :address="tournament.address" :invalid="validation.address"
27
+ @update:address="handleAddressUpdate"/>
28
+ </div>
29
+ <div class="flex flex-row mb-3">
30
+ <div class="w-3/4 mr-1">
31
+ <BaseText :color="'primaryHighlight'" :invalid="validation.startDate" :size="'sm'" :text="'Start Date'"
32
+ :weight="'normal'" class="mb-1" data-testid="text-start-date"/>
33
+ <DatePicker :invalid="validation.startDate" :setDate="tournament.startDate"
34
+ @update:selectedDate="handleDateUpdate"/>
35
+ </div>
36
+ <div class="w-1/4 ml-1">
37
+ <BaseText :color="'primaryHighlight'" :invalid="validation.totalDays" :size="'sm'" :text="'Total Days'"
38
+ :weight="'normal'" class="mb-1" data-testid="text-total-days"/>
39
+ <BaseInput :addBorder="true" :invalid="validation.totalDays" :placeholder="`${1}`" :value="`${tournament.totalDays}`"/>
40
+ </div>
41
+ </div>
42
+ <div class="flex flex-col mb-3">
43
+ <BaseText :color="'primaryHighlight'" :invalid="validation.description" :size="'sm'" :text="'Description'"
44
+ :weight="'normal'" class="mb-1" data-testid="text-description"/>
45
+ <TextBoxEditor :invalid="validation.description" @update:editorContent="handleEditorUpdate"/>
46
+ </div>
47
+ <div class="flex flex-col pb-4">
48
+ <BaseText :color="'primaryHighlight'" :invalid="validation.visibility" :size="'sm'"
49
+ :text="'Tournament Visibility'" :weight="'normal'" class="mb-2" data-testid="text-visibility"/>
50
+ <BaseRadioGroup :invalid="validation.visibility" :items="visibilityItems"
51
+ @update:value="value => tournament.visibility = value"/>
52
+ </div>
53
+ <div>
54
+ <BaseButton class="w-full" color="neutral" label="Continue" size="sm" type="secondary"
55
+ @click="handleSubmit()"/>
56
+ </div>
57
+ </section>
58
+ </div>
59
+ </div>
60
+ </template>
61
+
62
+ <script>
63
+ import BaseText from "../../../../Atoms/Text/BaseText.vue";
64
+ import ImageCropper from "../../../../Organisms/Inputs/ImageCropper/ImageCropper.vue";
65
+ import BaseInput from "../../../../Atoms/Input/BaseInput.vue";
66
+ import AddressAutocomplete from "../../../../Organisms/Inputs/AddressAutocomplete/AddressAutocomplete.vue";
67
+ import DatePicker from "../../../../Organisms/Inputs/DatePicker/DatePicker.vue";
68
+ import TextBoxEditor from "../../../../Organisms/Inputs/TextBoxEditor/TextBoxEditor.vue";
69
+ import BaseRadioGroup from "../../../../Atoms/RadioGroup/BaseRadioGroup.vue";
70
+ import BaseButton from "../../../../Molecules/Buttons/BaseButton/BaseButton.vue";
71
+
72
+ export default {
73
+ name: 'AddTournamentPageOne',
74
+ components: {
75
+ BaseText,
76
+ BaseInput,
77
+ ImageCropper,
78
+ AddressAutocomplete,
79
+ DatePicker,
80
+ TextBoxEditor,
81
+ BaseRadioGroup,
82
+ BaseButton
83
+ },
84
+ props: {},
85
+ data() {
86
+ return {
87
+ tournament: {
88
+ name: '',
89
+ imageLink: '',
90
+ address: '',
91
+ coordinates: '',
92
+ startDate: '',
93
+ totalDays: 1,
94
+ description: '',
95
+ visibility: '',
96
+ externalLinks: Array
97
+ },
98
+ validation: {
99
+ name: false,
100
+ imageLink: false,
101
+ address: false,
102
+ coordinates: false,
103
+ startDate: false,
104
+ totalDays: false,
105
+ description: false,
106
+ visibility: false
107
+ },
108
+ visibilityItems: [
109
+ {label: 'Open', value: 'open', description: 'Viewable To Everyone'},
110
+ {label: 'Club', value: 'club', description: 'Viewable Only to Members of Your Club'},
111
+ {label: 'Private', value: 'private', description: 'Only Viewable by you'},
112
+ ],
113
+ }
114
+ },
115
+ methods: {
116
+ handleSubmit() {
117
+ this.setAllValidationStates(false);
118
+
119
+ if (this.tournament.name === '') this.validation.name = true;
120
+ if (this.tournament.coordinates === '') this.validation.address = true;
121
+ if (this.tournament.startDate === '') this.validation.startDate = true;
122
+ if (this.tournament.totalDays === '') this.validation.totalDays = true;
123
+ if (this.tournament.description === '') this.validation.description = true;
124
+ if (this.tournament.visibility === '') this.validation.visibility = true;
125
+
126
+ if (!this.areAnyFieldsAreLeftInvalid) {
127
+ this.$emit('update:tournament', this.tournament);
128
+ this.$emit('update:step', 2);
129
+ }
130
+ },
131
+ setAllValidationStates(state) {
132
+ Object.keys(this.validation).forEach(key => {
133
+ this.validation[key] = state;
134
+ });
135
+ },
136
+ handleAddressUpdate(updatedAddress) {
137
+ this.tournament.address = updatedAddress.address;
138
+ this.tournament.coordinates = updatedAddress.coordinates;
139
+ },
140
+ handleDateUpdate(newDate) {
141
+ this.tournament.startDate = newDate;
142
+ console.log("New Date")
143
+ console.log(newDate)
144
+ console.log(DatePicker.props.invalid)
145
+ },
146
+ handleEditorUpdate(newContent) {
147
+ this.tournament.description = newContent;
148
+ }
149
+ },
150
+ computed: {
151
+ areAnyFieldsAreLeftInvalid() {
152
+ return Object.values(this.validation).every(v => v);
153
+ }
154
+ }
155
+ }
156
+ </script>
@@ -1,21 +1,21 @@
1
1
  import AddTournamentPageTwo from './AddTournamentPageTwo.vue';
2
+
2
3
  export default {
3
- title: 'Templates/Forms/AddTournamentForm/PageTwo',
4
+ title: 'Templates/TournamentManagement/AddTournament/PageTwo',
4
5
  component: AddTournamentPageTwo,
5
6
  tags: ['autodocs'],
6
7
  argTypes: {}
7
8
  };
8
9
 
9
10
  const Template = args => ({
10
- components: { AddTournamentPageTwo },
11
+ components: {AddTournamentPageTwo},
11
12
  setup() {
12
13
  return {
13
- args: {
14
- }
14
+ args: {}
15
15
  };
16
16
  },
17
- methods: {
18
- }
17
+ methods: {}
18
+
19
19
  });
20
20
 
21
21
  export const Default = {
@@ -28,7 +28,6 @@
28
28
  :weight="'normal'" data-testid="text-need-help"/>
29
29
  </div>
30
30
  <div class="flex flex-row justify-center">
31
- <!-- Yes needs to lead to another page that asks "Do you want Ferrotas to handle registration?" -->
32
31
  <BaseButton class="w-1/2 mr-1" color="neutral" label="Yes" selected=selected size="sm" type="square"
33
32
  @click="handleHosting()"/>
34
33
  <BaseButton class="w-1/2 ml-1" color="neutral" label="No" size="sm" type="square" @click="toggleLinkInput()"/>
@@ -37,10 +36,12 @@
37
36
  <BaseText :color="'quaternary'" :size="'sm'" :text="'Add links to external sites such as Facebook events'"
38
37
  :weight="'normal'" class="mb-1" data-testid="text-need-help"/>
39
38
  <div v-for="(newLink, index) in localTournament.externalLinks" :key="index" class="flex flex-row w-full">
40
- <BaseInput :value="newLink.url" @input="updateLink(index, $event)" :invalid="!newLink.valid" class="pb-2 w-full"
41
- icon-name="fa-dash" placeholder="https://link1.com/yourevent"
42
- @update:iconClick="removeLink(newLink.url)" />
43
- <BaseIcon color="primary" icon-name="fa-circle-xmark" size="xl" iconStyle="fa-solid" data-testid="base-icon" class="mt-1.5 -ml-7 hover:text-primaryHighlight"/>
39
+ <BaseInput :invalid="!newLink.valid" :value="newLink.url" class="pb-2 w-full"
40
+ icon-name="fa-dash"
41
+ placeholder="https://link1.com/yourevent" @input="updateLink(index, $event)"/>
42
+ <BaseIcon class="mt-1.5 -ml-7 hover:text-primaryHighlight" color="primary" data-testid="base-icon"
43
+ icon-name="fa-circle-xmark" iconStyle="fa-solid"
44
+ size="xl" @click="removeLink(newLink.url)"/>
44
45
  </div>
45
46
  <BaseButton class="w-full mt-3" color="neutral" label="Add New Link" size="sm" type="primary"
46
47
  @click="addExternalLink()"/>
@@ -56,10 +57,10 @@
56
57
 
57
58
 
58
59
  <script>
59
- import BaseText from "../../../Atoms/Text/BaseText.vue";
60
- import BaseButton from "../../../Molecules/Button/BaseButton.vue";
61
- import BaseInput from "../../../Atoms/Input/BaseInput.vue";
62
- import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
60
+ import BaseText from "../../../../Atoms/Text/BaseText.vue";
61
+ import BaseButton from "../../../../Molecules/Buttons/BaseButton/BaseButton.vue";
62
+ import BaseInput from "../../../../Atoms/Input/BaseInput.vue";
63
+ import BaseIcon from "../../../../Atoms/Icon/BaseIcon.vue";
63
64
 
64
65
  export default {
65
66
  name: 'AddTournamentPageTwo',
@@ -84,7 +85,7 @@ export default {
84
85
  }
85
86
 
86
87
  if (this.localTournament.externalLinks.length === 0) {
87
- this.localTournament.externalLinks.push({ url: "", valid: true });
88
+ this.localTournament.externalLinks.push({url: "", valid: true});
88
89
  }
89
90
  },
90
91
  methods: {
@@ -100,7 +101,7 @@ export default {
100
101
  this.linkInputVisible = !this.linkInputVisible;
101
102
  },
102
103
  addExternalLink() {
103
- this.localTournament.externalLinks.push({ url: '', valid: true });
104
+ this.localTournament.externalLinks.push({url: '', valid: true});
104
105
  },
105
106
  removeLink(urlToRemove) {
106
107
  this.localTournament.externalLinks = this.localTournament.externalLinks.filter(link => link.url !== urlToRemove);
@@ -113,10 +114,11 @@ export default {
113
114
  }
114
115
  },
115
116
  isValidUrl(url) {
116
- const regex = /^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([\/\w .-]*)*\/?$/;
117
+ const regex = /^(https?:\/\/)?([\da-z.-]+)\.([\da-z.]+)\.([\/\w\W]+)\/?$/;
117
118
  return regex.test(url);
118
119
  },
119
120
  areAllLinksValid() {
121
+ this.localTournament.externalLinks.forEach(item => item.valid = this.isValidUrl(item.url))
120
122
  return this.localTournament.externalLinks.every(link => link.valid);
121
123
  },
122
124
  },
@@ -1,140 +0,0 @@
1
- <template>
2
- <div class="border border-dropdownSelect rounded-lg p-9 bg-neutral">
3
- <div class="w-full flex flex-row justify-center">
4
- <BaseText data-testid="text-step" :color="'quaternary'" :size="'sm'" :text="'Step 1 out of 2'" :weight="'normal'" />
5
- </div>
6
- <div class="w-full flex flex-row justify-center my-4">
7
- <BaseText data-testid="text-add-tournamnet" :color="'primaryHighlight'" :size="'2xl'" :text="'Add Tournament'" :weight="'normal'" />
8
- </div>
9
- <div class="w-full flex flex-row justify-center my-4">
10
- <ImageCropper :personID="1" />
11
- </div>
12
-
13
- <div class="w-full flex flex-row justify-center">
14
- <section class="w-96">
15
- <div class="flex flex-col mb-3">
16
- <BaseText data-testid="text-tournament-name" color="primary" :size="'sm'" :text="'Tournament Name'" :weight="'normal'" class="mb-1" :invalid="validation.name" />
17
- <BaseInput placeholder="Enter Tournament Name" type="formInput" :value="tournament.name" :invalid="validation.name" @update:value="value => tournament.name = value"/>
18
- </div>
19
- <div class="flex flex-col mb-3">
20
- <BaseText data-testid="text-address" :color="'primaryHighlight'" :size="'sm'" :text="'Address'" :weight="'normal'" class="mb-1" :invalid="validation.address" />
21
- <AddressAutocomplete :address="tournament.address" :invalid="validation.address" @update:address="handleAddressUpdate" />
22
- </div>
23
- <div class="flex flex-row mb-3">
24
- <div class="w-3/4 mr-1">
25
- <BaseText data-testid="text-start-date" :color="'primaryHighlight'" :size="'sm'" :text="'Start Date'" :weight="'normal'" class="mb-1" :invalid="validation.startDate" />
26
- <DatePicker :setDate="tournament.startDate" @update:selectedDate="handleDateUpdate" />
27
- </div>
28
- <div class="w-1/4 ml-1">
29
- <BaseText data-testid="text-total-days" :color="'primaryHighlight'" :size="'sm'" :text="'Total Days'" :weight="'normal'" class="mb-1" :invalid="validation.totalDays" />
30
- <BaseInput :placeholder="`${1}`" type="formInput" :value="`${tournament.totalDays}`" :invalid="validation.totalDays" />
31
- </div>
32
- </div>
33
- <div class="flex flex-col mb-3">
34
- <BaseText data-testid="text-description" :color="'primaryHighlight'" :size="'sm'" :text="'Description'" :weight="'normal'" class="mb-1" :invalid="validation.description" />
35
- <TextBoxEditor :invalid="validation.description" @update:editorContent="handleEditorUpdate" />
36
- </div>
37
- <div class="flex flex-col pb-4">
38
- <BaseText data-testid="text-visibility" :color="'primaryHighlight'" :size="'sm'" :text="'Tournament Visibility'" :weight="'normal'" class="mb-2" :invalid="validation.visibility" />
39
- <BaseRadioGroup :items="visibilityItems" :invalid="validation.visibility" @update:value="value => tournament.visibility = value" />
40
- </div>
41
- <div>
42
- <BaseButton label="Continue" type="secondary" color="neutral" size="sm" @click="handleSubmit()" class="w-full" />
43
- </div>
44
- </section>
45
- </div>
46
- </div>
47
- </template>
48
-
49
- <script>
50
- import BaseText from "../../../Atoms/Text/BaseText.vue";
51
- import ImageCropper from "../../../Organisms/ImageCropper/ImageCropper.vue";
52
- import BaseInput from "../../../Atoms/Input/BaseInput.vue";
53
- import AddressAutocomplete from "../../../Organisms/AddressAutocomplete/AddressAutocomplete.vue";
54
- import DatePicker from "../../../Organisms/DatePicker/DatePicker.vue";
55
- import TextBoxEditor from "../../../Organisms/TextBoxEditor/TextBoxEditor.vue";
56
- import BaseRadioGroup from "../../../Atoms/RadioGroup/BaseRadioGroup.vue";
57
- import BaseButton from "../../../Molecules/Button/BaseButton.vue";
58
-
59
- export default {
60
- name: 'AddTournamentPageOne',
61
- components: {
62
- BaseText,
63
- BaseInput,
64
- ImageCropper,
65
- AddressAutocomplete,
66
- DatePicker,
67
- TextBoxEditor,
68
- BaseRadioGroup,
69
- BaseButton
70
- },
71
- props: {},
72
- data() {
73
- return {
74
- tournament: {
75
- name: '',
76
- imageLink: '',
77
- address: '',
78
- coordinates: '',
79
- startDate: '',
80
- totalDays: 1,
81
- description: '',
82
- visibility: '',
83
- externalLinks: Array
84
- },
85
- validation: {
86
- name: false,
87
- imageLink: false,
88
- address: false,
89
- coordinates: false,
90
- startDate: false,
91
- totalDays: false,
92
- description: false,
93
- visibility: false
94
- },
95
- visibilityItems: [
96
- { label: 'Open', value: 'open', description: 'Viewable To Everyone' },
97
- { label: 'Club', value: 'club', description: 'Viewable Only to Members of Your Club'},
98
- { label: 'Private', value: 'private', description: 'Only Viewable by you' },
99
- ],
100
- }
101
- },
102
- methods: {
103
- handleSubmit() {
104
- this.setAllValidationStates(false);
105
-
106
- if (this.tournament.name === '') this.validation.name = true;
107
- if (this.tournament.coordinates === '') this.validation.address = true;
108
- if (this.tournament.startDate === '') this.validation.startDate = true;
109
- if (this.tournament.totalDays === '') this.validation.totalDays = true;
110
- if (this.tournament.description === '') this.validation.description = true;
111
- if (this.tournament.visibility === '') this.validation.visibility = true;
112
-
113
- if (!this.areAnyFieldsAreLeftInvalid) {
114
- this.$emit('update:tournament', this.tournament);
115
- this.$emit('update:step', 2);
116
- }
117
- },
118
- setAllValidationStates(state) {
119
- Object.keys(this.validation).forEach(key => {
120
- this.validation[key] = state;
121
- });
122
- },
123
- handleAddressUpdate(updatedAddress) {
124
- this.tournament.address = updatedAddress.address;
125
- this.tournament.coordinates = updatedAddress.coordinates;
126
- },
127
- handleDateUpdate(newDate) {
128
- this.tournament.startDate = newDate;
129
- },
130
- handleEditorUpdate(newContent) {
131
- this.tournament.description = newContent;
132
- }
133
- },
134
- computed: {
135
- areAnyFieldsAreLeftInvalid() {
136
- return Object.values(this.validation).every(v => v);
137
- }
138
- }
139
- }
140
- </script>