@dcrackel/hematournamentui 1.0.329 → 1.0.331

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.
@@ -5,18 +5,17 @@
5
5
  :class="baseClasses"
6
6
  :placeholder="placeholder"
7
7
  @input="onInput($event.target.value)"
8
+ @focus="onFocus"
9
+ @blur="onBlur"
8
10
  />
9
11
  </div>
10
12
 
11
13
  </template>
12
14
 
13
15
  <script>
14
- import {computed, ref, watch} from 'vue';
15
- import BaseIcon from "../Icon/BaseIcon.vue";
16
16
 
17
17
  export default {
18
18
  name: 'BaseInput',
19
- components: {BaseIcon},
20
19
  props: {
21
20
  placeholder: {
22
21
  type: [String, Number],
@@ -56,26 +55,25 @@ export default {
56
55
  type: String,
57
56
  default: 'primary',
58
57
  validator: value => ['neutral', 'primary', 'secondary', 'tertiary', 'quaternary', 'quinary', 'bright', 'white', 'alarm'].includes(value)
59
- },
60
- emits: ['click'],
58
+ }
61
59
  },
62
- setup: function (props, {emit}) {
63
- const internalValue = ref(props.value);
64
- const timeout = ref(null);
65
-
66
- watch(() => props.value, newValue => {
67
- internalValue.value = newValue;
68
- });
69
-
70
- const baseClasses = computed(() => {
60
+ data() {
61
+ return {
62
+ internalValue: this.value,
63
+ currentPlaceholder: this.placeholder,
64
+ timeout: null
65
+ };
66
+ },
67
+ computed: {
68
+ baseClasses() {
71
69
  let classes = 'appearance-none focus:outline-none w-full text-sm rounded-lg text-quinary';
72
- if (props.addBorder) {
73
- classes += props.invalid ? ' border border-alarm p-2' : ' border border-dropdownSelect p-2';
70
+ if (this.addBorder) {
71
+ classes += this.invalid ? ' border border-alarm p-2' : ' border border-dropdownSelect p-2';
74
72
  }
75
73
 
76
- if (props.centerInput) classes += ' text-center';
74
+ if (this.centerInput) classes += ' text-center';
77
75
 
78
- switch (props.size) {
76
+ switch (this.size) {
79
77
  case 'xs':
80
78
  classes += ' text-xs';
81
79
  break;
@@ -106,21 +104,28 @@ export default {
106
104
  }
107
105
 
108
106
  return classes;
109
- });
110
-
111
- const onInput = () => {
112
- clearTimeout(timeout.value);
113
- timeout.value = setTimeout(() => {
114
- emit('update:value', internalValue.value);
107
+ }
108
+ },
109
+ watch: {
110
+ value(newValue) {
111
+ this.internalValue = newValue;
112
+ }
113
+ },
114
+ methods: {
115
+ onInput() {
116
+ clearTimeout(this.timeout);
117
+ this.timeout = setTimeout(() => {
118
+ this.$emit('update:value', this.internalValue);
115
119
  }, 300);
120
+ },
121
+ onFocus() {
122
+ this.currentPlaceholder = '';
123
+ },
124
+ onBlur() {
125
+ if (!this.internalValue) {
126
+ this.currentPlaceholder = this.placeholder;
127
+ }
116
128
  }
117
-
118
- return {
119
- internalValue,
120
- baseClasses,
121
- onInput
122
- };
123
129
  }
124
-
125
130
  };
126
131
  </script>
@@ -47,5 +47,25 @@ export const spacingConfig = {
47
47
  'Third Place': { getTopSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1' },
48
48
  }
49
49
  },
50
+ 'Table of 32': {
51
+ large: {
52
+ 'Table of 32': { getTopSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1' },
53
+ 'Table of 16': { getTopSpace: 'mt-[1.34rem] mb-[3.4rem]', getCardSpace: 'mt-[4.5rem]' },
54
+ 'Table of 8': { getTopSpace: 'mt-[4.6rem] mb-[7.15rem]', getCardSpace: 'mt-[11.5rem]' },
55
+ Quarterfinal: { getTopSpace: 'mt-[11.7rem] mb-[13.7rem]', getCardSpace: 'mt-[25.8rem]' },
56
+ Semifinal: { getTopSpace: 'mt-[24.3rem] mb-[29rem]', getCardSpace: 'mt-[53.6rem]' },
57
+ Final: { getTopSpace: 'mt-[51.5rem] ', getCardSpace: 'mt-1' },
58
+ 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[19.2rem]', getCardSpace: 'mt-1' },
59
+ },
60
+ small: {
61
+ 'Table of 32': { getTopSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1' },
62
+ 'Table of 16': { getTopSpace: 'mt-[0.7rem] mb-[2.65rem]', getCardSpace: 'mt-[3.4rem]' },
63
+ 'Table of 8': { getTopSpace: 'mt-[2.9rem] mb-[5rem]', getCardSpace: 'mt-[7.85rem]' },
64
+ Quarterfinal: { getTopSpace: 'mt-[7rem] mb-[9.95rem]', getCardSpace: 'mt-[16.8rem]' },
65
+ Semifinal: { getTopSpace: 'mt-[16.1rem] mb-[18.8rem]', getCardSpace: 'mt-[34.8rem]' },
66
+ Final: { getTopSpace: 'mt-[34.1rem]', getCardSpace: 'mt-1' },
67
+ 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1' },
68
+ }
69
+ },
50
70
  // Add up to Table of 256 as needed
51
71
  };
@@ -18,3 +18,25 @@ export const Default = {
18
18
  selectedItem: {text: 'Text1', link: '/link1'}
19
19
  }
20
20
  };
21
+
22
+ export const DropDownAlso = {
23
+ args: {
24
+ label: '',
25
+ items: [
26
+ { text: 'Purrfect Warriors', link: '/purrfect-warriors' },
27
+ { text: 'Whisker Tactics', link: '/whisker-tactics' },
28
+ { text: 'Meowtains of Fury', link: '/meowtains-of-fury' },
29
+ { text: 'Feline Fury', link: '/feline-fury' },
30
+ { text: 'Claws of Destiny', link: '/claws-of-destiny' },
31
+ { text: 'Kitty Knights', link: '/kitty-knights' },
32
+ { text: 'Paws of Valor', link: '/paws-of-valor' },
33
+ { text: 'Mew-sketters', link: '/mew-sketters' },
34
+ { text: 'Purr-suit of Power', link: '/purr-suit-of-power' },
35
+ { text: 'Cat-astrophic Force', link: '/cat-astrophic-force' }
36
+ ],
37
+ selectedItem: {text: '', link: ''},
38
+ width:"w-full",
39
+ dropDownWidth:"w-[342px]"
40
+ }
41
+ };
42
+
@@ -1,13 +1,12 @@
1
1
  <template>
2
2
  <div class="flex flex-row w-full relative" :class="[alignEnd ? 'justify-end' : '']" ref="dropdownContainer">
3
3
  <div class="z-10 rounded-lg px-2 py-2 flex flex-row justify-between border border-dropdownSelect bg-white" :class="width" @click="handleDropDown">
4
- <BaseText v-if="label.length > 1" :text="label" color="quinary" size="sm" weight="normal" />
5
- <BaseText :text="selectedItem.text" color="quaternary" size="sm" weight="normal" />
6
- <i class="fa-solid fa-chevron-down text-xs text-quinary" />
4
+ <BaseInput :placeholder="label" :value="selectedItem.text" class="w-full" size="sm" @keyup="filterDropDown" />
5
+ <i class="fa-solid pt-1 fa-chevron-down text-xs text-quinary" />
7
6
  </div>
8
7
  <transition name="fade-in-down">
9
- <div v-if="isDropDownOpen" class="flex flex-col shadow-lg mt-9 z-20 rounded-b-xl absolute bg-neutral border border-dropdownSelect overflow-y-auto max-h-44" :class="dropDownWidth">
10
- <a v-for="item in items" :key="item.id" @click="handleClick(item)" class="hover:bg-dropdownSelect py-1 px-2 border-b border-l border-r border-dropdownSelect">
8
+ <div v-if="isDropDownOpen" class="flex flex-col shadow-lg mt-10 z-20 rounded-b-xl absolute bg-neutral border border-dropdownSelect overflow-y-auto max-h-44" :class="dropDownWidth">
9
+ <a v-for="item in localItems" :key="item.id" @click="handleClick(item)" class="hover:bg-dropdownSelect py-1 px-2 border-b border-l border-r border-dropdownSelect">
11
10
  <BaseText :text="item.text" color="quinary" size="sm" weight="normal" class="py-0.5" />
12
11
  </a>
13
12
  </div>
@@ -17,10 +16,11 @@
17
16
 
18
17
  <script>
19
18
  import BaseText from "../../../Atoms/Text/BaseText.vue";
19
+ import BaseInput from "../../../Atoms/Input/BaseInput.vue";
20
20
 
21
21
  export default {
22
22
  name: 'DropDownMenu',
23
- components: { BaseText },
23
+ components: {BaseInput, BaseText },
24
24
  props: {
25
25
  label: {
26
26
  type: String,
@@ -49,6 +49,7 @@ export default {
49
49
  },
50
50
  data() {
51
51
  return {
52
+ localItems: this.items,
52
53
  isDropDownOpen: false
53
54
  };
54
55
  },
@@ -64,6 +65,10 @@ export default {
64
65
  if (this.$refs.dropdownContainer && !this.$refs.dropdownContainer.contains(event.target)) {
65
66
  this.isDropDownOpen = false;
66
67
  }
68
+ },
69
+ filterDropDown(event) {
70
+ const filter = event.target.value.toLowerCase();
71
+ this.localItems = this.items.filter(item => item.text.toLowerCase().includes(filter));
67
72
  }
68
73
  },
69
74
  mounted() {
@@ -36,7 +36,7 @@ export const spacingConfig = {
36
36
  'Table of 8': { getTopSpace: 'mt-[1.3rem]', getConnectorHeight: 'h-[7rem]', getTopSpaceForLine: 'mt-[3.25rem]' },
37
37
  Quarterfinal: { getTopSpace: 'mt-[4.7rem]', getConnectorHeight: 'h-[14rem]', getTopSpaceForLine: 'mt-[7rem]' },
38
38
  Semifinal: { getTopSpace: 'mt-[12.7rem]', getConnectorHeight: 'h-[28.3rem]', getTopSpaceForLine: '' },
39
- Final: { getTopSpace: 'h-[30rem] mt-[25rem] -ml-[309px]', getBottomLine: 'h-[30rem] mt-[2.5rem] -ml-[309px]' },
39
+ Final: { getTopSpace: 'mt-[15rem] h-[40rem] -ml-[309px]', getBottomLine: 'h-[40rem] mt-[2.5rem] -ml-[309px]' },
40
40
  'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' },
41
41
  },
42
42
  small: {
@@ -48,5 +48,25 @@ export const spacingConfig = {
48
48
  'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' },
49
49
  }
50
50
  },
51
+ 'Table of 32': {
52
+ large: {
53
+ 'Table of 32': { getTopSpace: 'mt-[0rem]', getConnectorHeight: 'h-[2.7rem]', getTopSpaceForLine: 'mt-[1.2rem]' },
54
+ 'Table of 16': { getTopSpace: 'mt-[1.3rem]', getConnectorHeight: 'h-[7rem]', getTopSpaceForLine: 'mt-[3.25rem]' },
55
+ 'Table of 8': { getTopSpace: 'mt-[4.7rem]', getConnectorHeight: 'h-[14rem]', getTopSpaceForLine: 'mt-[7rem]' },
56
+ Quarterfinal: { getTopSpace: 'mt-[11.7rem]', getConnectorHeight: 'h-[28rem]', getTopSpaceForLine: 'mt-[12.5rem]' },
57
+ Semifinal: { getTopSpace: 'mt-[25.5rem]', getConnectorHeight: 'h-[56rem]', getTopSpaceForLine: '' },
58
+ Final: { getTopSpace: 'mt-[49.1rem] h-[25rem] -ml-[309px]', getBottomLine: 'h-[30rem] mt-[2.5rem] -ml-[309px]' },
59
+ 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' },
60
+ },
61
+ small: {
62
+ 'Table of 32': { getTopSpace: '-mt-[0.6rem]', getConnectorHeight: 'h-[1.5rem]', getTopSpaceForLine: 'mt-[0.65rem]' },
63
+ 'Table of 16': { getTopSpace: '-mt-[0rem]', getConnectorHeight: 'h-[4.8rem]', getTopSpaceForLine: 'mt-[2.2rem]' },
64
+ 'Table of 8': { getTopSpace: 'mt-[2.3rem]', getConnectorHeight: 'h-[9.1rem]', getTopSpaceForLine: 'mt-[4rem]' },
65
+ Quarterfinal: { getTopSpace: 'mt-[6.4rem]', getConnectorHeight: 'h-[18rem]', getTopSpaceForLine: 'mt-[9rem]' },
66
+ Semifinal: { getTopSpace: 'mt-[16.6rem]', getConnectorHeight: 'h-[36rem]', getTopSpaceForLine: 'mt-[3.8rem]' },
67
+ Final: { getTopSpace: 'h-[256px] mt-[21rem] -ml-[181px]', getBottomLine: 'h-[8rem] mt-[1.4rem] -ml-[181px]' },
68
+ 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' },
69
+ }
70
+ },
51
71
  // Add up to Table of 256 as needed
52
72
  };
@@ -61,6 +61,16 @@ export const TableWithTwentyTwo = {
61
61
  }
62
62
  };
63
63
 
64
+ export const tableOfThirtyTwo = {
65
+ args: {
66
+ bouts: getDEWithBouts.pools[0].Bouts,
67
+ eventRules: getDEWithBouts.eventRules,
68
+ hostingClubColors: getDEWithBouts.hostingClubColors,
69
+ connectedToServer: true,
70
+ status: 'de'
71
+ }
72
+ };
73
+
64
74
  export const noBoutsYet = {
65
75
  args: {
66
76
  bouts: [],