* Projects page * Continue work on bulk edit * editLinks is now bulkEdit * Bulk Edit Links completed * Edit URL clear fields. * Create project button + other bulk buttons. * Pagination (w/o reactivity.) * Apply suggestions from code review Co-authored-by: triphora <emmaffle@modrinth.com> * Sorting fixed, broken page count though? * Only make editable projects selectable + remove delete button * Shorthand * Start using computed * Fix pagination * Add Pagination Switching * Final Style Changes * Cleanup * Action Affects dropdown * Switch to checkbox swizzle * Projects dashboard, the most hellish thing I have ever worked on * Rewrite project dashboard without tables * why's that there * Fix mod message icon * New project settings page * Remove extra slash * Bulk project route and improve styling of links UI * Remove beta label from Monetization * Relevant page links in project settings * Don't vertically center header rows * Improve error messages, add remove project icon button, add saving feedback, begin project checklist, fix license settings * Remove contextual link from project settings, disable WIP checklist * Fix bulk edit * Project checklist, add featured gallery image to project pages, fix random bugs * Remove old check * Remove icon border on grid mode and hide project status card when unnecessary * Fix build * Make checklist progress smaller and add collapsing * Remove uneven gap on nav cards * Improve wrapping of checklist * Replace project settings header link with status * Fix bugs + status stuff * Fix warns + compile error * Update wording * Hide environment type nag for project types without it * Make member dropdown match Co-authored-by: mineblock11 <93472213+mineblock11@users.noreply.github.com> Co-authored-by: triphora <emmaffle@modrinth.com> Co-authored-by: Jai A <jaiagr+gpg@pm.me> Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
138 lines
2.5 KiB
Vue
138 lines
2.5 KiB
Vue
<template>
|
|
<div
|
|
class="checkbox-outer button-within"
|
|
:class="{ disabled }"
|
|
role="presentation"
|
|
@click="toggle"
|
|
>
|
|
<button
|
|
class="checkbox"
|
|
role="checkbox"
|
|
:disabled="disabled"
|
|
:class="{ checked: value, collapsing: collapsingToggleStyle }"
|
|
:aria-label="description"
|
|
:aria-checked="value"
|
|
>
|
|
<CheckIcon v-if="value && !collapsingToggleStyle" aria-hidden="true" />
|
|
<DropdownIcon v-else-if="collapsingToggleStyle" aria-hidden="true" />
|
|
</button>
|
|
<!-- aria-hidden is set so screenreaders only use the <button>'s aria-label -->
|
|
<p v-if="label" aria-hidden="true">{{ label }}</p>
|
|
<slot v-else />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import CheckIcon from '~/assets/images/utils/check.svg?inline'
|
|
import DropdownIcon from '~/assets/images/utils/dropdown.svg?inline'
|
|
|
|
export default {
|
|
name: 'Checkbox',
|
|
components: {
|
|
CheckIcon,
|
|
DropdownIcon,
|
|
},
|
|
props: {
|
|
label: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
description: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
value: Boolean,
|
|
clickEvent: {
|
|
type: Function,
|
|
default: () => {},
|
|
},
|
|
collapsingToggleStyle: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
},
|
|
methods: {
|
|
toggle() {
|
|
if (!this.disabled) {
|
|
this.$emit('input', !this.value)
|
|
}
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.checkbox-outer {
|
|
display: flex;
|
|
align-items: center;
|
|
cursor: pointer;
|
|
|
|
p {
|
|
user-select: none;
|
|
padding: 0.2rem 0;
|
|
margin: 0;
|
|
}
|
|
|
|
&.disabled {
|
|
cursor: not-allowed;
|
|
}
|
|
}
|
|
|
|
.checkbox {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
|
|
min-width: 1rem;
|
|
min-height: 1rem;
|
|
|
|
padding: 0;
|
|
margin: 0 0.5rem 0 0;
|
|
|
|
color: var(--color-button-text);
|
|
background-color: var(--color-button-bg);
|
|
border-radius: var(--size-rounded-control);
|
|
box-shadow: var(--shadow-inset-sm), 0 0 0 0 transparent;
|
|
|
|
&.checked {
|
|
background-color: var(--color-brand);
|
|
}
|
|
|
|
svg {
|
|
color: var(--color-brand-inverted);
|
|
stroke-width: 0.2rem;
|
|
height: 0.8rem;
|
|
width: 0.8rem;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
&.collapsing {
|
|
background-color: transparent !important;
|
|
box-shadow: none;
|
|
|
|
svg {
|
|
color: inherit;
|
|
height: 1rem;
|
|
width: 1rem;
|
|
transition: transform 0.25s ease-in-out;
|
|
}
|
|
|
|
&.checked {
|
|
svg {
|
|
transform: rotate(180deg);
|
|
}
|
|
}
|
|
}
|
|
|
|
&:disabled {
|
|
box-shadow: none;
|
|
cursor: not-allowed;
|
|
}
|
|
}
|
|
</style>
|