@dcrackel/hematournamentui 1.0.22 → 1.0.23
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/.eslintrc.js +18 -18
- package/.gitattributes +2 -2
- package/.prettierignore +1 -1
- package/.storybook/main.js +18 -18
- package/.storybook/mockRoutes.js +9 -9
- package/.storybook/preview-head.html +3 -3
- package/.storybook/preview.js +17 -17
- package/LICENSE +21 -21
- package/README.md +83 -83
- package/dist/HemaTouranmentUI-lib.es.js +7060 -6920
- package/dist/HemaTouranmentUI-lib.umd.js +27 -27
- package/dist/style.css +1 -1
- package/index.html +12 -12
- package/package.json +58 -58
- package/postcss.config.js +6 -6
- package/prettier.config.js +10 -10
- package/src/index.js +25 -25
- package/src/main.js +2 -2
- package/src/mocks/fileMock.js +1 -1
- package/src/mocks/tournamentMock.js +34 -34
- package/src/stories/Atoms/Icon/BaseIcon.stories.js +54 -54
- package/src/stories/Atoms/Icon/BaseIcon.test.js +91 -91
- package/src/stories/Atoms/Icon/BaseIcon.vue +48 -48
- package/src/stories/Atoms/Input/BaseInput.stories.js +29 -28
- package/src/stories/Atoms/Input/BaseInput.test.js +87 -87
- package/src/stories/Atoms/Input/BaseInput.vue +85 -73
- package/src/stories/Atoms/RadioGroup/BaseRadioGroup.stories.js +31 -31
- package/src/stories/Atoms/RadioGroup/BaseRadioGroup.test.js +49 -49
- package/src/stories/Atoms/RadioGroup/BaseRadioGroup.vue +49 -49
- package/src/stories/Atoms/Tag/BaseTag.stories.js +29 -29
- package/src/stories/Atoms/Tag/BaseTag.test.js +42 -42
- package/src/stories/Atoms/Tag/BaseTag.vue +57 -57
- package/src/stories/Atoms/Text/BaseText.stories.js +77 -77
- package/src/stories/Atoms/Text/BaseText.test.js +172 -172
- package/src/stories/Atoms/Text/BaseText.vue +170 -170
- package/src/stories/Configure.mdx +320 -320
- package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.stories.js +41 -41
- package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.test.js +80 -80
- package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.vue +31 -31
- package/src/stories/Molecules/Button/BaseButton.stories.js +93 -76
- package/src/stories/Molecules/Button/BaseButton.test.js +147 -147
- package/src/stories/Molecules/Button/BaseButton.vue +116 -125
- package/src/stories/Molecules/Cards/Detail/TournamentCardDetail.stories.js +33 -33
- package/src/stories/Molecules/Cards/Detail/TournamentCardDetail.vue +38 -38
- package/src/stories/Molecules/Cards/Header/TournamentCardHeader.stories.js +48 -48
- package/src/stories/Molecules/Cards/Header/TournamentCardHeader.vue +40 -40
- package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.stories.js +36 -36
- package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.vue +49 -49
- package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.stories.js +32 -32
- package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +46 -46
- package/src/stories/Organisms/AddressAutocomplete/AddressAutocomplete.stories.js +25 -25
- package/src/stories/Organisms/AddressAutocomplete/AddressAutocomplete.vue +51 -51
- package/src/stories/Organisms/DatePicker/DatePicker.stories.js +25 -25
- package/src/stories/Organisms/DatePicker/DatePicker.vue +62 -62
- package/src/stories/Organisms/DropDown/DropDownMenu.stories.js +34 -34
- package/src/stories/Organisms/DropDown/DropDownMenu.vue +51 -51
- package/src/stories/Organisms/Grid/GridContainer.stories.js +47 -47
- package/src/stories/Organisms/Grid/GridContainer.vue +108 -108
- package/src/stories/Organisms/ImageCropper/ImageCropper.stories.js +28 -28
- package/src/stories/Organisms/ImageCropper/ImageCropper.vue +86 -86
- package/src/stories/Organisms/TextBoxEditor/TextBoxEditor.stories.js +28 -28
- package/src/stories/Organisms/TextBoxEditor/TextBoxEditor.vue +97 -97
- package/src/stories/Organisms/TournamentCard/TournamentCard.stories.js +37 -37
- package/src/stories/Organisms/TournamentCard/TournamentCard.vue +35 -35
- package/src/stories/Templates/Forms/AddTournamentPageOne/AddTournamentPageOne.stories.js +25 -25
- package/src/stories/Templates/Forms/AddTournamentPageOne/AddTournamentPageOne.vue +138 -137
- package/src/stories/Templates/Forms/AddTournamentPageTwo/AddTournamentPageTwo.stories.js +35 -0
- package/src/stories/Templates/Forms/AddTournamentPageTwo/AddTournamentPageTwo.vue +121 -0
- package/src/stories/Templates/Menu/Admin/AdminLeftMenu.stories.js +28 -28
- package/src/stories/Templates/Menu/Admin/AdminLeftMenu.vue +57 -57
- package/tailwind/output.css +1247 -1212
- package/tailwind/tailwind.css +4 -4
- package/tailwind.config.js +50 -50
- package/vite.config.js +23 -23
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
|
|
3
|
-
<vue-google-autocomplete
|
|
4
|
-
class="border rounded-lg text-secondary text-xs p-2 w-full appearance-none focus:outline-none"
|
|
5
|
-
:class="invalid ? 'border-alarm' : 'border-dropdownSelect'"
|
|
6
|
-
id="map"
|
|
7
|
-
ref="address"
|
|
8
|
-
v-model="address"
|
|
9
|
-
placeholder="Venue Address"
|
|
10
|
-
@placechanged="getAddressData"
|
|
11
|
-
/>
|
|
12
|
-
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
import VueGoogleAutocomplete from "vue-google-autocomplete";
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
components: { VueGoogleAutocomplete },
|
|
20
|
-
props: {
|
|
21
|
-
invalid: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
default: false
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
data() {
|
|
27
|
-
return {
|
|
28
|
-
address: "",
|
|
29
|
-
coordinates: ""
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
methods: {
|
|
33
|
-
getAddressData(addressData) {
|
|
34
|
-
const street = `${addressData.street_number} ${addressData.route}`;
|
|
35
|
-
const city = addressData.locality;
|
|
36
|
-
const state = addressData.administrative_area_level_1;
|
|
37
|
-
|
|
38
|
-
this.address = `${street}, ${city}, ${state}`;
|
|
39
|
-
this.coordinates = `${addressData.latitude},${addressData.longitude}`
|
|
40
|
-
|
|
41
|
-
const updatedAddress = {
|
|
42
|
-
address: this.address,
|
|
43
|
-
coordinates: this.coordinates
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
this.$emit("update:address", updatedAddress);
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<vue-google-autocomplete
|
|
4
|
+
class="border rounded-lg text-secondary text-xs p-2 w-full appearance-none focus:outline-none"
|
|
5
|
+
:class="invalid ? 'border-alarm' : 'border-dropdownSelect'"
|
|
6
|
+
id="map"
|
|
7
|
+
ref="address"
|
|
8
|
+
v-model="address"
|
|
9
|
+
placeholder="Venue Address"
|
|
10
|
+
@placechanged="getAddressData"
|
|
11
|
+
/>
|
|
12
|
+
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import VueGoogleAutocomplete from "vue-google-autocomplete";
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
components: { VueGoogleAutocomplete },
|
|
20
|
+
props: {
|
|
21
|
+
invalid: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
address: "",
|
|
29
|
+
coordinates: ""
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
getAddressData(addressData) {
|
|
34
|
+
const street = `${addressData.street_number} ${addressData.route}`;
|
|
35
|
+
const city = addressData.locality;
|
|
36
|
+
const state = addressData.administrative_area_level_1;
|
|
37
|
+
|
|
38
|
+
this.address = `${street}, ${city}, ${state}`;
|
|
39
|
+
this.coordinates = `${addressData.latitude},${addressData.longitude}`
|
|
40
|
+
|
|
41
|
+
const updatedAddress = {
|
|
42
|
+
address: this.address,
|
|
43
|
+
coordinates: this.coordinates
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
this.$emit("update:address", updatedAddress);
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
</script>
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import DatePicker from './DatePicker.vue';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Organisms/DatePicker',
|
|
5
|
-
component: DatePicker,
|
|
6
|
-
tags: ['autodocs'],
|
|
7
|
-
argTypes: {}
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const Template = args => ({
|
|
11
|
-
components: { DatePicker },
|
|
12
|
-
setup() {
|
|
13
|
-
return {
|
|
14
|
-
args: {
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
},
|
|
18
|
-
methods: {
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const Default = {
|
|
23
|
-
args: {
|
|
24
|
-
}
|
|
25
|
-
};
|
|
1
|
+
import DatePicker from './DatePicker.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Organisms/DatePicker',
|
|
5
|
+
component: DatePicker,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = args => ({
|
|
11
|
+
components: { DatePicker },
|
|
12
|
+
setup() {
|
|
13
|
+
return {
|
|
14
|
+
args: {
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const Default = {
|
|
23
|
+
args: {
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div >
|
|
3
|
-
<VueDatePicker
|
|
4
|
-
v-model="selectedDate"
|
|
5
|
-
placeholder="Select Start Date"
|
|
6
|
-
mode="date"
|
|
7
|
-
:format="'MM/dd/yyyy'"
|
|
8
|
-
:enable-time-picker="false"
|
|
9
|
-
:min-date="minDate"
|
|
10
|
-
:state="invalid"
|
|
11
|
-
/>
|
|
12
|
-
</div>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
import VueDatePicker from '@vuepic/vue-datepicker';
|
|
17
|
-
import '@vuepic/vue-datepicker/dist/main.css';
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
components: { VueDatePicker },
|
|
21
|
-
props: {
|
|
22
|
-
setDate: {
|
|
23
|
-
type: [Date, String],
|
|
24
|
-
default: () => new Date(),
|
|
25
|
-
required: true
|
|
26
|
-
},
|
|
27
|
-
invalid: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: false
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
data() {
|
|
33
|
-
return {
|
|
34
|
-
selectedDate: this.setDate ? new Date(this.setDate) : null,
|
|
35
|
-
minDate: new Date()
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
watch: {
|
|
39
|
-
selectedDate(newDate) {
|
|
40
|
-
this.$emit("update:selectedDate", newDate);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<style scoped>
|
|
47
|
-
::v-deep .dp__pointer.dp__input_readonly.dp__input.dp__input_icon_pad.dp__input_reg {
|
|
48
|
-
color: rgb(43,50,75);
|
|
49
|
-
font-size: 14px;
|
|
50
|
-
border-radius: 8px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
::v-deep .dp__input_invalid {
|
|
54
|
-
box-shadow: 0 0;
|
|
55
|
-
border: 1px solid rgb(213,228,238);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
::v-deep .dp__input_valid {
|
|
59
|
-
box-shadow: 0 0;
|
|
60
|
-
border: 1px solid rgb(255,0,0);
|
|
61
|
-
}
|
|
62
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div >
|
|
3
|
+
<VueDatePicker
|
|
4
|
+
v-model="selectedDate"
|
|
5
|
+
placeholder="Select Start Date"
|
|
6
|
+
mode="date"
|
|
7
|
+
:format="'MM/dd/yyyy'"
|
|
8
|
+
:enable-time-picker="false"
|
|
9
|
+
:min-date="minDate"
|
|
10
|
+
:state="invalid"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import VueDatePicker from '@vuepic/vue-datepicker';
|
|
17
|
+
import '@vuepic/vue-datepicker/dist/main.css';
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
components: { VueDatePicker },
|
|
21
|
+
props: {
|
|
22
|
+
setDate: {
|
|
23
|
+
type: [Date, String],
|
|
24
|
+
default: () => new Date(),
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
invalid: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
data() {
|
|
33
|
+
return {
|
|
34
|
+
selectedDate: this.setDate ? new Date(this.setDate) : null,
|
|
35
|
+
minDate: new Date()
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
watch: {
|
|
39
|
+
selectedDate(newDate) {
|
|
40
|
+
this.$emit("update:selectedDate", newDate);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<style scoped>
|
|
47
|
+
::v-deep .dp__pointer.dp__input_readonly.dp__input.dp__input_icon_pad.dp__input_reg {
|
|
48
|
+
color: rgb(43,50,75);
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
border-radius: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
::v-deep .dp__input_invalid {
|
|
54
|
+
box-shadow: 0 0;
|
|
55
|
+
border: 1px solid rgb(213,228,238);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
::v-deep .dp__input_valid {
|
|
59
|
+
box-shadow: 0 0;
|
|
60
|
+
border: 1px solid rgb(255,0,0);
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import DropDownMenu from './DropDownMenu.vue';
|
|
2
|
-
export default {
|
|
3
|
-
title: 'Organisms/DropDownMenu',
|
|
4
|
-
component: DropDownMenu,
|
|
5
|
-
tags: ['autodocs']
|
|
6
|
-
};
|
|
7
|
-
const Template = args => ({
|
|
8
|
-
components: { DropDownMenu },
|
|
9
|
-
setup() {
|
|
10
|
-
return {
|
|
11
|
-
args: {
|
|
12
|
-
label: 'default',
|
|
13
|
-
items: []
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
methods: {
|
|
18
|
-
onMenuClick(index) {
|
|
19
|
-
alert(`Button ${index + 1} clicked!`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export const Default = {
|
|
25
|
-
args: {
|
|
26
|
-
label: 'Sort By',
|
|
27
|
-
items: [
|
|
28
|
-
{text: 'Text1', link: '/link1'},
|
|
29
|
-
{text: 'Text2', link: '/link2'},
|
|
30
|
-
{text: 'Text3', link: '/link3'}
|
|
31
|
-
],
|
|
32
|
-
selectedItem: {text: 'Text1', link: '/link1'}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
1
|
+
import DropDownMenu from './DropDownMenu.vue';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Organisms/DropDownMenu',
|
|
4
|
+
component: DropDownMenu,
|
|
5
|
+
tags: ['autodocs']
|
|
6
|
+
};
|
|
7
|
+
const Template = args => ({
|
|
8
|
+
components: { DropDownMenu },
|
|
9
|
+
setup() {
|
|
10
|
+
return {
|
|
11
|
+
args: {
|
|
12
|
+
label: 'default',
|
|
13
|
+
items: []
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
methods: {
|
|
18
|
+
onMenuClick(index) {
|
|
19
|
+
alert(`Button ${index + 1} clicked!`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const Default = {
|
|
25
|
+
args: {
|
|
26
|
+
label: 'Sort By',
|
|
27
|
+
items: [
|
|
28
|
+
{text: 'Text1', link: '/link1'},
|
|
29
|
+
{text: 'Text2', link: '/link2'},
|
|
30
|
+
{text: 'Text3', link: '/link3'}
|
|
31
|
+
],
|
|
32
|
+
selectedItem: {text: 'Text1', link: '/link1'}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex flex-row">
|
|
3
|
-
<span>
|
|
4
|
-
<div class="z-10 rounded-lg shadow px-2 py-2 w-40 flex flex-row justify-between" @click="handleDropDown()">
|
|
5
|
-
<BaseText :text="label" color="quaternary" size="sm" weight="normal" />
|
|
6
|
-
<BaseText :text="selectedItem.text" color="secondary" size="sm" weight="normal" />
|
|
7
|
-
<i class="fa-solid fa-chevron-down text-xs" />
|
|
8
|
-
</div>
|
|
9
|
-
<div v-if="isDropDownOpen" class="flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral">
|
|
10
|
-
<a v-for="item in items" :key="item.id" @click="handleClick(item)" class="hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0">
|
|
11
|
-
<BaseText :text="item.text" color="primary" size="xs" weight="normal" />
|
|
12
|
-
</a>
|
|
13
|
-
</div>
|
|
14
|
-
</span>
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
import BaseText from "../../Atoms/Text/BaseText.vue";
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
name: 'DropDownMenu',
|
|
23
|
-
components: {BaseText},
|
|
24
|
-
props: {
|
|
25
|
-
label: {
|
|
26
|
-
type: String,
|
|
27
|
-
},
|
|
28
|
-
items: {
|
|
29
|
-
type: Array,
|
|
30
|
-
validator: (itemsArray) => itemsArray.every(item => typeof item.text === 'string')
|
|
31
|
-
},
|
|
32
|
-
selectedItem: {
|
|
33
|
-
type: Object,
|
|
34
|
-
default: () => ({ text: '' }),
|
|
35
|
-
validator: (obj) => typeof obj.text === 'string'
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
data: () => ({
|
|
39
|
-
isDropDownOpen: false
|
|
40
|
-
}),
|
|
41
|
-
methods: {
|
|
42
|
-
handleClick(item) {
|
|
43
|
-
this.isDropDownOpen = false;
|
|
44
|
-
this.$emit('update:selectedItem', item);
|
|
45
|
-
},
|
|
46
|
-
handleDropDown() {
|
|
47
|
-
this.isDropDownOpen = !this.isDropDownOpen;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-row">
|
|
3
|
+
<span>
|
|
4
|
+
<div class="z-10 rounded-lg shadow px-2 py-2 w-40 flex flex-row justify-between" @click="handleDropDown()">
|
|
5
|
+
<BaseText :text="label" color="quaternary" size="sm" weight="normal" />
|
|
6
|
+
<BaseText :text="selectedItem.text" color="secondary" size="sm" weight="normal" />
|
|
7
|
+
<i class="fa-solid fa-chevron-down text-xs" />
|
|
8
|
+
</div>
|
|
9
|
+
<div v-if="isDropDownOpen" class="flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral">
|
|
10
|
+
<a v-for="item in items" :key="item.id" @click="handleClick(item)" class="hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0">
|
|
11
|
+
<BaseText :text="item.text" color="primary" size="xs" weight="normal" />
|
|
12
|
+
</a>
|
|
13
|
+
</div>
|
|
14
|
+
</span>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import BaseText from "../../Atoms/Text/BaseText.vue";
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'DropDownMenu',
|
|
23
|
+
components: {BaseText},
|
|
24
|
+
props: {
|
|
25
|
+
label: {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
items: {
|
|
29
|
+
type: Array,
|
|
30
|
+
validator: (itemsArray) => itemsArray.every(item => typeof item.text === 'string')
|
|
31
|
+
},
|
|
32
|
+
selectedItem: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default: () => ({ text: '' }),
|
|
35
|
+
validator: (obj) => typeof obj.text === 'string'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
data: () => ({
|
|
39
|
+
isDropDownOpen: false
|
|
40
|
+
}),
|
|
41
|
+
methods: {
|
|
42
|
+
handleClick(item) {
|
|
43
|
+
this.isDropDownOpen = false;
|
|
44
|
+
this.$emit('update:selectedItem', item);
|
|
45
|
+
},
|
|
46
|
+
handleDropDown() {
|
|
47
|
+
this.isDropDownOpen = !this.isDropDownOpen;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import GridContainer from './GridContainer.vue';
|
|
2
|
-
import MockTournaments from '../../../mocks/tournamentMock.js';
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Organisms/GridContainer',
|
|
5
|
-
component: GridContainer,
|
|
6
|
-
tags: ['autodocs'],
|
|
7
|
-
argTypes: {}
|
|
8
|
-
};
|
|
9
|
-
export const Default = {
|
|
10
|
-
args: {
|
|
11
|
-
items: MockTournaments,
|
|
12
|
-
component: 'TournamentCard',
|
|
13
|
-
label: 'Sort by',
|
|
14
|
-
dropdownItems: [
|
|
15
|
-
{text: 'Name', link: '/sort/name'},
|
|
16
|
-
{text: 'Location', link: '/sort/location'},
|
|
17
|
-
{text: 'Date', link: '/sort/date'}
|
|
18
|
-
],
|
|
19
|
-
selectedItem: {text: 'Date', link: '/sort/name'}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export const EmptyBoard = {
|
|
23
|
-
args: {
|
|
24
|
-
tournaments: [],
|
|
25
|
-
component: 'TournamentCard',
|
|
26
|
-
label: 'Sort by',
|
|
27
|
-
dropdownItems: [
|
|
28
|
-
{text: 'Name', link: '/sort/name'},
|
|
29
|
-
{text: 'Location', link: '/sort/location'},
|
|
30
|
-
{text: 'Date', link: '/sort/date'}
|
|
31
|
-
],
|
|
32
|
-
selectedItem: {text: 'Name', link: '/sort/name'}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
export const WithTournaments = {
|
|
36
|
-
args: {
|
|
37
|
-
items: MockTournaments,
|
|
38
|
-
component: 'TournamentCard',
|
|
39
|
-
label: 'Sort by',
|
|
40
|
-
dropdownItems: [
|
|
41
|
-
{text: 'Name', link: '/sort/name'},
|
|
42
|
-
{text: 'Location', link: '/sort/location'},
|
|
43
|
-
{text: 'Date', link: '/sort/date'}
|
|
44
|
-
],
|
|
45
|
-
selectedItem: {text: 'Name', link: '/sort/name'}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
1
|
+
import GridContainer from './GridContainer.vue';
|
|
2
|
+
import MockTournaments from '../../../mocks/tournamentMock.js';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Organisms/GridContainer',
|
|
5
|
+
component: GridContainer,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {}
|
|
8
|
+
};
|
|
9
|
+
export const Default = {
|
|
10
|
+
args: {
|
|
11
|
+
items: MockTournaments,
|
|
12
|
+
component: 'TournamentCard',
|
|
13
|
+
label: 'Sort by',
|
|
14
|
+
dropdownItems: [
|
|
15
|
+
{text: 'Name', link: '/sort/name'},
|
|
16
|
+
{text: 'Location', link: '/sort/location'},
|
|
17
|
+
{text: 'Date', link: '/sort/date'}
|
|
18
|
+
],
|
|
19
|
+
selectedItem: {text: 'Date', link: '/sort/name'}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export const EmptyBoard = {
|
|
23
|
+
args: {
|
|
24
|
+
tournaments: [],
|
|
25
|
+
component: 'TournamentCard',
|
|
26
|
+
label: 'Sort by',
|
|
27
|
+
dropdownItems: [
|
|
28
|
+
{text: 'Name', link: '/sort/name'},
|
|
29
|
+
{text: 'Location', link: '/sort/location'},
|
|
30
|
+
{text: 'Date', link: '/sort/date'}
|
|
31
|
+
],
|
|
32
|
+
selectedItem: {text: 'Name', link: '/sort/name'}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export const WithTournaments = {
|
|
36
|
+
args: {
|
|
37
|
+
items: MockTournaments,
|
|
38
|
+
component: 'TournamentCard',
|
|
39
|
+
label: 'Sort by',
|
|
40
|
+
dropdownItems: [
|
|
41
|
+
{text: 'Name', link: '/sort/name'},
|
|
42
|
+
{text: 'Location', link: '/sort/location'},
|
|
43
|
+
{text: 'Date', link: '/sort/date'}
|
|
44
|
+
],
|
|
45
|
+
selectedItem: {text: 'Name', link: '/sort/name'}
|
|
46
|
+
}
|
|
47
|
+
};
|