@dcrackel/meyersquaredui 1.0.104 → 1.0.106

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcrackel/meyersquaredui",
3
3
  "private": false,
4
- "version": "1.0.104",
4
+ "version": "1.0.106",
5
5
  "type": "module",
6
6
  "main": "dist/meyersquaredui.cjs.js",
7
7
  "module": "dist/meyersquaredui.esm.js",
package/src/index.js CHANGED
@@ -16,6 +16,7 @@ export { default as ScrollNav } from './stories/Organisms/Headers/ScrollNav/Scro
16
16
  export { default as TournamentDetailsBanner } from './stories/Organisms/HeroBanners/TournamentDetails/TournamentDetailsBanner.vue'
17
17
  export { default as TournamentBanner } from './stories/Organisms/HeroBanners/Tournaments/TournamentBanner.vue'
18
18
  export { default as ContactUsForm } from './stories/Organisms/Forms/ContactUsForm/ContactUsForm.vue'
19
+ export { default as GridTabs } from './stories/Organisms/GridTabs/GridTabs.vue'
19
20
 
20
21
 
21
22
  export { default as ArticleCard } from './stories/Organisms/Cards/ArticleCard/ArticleCard.vue'
@@ -0,0 +1,248 @@
1
+ const getPoolsWithPeople =
2
+ {
3
+ "message": "Pools retrieved",
4
+ "pools": [
5
+ {
6
+ "PoolId": 180,
7
+ "Name": "Pool 1",
8
+ "RingName": "Ring 1",
9
+ "Flight": 1,
10
+ "PoolType": "pool",
11
+ "EventId": 26,
12
+ "Status": "planning",
13
+ "Updated": "2024-10-16T13:38:51.000Z",
14
+ "EventPersons": [
15
+ {
16
+ "EventId": 26,
17
+ "PoolPosition": 4,
18
+ "DEPosition": null,
19
+ "Status": "Absent",
20
+ "Person": {
21
+ "PersonId": 79,
22
+ "DisplayName": "Tom Testerlou",
23
+ "ClubId": 10,
24
+ "ShowData": true,
25
+ "Images": [],
26
+ "Club": {
27
+ "Name": "Columbus United Fencing Club"
28
+ },
29
+ "HEMARatings": [],
30
+ "M2Ratings": []
31
+ }
32
+ },
33
+ {
34
+ "EventId": 26,
35
+ "PoolPosition": 5,
36
+ "DEPosition": null,
37
+ "Status": "Absent",
38
+ "Person": {
39
+ "PersonId": 101,
40
+ "DisplayName": "Team Bestest",
41
+ "ClubId": 10,
42
+ "ShowData": true,
43
+ "Images": [],
44
+ "Club": {
45
+ "Name": "Columbus United Fencing Club"
46
+ },
47
+ "HEMARatings": [],
48
+ "M2Ratings": []
49
+ }
50
+ },
51
+ {
52
+ "EventId": 26,
53
+ "PoolPosition": 1,
54
+ "DEPosition": null,
55
+ "Status": "Absent",
56
+ "Person": {
57
+ "PersonId": 49,
58
+ "DisplayName": "Jack Seyler",
59
+ "ClubId": 43,
60
+ "ShowData": true,
61
+ "Images": [],
62
+ "Club": {
63
+ "Name": "Ars Gladii"
64
+ },
65
+ "HEMARatings": [
66
+ {
67
+ "Rating": 1282.1
68
+ }
69
+ ],
70
+ "M2Ratings": []
71
+ }
72
+ },
73
+ {
74
+ "EventId": 26,
75
+ "PoolPosition": 8,
76
+ "DEPosition": null,
77
+ "Status": "Absent",
78
+ "Person": {
79
+ "PersonId": 18,
80
+ "DisplayName": "Sean Hanson",
81
+ "ClubId": 3,
82
+ "ShowData": true,
83
+ "Images": [],
84
+ "Club": {
85
+ "Name": "Sword & Blade of Callie"
86
+ },
87
+ "HEMARatings": [],
88
+ "M2Ratings": []
89
+ }
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ "PoolId": 181,
95
+ "Name": "Pool 2",
96
+ "RingName": "Ring 2",
97
+ "Flight": 1,
98
+ "PoolType": "pool",
99
+ "EventId": 26,
100
+ "Status": "planning",
101
+ "Updated": "2024-10-16T13:38:51.000Z",
102
+ "EventPersons": [
103
+ {
104
+ "EventId": 26,
105
+ "PoolPosition": 6,
106
+ "DEPosition": null,
107
+ "Status": "Absent",
108
+ "Person": {
109
+ "PersonId": 9,
110
+ "DisplayName": "Sean McCoy",
111
+ "ClubId": 7,
112
+ "ShowData": true,
113
+ "Images": [],
114
+ "Club": {
115
+ "Name": "Hilt & Heart"
116
+ },
117
+ "HEMARatings": [],
118
+ "M2Ratings": []
119
+ }
120
+ },
121
+ {
122
+ "EventId": 26,
123
+ "PoolPosition": 3,
124
+ "DEPosition": null,
125
+ "Status": "Absent",
126
+ "Person": {
127
+ "PersonId": 89,
128
+ "DisplayName": "Jesse May",
129
+ "ClubId": 18,
130
+ "ShowData": true,
131
+ "Images": [],
132
+ "Club": {
133
+ "Name": "Hilt and Helm Pittsburgh Fencing Club"
134
+ },
135
+ "HEMARatings": [
136
+ {
137
+ "Rating": 1001.1
138
+ }
139
+ ],
140
+ "M2Ratings": []
141
+ }
142
+ },
143
+ {
144
+ "EventId": 26,
145
+ "PoolPosition": 7,
146
+ "DEPosition": null,
147
+ "Status": "Absent",
148
+ "Person": {
149
+ "PersonId": 111,
150
+ "DisplayName": "Aaron Senteney",
151
+ "ClubId": 38,
152
+ "ShowData": true,
153
+ "Images": [],
154
+ "Club": {
155
+ "Name": "Steelhead Western Martial Arts"
156
+ },
157
+ "HEMARatings": [],
158
+ "M2Ratings": []
159
+ }
160
+ },
161
+ {
162
+ "EventId": 26,
163
+ "PoolPosition": 2,
164
+ "DEPosition": null,
165
+ "Status": "Absent",
166
+ "Person": {
167
+ "PersonId": 37,
168
+ "DisplayName": "Brian Thiessen",
169
+ "ClubId": 38,
170
+ "ShowData": true,
171
+ "Images": [],
172
+ "Club": {
173
+ "Name": "Steelhead Western Martial Arts"
174
+ },
175
+ "HEMARatings": [
176
+ {
177
+ "Rating": 1114.2
178
+ }
179
+ ],
180
+ "M2Ratings": []
181
+ }
182
+ }
183
+ ]
184
+ }
185
+ ],
186
+ "eventRules": [
187
+ {
188
+ "RuleId": 1,
189
+ "RuleName": "PoolTime",
190
+ "RuleValue": "120",
191
+ "Context": "pool"
192
+ },
193
+ {
194
+ "RuleId": 2,
195
+ "RuleName": "PoolMaxPoints",
196
+ "RuleValue": "7",
197
+ "Context": "pool"
198
+ },
199
+ {
200
+ "RuleId": 3,
201
+ "RuleName": "DETime",
202
+ "RuleValue": "120",
203
+ "Context": "de"
204
+ },
205
+ {
206
+ "RuleId": 4,
207
+ "RuleName": "DEMaxPoints",
208
+ "RuleValue": "7",
209
+ "Context": "de"
210
+ },
211
+ {
212
+ "RuleId": 5,
213
+ "RuleName": "DE3rdFenceOff",
214
+ "RuleValue": "false",
215
+ "Context": "de"
216
+ },
217
+ {
218
+ "RuleId": 9,
219
+ "RuleName": "DEPromotionOrder",
220
+ "RuleValue": "Win Percent,Win Count,Indicator,Points Scored",
221
+ "Context": "de"
222
+ },
223
+ {
224
+ "RuleId": 10,
225
+ "RuleName": "DENumOfPromotion",
226
+ "RuleValue": "100%",
227
+ "Context": "de"
228
+ },
229
+ {
230
+ "RuleId": 11,
231
+ "RuleName": "PoolSeeding",
232
+ "RuleValue": "HR - Hema Rating",
233
+ "Context": "pool"
234
+ },
235
+ {
236
+ "RuleId": 14,
237
+ "RuleName": "CutOffNumber",
238
+ "RuleValue": "64",
239
+ "Context": "event"
240
+ }
241
+ ],
242
+ "hostingClubColors": {
243
+ "Color1": "navy",
244
+ "Color2": "rose"
245
+ }
246
+ };
247
+
248
+ export default getPoolsWithPeople;
@@ -8,8 +8,8 @@
8
8
  @mouseout="handleMouseOut"
9
9
  @click="handlePhaseClick(index)"
10
10
  :class="{
11
- 'cursor-pointer': index <= currentPhase,
12
- 'cursor-not-allowed': index > currentPhase,
11
+ 'cursor-pointer': index < currentPhase,
12
+ 'cursor-default': index >= currentPhase,
13
13
  }"
14
14
  >
15
15
  <!-- Clickable Icon and Label -->
@@ -86,7 +86,7 @@ export default {
86
86
  },
87
87
  data() {
88
88
  return {
89
- hoveredPhase: null, // Variable to store which phase is hovered over
89
+ hoveredPhase: null,
90
90
  };
91
91
  },
92
92
  methods: {
@@ -100,7 +100,6 @@ export default {
100
100
  this.hoveredPhase = null;
101
101
  },
102
102
  handlePhaseClick(index) {
103
- // Emit the clicked phase to the parent only if the phase is active or previous
104
103
  if (index <= this.currentPhase) {
105
104
  this.$emit('phase-clicked', index);
106
105
  }
@@ -2,7 +2,7 @@
2
2
  <section v-if="!isLoading" class="flex items-center p-4 hover:cursor-pointer border-b" @click="handleCardClicked">
3
3
  <img :src="portrait" alt="Fencer Portrait" class="w-[50px] h-[50px] md:w-[70px] md:h-[70px] rounded-full object-cover z-1 flex-shrink-0 mr-4" />
4
4
  <div class="rounded-full bg-accent h-5 w-5 absolute flex justify-center ml-9 mt-9 md:ml-12 md:mt-12">
5
- <BaseText tag="p" size="sm" weight="bold" class="text-white">{{ index + 1 }}</BaseText>
5
+ <BaseText tag="p" size="sm" weight="bold" class="text-white">{{ Position }}</BaseText>
6
6
  </div>
7
7
  <div class="flex flex-col justify-center flex-grow">
8
8
  <section class="hidden md:flex flex-col">
@@ -100,6 +100,9 @@ export default {
100
100
  },
101
101
  HEMARating() {
102
102
  return this.data.HEMARatings[0] ? this.data.HEMARatings[0].Rating : '0';
103
+ },
104
+ Position() {
105
+ return this.data.PoolPosition ? this.data.PoolPosition : this.index + 1;
103
106
  }
104
107
  },
105
108
  methods: {
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <section :class="topBoxClass">
3
- <section>
3
+ <section class="w-full">
4
4
  <div :class="topClasses" class="flex flex-col">
5
- <div :class="headerClasses">
5
+ <div v-if="title" :class="headerClasses">
6
6
  <BaseText color="primary" size="xl" tag="h3" weight="bold">{{ title }}</BaseText>
7
7
  </div>
8
8
  <div :class="gridClasses">
@@ -45,8 +45,7 @@ export default {
45
45
  },
46
46
  props: {
47
47
  title: {
48
- type: String,
49
- default: 'Section Title',
48
+ type: String
50
49
  },
51
50
  moreButtonLabel: {
52
51
  type: String,
@@ -90,8 +89,9 @@ export default {
90
89
  return "w-screen overflow-x-auto";
91
90
  }
92
91
 
93
- // For larger screens, limit the width to 1200px
94
- return "max-w-[1200px] w-full flex justify-center mx-auto mt-8";
92
+ let retClasses = "max-w-[1200px] w-full flex justify-center mx-auto"
93
+ this.title ? retClasses = `${retClasses} mt-8` : retClasses = `${retClasses}`;
94
+ return retClasses;
95
95
  },
96
96
  headerClasses() {
97
97
  let retClasses = "w-full flex py-4 md:pb-10 ml-2 md:ml-0 mb-4";
@@ -0,0 +1,24 @@
1
+ import TabGrid from './GridTabs.vue';
2
+ import mockGetPoolsWithPeople from '../../../mocks/getPoolsWithPeople.js';
3
+
4
+ export default {
5
+ title: 'Organisms/GridTabs/GridTabs',
6
+ component: TabGrid,
7
+ argTypes: {
8
+ pools: { control: 'array' }
9
+ }
10
+ };
11
+
12
+ // Template for the story
13
+ const Template = (args) => ({
14
+ components: { TabGrid },
15
+ setup() {
16
+ return { args };
17
+ },
18
+ template: '<TabGrid v-bind="args" />'
19
+ });
20
+
21
+ export const Default = Template.bind({});
22
+ Default.args = {
23
+ pools: mockGetPoolsWithPeople.pools
24
+ };
@@ -0,0 +1,87 @@
1
+ <template>
2
+ <div class="w-full rounded-lg">
3
+ <!-- Grid Title -->
4
+ <div class="max-w-[1200px] w-full flex pt-6 ml-4 mb-6">
5
+ <BaseText color="primary" size="xl" tag="h3" weight="bold">{{ `Fencers in ${pools[selectedTab].Name}` }}</BaseText>
6
+ </div>
7
+
8
+ <!-- Tabs for Pools -->
9
+ <div class="max-w-[1200px] w-full flex mx-auto pt-4 pb-4 pl-4 bg-white rounded-tr-lg rounded-tl-lg">
10
+ <span v-for="(pool, index) in pools" :key="pool.PoolId">
11
+ <BaseText
12
+ color="primary"
13
+ size="md"
14
+ tag="p"
15
+ weight=""
16
+ title=""
17
+ class="mr-10 border-b-2 hover:border-accent pb-2 duration-300 ease-in-out"
18
+ :class="selectedTab === index ? 'border-accent' : 'border-white'"
19
+ @click="selectTab(index)"
20
+ >
21
+ {{ pool.Name }}
22
+ </BaseText>
23
+ </span>
24
+ </div>
25
+
26
+ <!-- Grid Layout -->
27
+ <GridLayout
28
+ :cardComponent="FencerListCard"
29
+ :items="mappedPersons"
30
+ :maxColumns="1"
31
+ :isLoading="false"
32
+ :whiteStyle="true"
33
+ class="-mt-1"
34
+ />
35
+ </div>
36
+ </template>
37
+
38
+ <script>
39
+ import GridLayout from "../GridLayout/GridLayout.vue";
40
+ import FencerListCard from "../Cards/FencerListCard/FencerListCard.vue";
41
+ import BaseButton from "../../Atoms/BaseButton/BaseButton.vue";
42
+ import BaseText from "../../Atoms/BaseText/BaseText.vue";
43
+
44
+ export default {
45
+ name: 'GridTabs',
46
+ components: {
47
+ BaseText,
48
+ BaseButton,
49
+ GridLayout,
50
+ FencerListCard
51
+ },
52
+ props: {
53
+ pools: {
54
+ type: Array,
55
+ required: true
56
+ }
57
+ },
58
+ computed: {
59
+ FencerListCard() {
60
+ return FencerListCard
61
+ },
62
+ mappedPersons() {
63
+ return this.pools.length > 0 ? this.mapEventPersonsToPersons(this.pools[this.selectedTab].EventPersons) : [];
64
+ }
65
+ },
66
+ data() {
67
+ return {
68
+ selectedTab: 0
69
+ };
70
+ },
71
+ methods: {
72
+ selectTab(index) {
73
+ this.selectedTab = index;
74
+ },
75
+ mapEventPersonsToPersons(eventPersons) {
76
+ const mappedPersons = eventPersons.map(eventPerson => ({
77
+ ...eventPerson.Person,
78
+ PoolPosition: eventPerson.PoolPosition,
79
+ Status: eventPerson.Status,
80
+ DEPosition: eventPerson.DEPosition
81
+ }));
82
+
83
+ return mappedPersons.sort((a, b) => a.PoolPosition - b.PoolPosition);
84
+ }
85
+ }
86
+ };
87
+ </script>