@dcrackel/hematournamentui 1.0.7 → 1.0.20
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/.storybook/preview-head.html +3 -1
- package/dist/HemaTouranmentUI-lib.es.js +26609 -480
- package/dist/HemaTouranmentUI-lib.umd.js +183 -1
- package/dist/style.css +9 -0
- package/package/.eslintrc.js +18 -0
- package/package/.gitattributes +2 -0
- package/package/.prettierignore +1 -0
- package/package/.storybook/main.js +18 -0
- package/package/.storybook/mockRoutes.js +9 -0
- package/package/.storybook/preview-head.html +1 -0
- package/package/.storybook/preview.js +17 -0
- package/package/LICENSE +21 -0
- package/package/README.md +83 -0
- package/package/index.html +12 -0
- package/package/package.json +49 -0
- package/package/postcss.config.js +6 -0
- package/package/prettier.config.js +10 -0
- package/package/src/assets/default-tournament.png +0 -0
- package/package/src/index.js +15 -0
- package/package/src/main.js +2 -0
- package/package/src/mocks/fileMock.js +1 -0
- package/package/src/mocks/tournamentMock.js +34 -0
- package/package/src/stories/Configure.mdx +320 -0
- package/package/tailwind/output.css +1072 -0
- package/package/tailwind/tailwind.css +4 -0
- package/package/tailwind.config.js +25 -0
- package/package/vite.config.js +23 -0
- package/package.json +9 -2
- package/src/assets/select-tournament.png +0 -0
- package/src/index.js +20 -11
- package/src/stories/Atoms/Icon/BaseIcon.stories.js +54 -0
- package/src/stories/Atoms/Icon/BaseIcon.vue +47 -0
- package/src/stories/Atoms/Input/BaseInput.stories.js +28 -0
- package/src/stories/Atoms/Input/BaseInput.test.js +87 -0
- package/src/stories/Atoms/Input/BaseInput.vue +73 -0
- package/src/stories/Atoms/RadioGroup/BaseRadioGroup.stories.js +31 -0
- package/src/stories/Atoms/RadioGroup/BaseRadioGroup.vue +49 -0
- package/src/stories/Atoms/Tag/BaseTag.stories.js +29 -0
- package/src/stories/Atoms/Tag/BaseTag.test.js +42 -0
- package/src/stories/Atoms/Tag/BaseTag.vue +57 -0
- package/src/stories/Atoms/Text/BaseText.stories.js +77 -0
- package/src/stories/Atoms/Text/BaseText.test.js +172 -0
- package/src/stories/Atoms/Text/BaseText.vue +170 -0
- package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.stories.js +41 -0
- package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.vue +31 -0
- package/src/stories/Molecules/Button/BaseButton.stories.js +76 -0
- package/src/stories/Molecules/Button/BaseButton.test.js +147 -0
- package/src/stories/Molecules/Button/BaseButton.vue +125 -0
- package/src/stories/Molecules/Cards/Detail/TournamentCardDetail.stories.js +33 -0
- package/src/stories/Molecules/Cards/Detail/TournamentCardDetail.vue +38 -0
- package/src/stories/Molecules/Cards/Header/TournamentCardHeader.stories.js +48 -0
- package/src/stories/Molecules/Cards/Header/TournamentCardHeader.vue +40 -0
- package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.stories.js +36 -0
- package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.vue +49 -0
- package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.stories.js +32 -0
- package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +46 -0
- package/src/stories/Organisms/AddressAutocomplete/AddressAutocomplete.stories.js +25 -0
- package/src/stories/Organisms/AddressAutocomplete/AddressAutocomplete.vue +51 -0
- package/src/stories/Organisms/DatePicker/DatePicker.stories.js +25 -0
- package/src/stories/Organisms/DatePicker/DatePicker.vue +62 -0
- package/src/stories/Organisms/DropDown/DropDownMenu.stories.js +34 -0
- package/src/stories/Organisms/DropDown/DropDownMenu.vue +51 -0
- package/src/stories/Organisms/Grid/GridContainer.stories.js +47 -0
- package/src/stories/Organisms/Grid/GridContainer.vue +108 -0
- package/src/stories/Organisms/ImageCropper/ImageCropper.stories.js +28 -0
- package/src/stories/Organisms/ImageCropper/ImageCropper.vue +86 -0
- package/src/stories/Organisms/TextBoxEditor/TextBoxEditor.stories.js +28 -0
- package/src/stories/Organisms/TextBoxEditor/TextBoxEditor.vue +97 -0
- package/src/stories/Organisms/TournamentCard/TournamentCard.stories.js +37 -0
- package/src/stories/Organisms/TournamentCard/TournamentCard.vue +35 -0
- package/src/stories/Templates/Forms/AddTournamentPageOne/AddTournamentPageOne.stories.js +25 -0
- package/src/stories/Templates/Forms/AddTournamentPageOne/AddTournamentPageOne.vue +136 -0
- package/src/stories/Templates/Menu/Admin/AdminLeftMenu.stories.js +28 -0
- package/src/stories/Templates/Menu/Admin/AdminLeftMenu.vue +57 -0
- package/tailwind/output.css +147 -7
- package/tailwind.config.js +28 -3
- /package/{src → package/src}/stories/Base/Button/BaseButton.stories.js +0 -0
- /package/{src → package/src}/stories/Base/Button/BaseButton.test.js +0 -0
- /package/{src → package/src}/stories/Base/Button/BaseButton.vue +0 -0
- /package/{src → package/src}/stories/Base/Input/BaseInput.stories.js +0 -0
- /package/{src → package/src}/stories/Base/Input/BaseInput.test.js +0 -0
- /package/{src → package/src}/stories/Base/Input/BaseInput.vue +0 -0
- /package/{src → package/src}/stories/Base/Tag/BaseTag.stories.js +0 -0
- /package/{src → package/src}/stories/Base/Tag/BaseTag.test.js +0 -0
- /package/{src → package/src}/stories/Base/Tag/BaseTag.vue +0 -0
- /package/{src → package/src}/stories/Base/Text/BaseText.stories.js +0 -0
- /package/{src → package/src}/stories/Base/Text/BaseText.test.js +0 -0
- /package/{src → package/src}/stories/Base/Text/BaseText.vue +0 -0
- /package/{src → package/src}/stories/Breadcrumb/Admin/Breadcrumb.stories.js +0 -0
- /package/{src → package/src}/stories/Breadcrumb/Admin/Breadcrumb.vue +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/Detail/TournamentCardDetail.stories.js +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/Detail/TournamentCardDetail.vue +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/Header/TournamentCardHeader.stories.js +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/Header/TournamentCardHeader.vue +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/TournamentCard.stories.js +0 -0
- /package/{src → package/src}/stories/Cards/TournamentCard/TournamentCard.vue +0 -0
- /package/{src → package/src}/stories/Containers/Grid/GridContainer.stories.js +0 -0
- /package/{src → package/src}/stories/Containers/Grid/GridContainer.vue +0 -0
- /package/{src → package/src}/stories/Filters/FilterAndSortBar/FilterAndSortBar.stories.js +0 -0
- /package/{src → package/src}/stories/Filters/FilterAndSortBar/FilterAndSortBar.vue +0 -0
- /package/{src → package/src}/stories/Filters/FilterUpcomingPast/FilterUpcomingPast.stories.js +0 -0
- /package/{src → package/src}/stories/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +0 -0
- /package/{src → package/src}/stories/Menu/Admin/AdminLeftMenu.stories.js +0 -0
- /package/{src → package/src}/stories/Menu/Admin/AdminLeftMenu.vue +0 -0
- /package/{src → package/src}/stories/Menu/DropDown/DropDownMenu.stories.js +0 -0
- /package/{src → package/src}/stories/Menu/DropDown/DropDownMenu.vue +0 -0
|
@@ -0,0 +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
|
+
};
|
|
@@ -0,0 +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>
|
|
@@ -0,0 +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
|
+
};
|
|
@@ -0,0 +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>
|
|
@@ -0,0 +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
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="border border-dropdownSelect rounded-lg p-9 bg-neutral">
|
|
3
|
+
<div class="my-4">
|
|
4
|
+
<FilterUpcomingPast :selected="selectedTimeFrame" @timeFrame="handleTimeFrameChange"/>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="my-4">
|
|
7
|
+
<FilterAndSortBar :items="dropdownItems" :label="label" :selectedItem="selectedItem" @filterbar="handleFilter" @sort="handleSort"/>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 gap-6 w-full">
|
|
10
|
+
<div v-for="item in filteredItems" :key="item.id">
|
|
11
|
+
<component :is="component" :detail="item" />
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import BaseText from "../../Atoms/Text/BaseText.vue";
|
|
21
|
+
import TournamentCard from "../../Organisms/TournamentCard/TournamentCard.vue";
|
|
22
|
+
import FilterAndSortBar from "../../Molecules/Filters/FilterAndSortBar/FilterAndSortBar.vue";
|
|
23
|
+
import FilterUpcomingPast from "../../Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.vue";
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
name: 'GridContainer',
|
|
27
|
+
components: {
|
|
28
|
+
FilterAndSortBar,
|
|
29
|
+
BaseText,
|
|
30
|
+
TournamentCard,
|
|
31
|
+
FilterUpcomingPast
|
|
32
|
+
},
|
|
33
|
+
props: {
|
|
34
|
+
items: {
|
|
35
|
+
type: Array,
|
|
36
|
+
default: () => []
|
|
37
|
+
},
|
|
38
|
+
component: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true
|
|
41
|
+
},
|
|
42
|
+
label: {
|
|
43
|
+
type: String,
|
|
44
|
+
},
|
|
45
|
+
dropdownItems: {
|
|
46
|
+
type: Array,
|
|
47
|
+
default: () => []
|
|
48
|
+
},
|
|
49
|
+
selectedItem: null
|
|
50
|
+
},
|
|
51
|
+
data() {
|
|
52
|
+
return {
|
|
53
|
+
filterOn: '',
|
|
54
|
+
sortCriteria: 'Date',
|
|
55
|
+
selectedTimeFrame: 'All'
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
computed: {
|
|
59
|
+
filteredItems() {
|
|
60
|
+
let result = this.items;
|
|
61
|
+
|
|
62
|
+
if (this.filterOn.trim()) {
|
|
63
|
+
const lowerCaseSearchText = this.filterOn.toLowerCase();
|
|
64
|
+
result = result.filter(item =>
|
|
65
|
+
Object.values(item).some(value =>
|
|
66
|
+
typeof value === 'string' && value.toLowerCase().includes(lowerCaseSearchText)
|
|
67
|
+
)
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const currentDate = new Date();
|
|
72
|
+
currentDate.setHours(0, 0, 0, 0);
|
|
73
|
+
switch (this.selectedTimeFrame) {
|
|
74
|
+
case 'Upcoming':
|
|
75
|
+
result = result.filter(item => new Date(item.date) >= currentDate);
|
|
76
|
+
break;
|
|
77
|
+
case 'Past':
|
|
78
|
+
result = result.filter(item => new Date(item.date) < currentDate);
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
switch(this.sortCriteria) {
|
|
83
|
+
case 'Date':
|
|
84
|
+
result = [...result].sort((a, b) => new Date(a.date) - new Date(b.date));
|
|
85
|
+
break;
|
|
86
|
+
case 'Name':
|
|
87
|
+
result = [...result].sort((a, b) => a.name.localeCompare(b.name));
|
|
88
|
+
break;
|
|
89
|
+
case 'Location':
|
|
90
|
+
result = [...result].sort((a, b) => a.location.localeCompare(b.location));
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
methods: {
|
|
97
|
+
handleFilter(filterText) {
|
|
98
|
+
this.filterOn = filterText;
|
|
99
|
+
},
|
|
100
|
+
handleSort(criteria) {
|
|
101
|
+
this.sortCriteria = criteria.text;
|
|
102
|
+
},
|
|
103
|
+
handleTimeFrameChange(timeFrame) {
|
|
104
|
+
this.selectedTimeFrame = timeFrame;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
</script>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import AvatarUploader from './ImageCropper.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Organisms/ImageCropper',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
component: AvatarUploader,
|
|
7
|
+
argTypes: {}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = args => ({
|
|
11
|
+
components: { AddTournamentPageOne },
|
|
12
|
+
setup() {
|
|
13
|
+
return {
|
|
14
|
+
args: {
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const Default = {
|
|
23
|
+
args: {
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="">
|
|
3
|
+
<img
|
|
4
|
+
class="h-40 w-96 border-2 border-dashed rounded-lg"
|
|
5
|
+
:src="userPicUrl"
|
|
6
|
+
@error=""
|
|
7
|
+
v-bind:alt="personID"
|
|
8
|
+
@click="setShowCropper()"
|
|
9
|
+
/>
|
|
10
|
+
<avatar-cropper
|
|
11
|
+
@uploading="handleUploading"
|
|
12
|
+
@uploaded="handleUploaded"
|
|
13
|
+
@completed="handleCompleted"
|
|
14
|
+
@error="handlerError"
|
|
15
|
+
v-model="showCropper"
|
|
16
|
+
:upload-url="`./uploads/${personID}`"
|
|
17
|
+
:cropper-options="{
|
|
18
|
+
aspectRatio: 8/3,
|
|
19
|
+
autoCropArea: 1,
|
|
20
|
+
viewMode: 1,
|
|
21
|
+
movable: true,
|
|
22
|
+
zoomable: true }"
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
</section>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import AvatarCropper from 'vue-avatar-cropper'
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: 'GenericImageCropper',
|
|
33
|
+
props: {
|
|
34
|
+
personID: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 1
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
components: {
|
|
40
|
+
AvatarCropper
|
|
41
|
+
},
|
|
42
|
+
data() {
|
|
43
|
+
return {
|
|
44
|
+
showCropper: false,
|
|
45
|
+
userPicUrl: ''
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
mounted() {
|
|
49
|
+
this.getImgUrl(this.personID)
|
|
50
|
+
},
|
|
51
|
+
watch: {
|
|
52
|
+
personID: {
|
|
53
|
+
immediate: true,
|
|
54
|
+
handler(newVal, oldVal) {
|
|
55
|
+
this.getImgUrl(newVal)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
methods: {
|
|
60
|
+
getImgUrl(id) {
|
|
61
|
+
//this.userPicUrl = `${ferrotasNodeServer}/uploads/${id}.png?${Date.now()}`
|
|
62
|
+
this.userPicUrl = '../../../../src/assets/select-tournament.png'
|
|
63
|
+
},
|
|
64
|
+
setShowCropper() {
|
|
65
|
+
this.showCropper = true
|
|
66
|
+
},
|
|
67
|
+
handleUploading() {
|
|
68
|
+
this.userPicUrl = `./uploads/default.jpeg`
|
|
69
|
+
this.message = 'uploading...'
|
|
70
|
+
},
|
|
71
|
+
handleUploaded(response) {
|
|
72
|
+
if (response.response.status === 200) {
|
|
73
|
+
this.getImgUrl(this.personID)
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
handleCompleted() {
|
|
77
|
+
this.message = 'upload completed.'
|
|
78
|
+
},
|
|
79
|
+
handlerError(message, type, xhr) {
|
|
80
|
+
console.error(`${message} ${type} ${xhr}`)
|
|
81
|
+
this.message = 'Oops! Something went wrong...'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
86
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import TextBoxEditor from './TextBoxEditor.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Organisms/TextBoxEditor',
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
component: TextBoxEditor,
|
|
7
|
+
argTypes: {}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = args => ({
|
|
11
|
+
components: { TextBoxEditor },
|
|
12
|
+
setup() {
|
|
13
|
+
return {
|
|
14
|
+
args: {
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const Default = {
|
|
23
|
+
args: {
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="border rounded-lg text-secondary text-sm p-4 w-full" :class="invalid ? 'border-alarm' : 'border-dropdownSelect'">
|
|
3
|
+
<div data-testid="editor-buttons" class="w-full flex flex-row pl-2">
|
|
4
|
+
<div class="w-1/3 border-r border-dropdownSelect flex flex-row justify-between pr-2">
|
|
5
|
+
<BaseButton iconName="fa-h1" label="" type="editor"
|
|
6
|
+
:selected="editor && editor.isActive('heading', { level: 1 })"
|
|
7
|
+
@click="editor.chain().toggleHeading({ level: 1 }).run()" />
|
|
8
|
+
<BaseButton iconName="fa-h2" label="" type="editor"
|
|
9
|
+
:selected="editor && editor.isActive('heading', { level: 2 })"
|
|
10
|
+
@click="editor.chain().toggleHeading({ level: 2 }).run()"/>
|
|
11
|
+
<BaseButton iconName="fa-h3" label="" type="editor"
|
|
12
|
+
:selected="editor && editor.isActive('heading', { level: 3 })"
|
|
13
|
+
@click="editor.chain().toggleHeading({ level: 3 }).run()"/>
|
|
14
|
+
<BaseButton iconName="fa-paragraph" label="" type="editor"
|
|
15
|
+
:selected="editor && editor.isActive('paragraph')"
|
|
16
|
+
@click="editor.chain().setParagraph().run()"/>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="w-1/3 border-r border-dropdownSelect flex flex-row justify-around">
|
|
19
|
+
<BaseButton :selected="editor && editor.isActive('bold')" iconName="fa-bold" label="" type="editor"
|
|
20
|
+
@click="editor && editor.chain().toggleBold().run()"/>
|
|
21
|
+
<BaseButton :selected="editor && editor.isActive('italic')" iconName="fa-italic" label="" type="editor"
|
|
22
|
+
@click="editor && editor.chain().toggleItalic().run()"/>
|
|
23
|
+
<BaseButton :selected="editor && editor.isActive('strike')" iconName="fa-strikethrough" label="" type="editor"
|
|
24
|
+
@click="editor && editor.chain().toggleStrike().run()"/>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="w-1/3 flex flex-row justify-between pl-2">
|
|
27
|
+
<BaseButton :selected="editor && editor.isActive({ textAlign: 'left' })" iconName="fa-align-left" label="" type="editor"
|
|
28
|
+
@click="editor.chain().setTextAlign('left').run()"/>
|
|
29
|
+
<BaseButton :selected="editor && editor.isActive({ textAlign: 'center' })" iconName="fa-align-center" label="" type="editor"
|
|
30
|
+
@click="editor && editor.chain().setTextAlign('center').run()"/>
|
|
31
|
+
<BaseButton :selected="editor && editor.isActive({ textAlign: 'right' })" iconName="fa-align-right" label="" type="editor"
|
|
32
|
+
@click="editor && editor.chain().setTextAlign('right').run()"/>
|
|
33
|
+
<BaseButton :selected="editor && editor.isActive({ textAlign: 'justify' })" iconName="fa-align-justify" label="" type="editor"
|
|
34
|
+
@click="editor && editor.chain().setTextAlign('justify').run()"/>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<p class="my-4 my-2 p-4 rounded-xl h-40 bg-tertiary overflow-auto">
|
|
39
|
+
<editor-content :editor="editor" class="focus:shadow-none focus:outline-none"/>
|
|
40
|
+
</p>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script>
|
|
45
|
+
import { ref } from 'vue';
|
|
46
|
+
import {EditorContent, useEditor} from '@tiptap/vue-3'
|
|
47
|
+
import StarterKit from '@tiptap/starter-kit'
|
|
48
|
+
import Highlight from '@tiptap/extension-highlight'
|
|
49
|
+
import TextAlign from '@tiptap/extension-text-align'
|
|
50
|
+
import BaseButton from "../../Molecules/Button/BaseButton.vue";
|
|
51
|
+
|
|
52
|
+
export default {
|
|
53
|
+
components: {
|
|
54
|
+
EditorContent,
|
|
55
|
+
BaseButton
|
|
56
|
+
},
|
|
57
|
+
props: {
|
|
58
|
+
invalid: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
data() {
|
|
64
|
+
return {
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
setup(props, {emit}) {
|
|
68
|
+
const editorContent = ref("");
|
|
69
|
+
|
|
70
|
+
const editor = useEditor({
|
|
71
|
+
content: "",
|
|
72
|
+
extensions: [
|
|
73
|
+
StarterKit,
|
|
74
|
+
Highlight,
|
|
75
|
+
TextAlign.configure({
|
|
76
|
+
types: ['heading', 'paragraph'],
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
editorProps: {
|
|
80
|
+
attributes: {
|
|
81
|
+
class: 'focus:outline-none',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
onUpdate({ editor }) {
|
|
85
|
+
editorContent.value = editor.getHTML();
|
|
86
|
+
emit('update:editorContent', editorContent.value);
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
return {editor, editorContent}
|
|
91
|
+
},
|
|
92
|
+
methods: {
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import TournamentCard from './TournamentCard.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Organisms/TournamentCard',
|
|
5
|
+
component: TournamentCard,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {
|
|
8
|
+
detail: {
|
|
9
|
+
control: {
|
|
10
|
+
type: 'object',
|
|
11
|
+
defaultValue: {
|
|
12
|
+
artwork: '',
|
|
13
|
+
tags: ['tag1', 'tag2'],
|
|
14
|
+
name: 'Tournament Name',
|
|
15
|
+
description: 'Tournament Description',
|
|
16
|
+
date: '2023-09-20',
|
|
17
|
+
closes: '2023-09-21',
|
|
18
|
+
location: 'Tournament Location - City, State'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Default = {
|
|
26
|
+
args: {
|
|
27
|
+
detail: {
|
|
28
|
+
artwork: '',
|
|
29
|
+
tags: ['tag1', 'tag2'],
|
|
30
|
+
name: 'Tournament Name',
|
|
31
|
+
description: 'Tournament Description',
|
|
32
|
+
date: '2023-09-20',
|
|
33
|
+
closes: '2023-09-21',
|
|
34
|
+
location: 'Tournament Location - City, State'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="rounded-xl w-72 shadow">
|
|
3
|
+
<TournamentHeader :artwork="detail.artwork" :tags="detail.tags" />
|
|
4
|
+
<TournamentDetail :detail="detail" />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import TournamentHeader from '../../Molecules/Cards/Header/TournamentCardHeader.vue';
|
|
10
|
+
import TournamentDetail from '../../Molecules/Cards/Detail/TournamentCardDetail.vue';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: 'TournamentCard',
|
|
14
|
+
components: {
|
|
15
|
+
TournamentHeader,
|
|
16
|
+
TournamentDetail
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
detail: {
|
|
20
|
+
type: Object,
|
|
21
|
+
required: true,
|
|
22
|
+
default: () => ({
|
|
23
|
+
artwork: '',
|
|
24
|
+
tags: [],
|
|
25
|
+
name: '',
|
|
26
|
+
description: '',
|
|
27
|
+
date: '',
|
|
28
|
+
closes: '',
|
|
29
|
+
location: ''
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import AddTournamentPageOne from './AddTournamentPageOne.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Templates/Forms/AddTournamentForm/PageOne',
|
|
5
|
+
component: AddTournamentPageOne,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = args => ({
|
|
11
|
+
components: { AddTournamentPageOne },
|
|
12
|
+
setup() {
|
|
13
|
+
return {
|
|
14
|
+
args: {
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const Default = {
|
|
23
|
+
args: {
|
|
24
|
+
}
|
|
25
|
+
};
|