This commit is contained in:
Calum H. (IMB11)
2026-07-31 13:45:26 +01:00
parent da52062fab
commit 23933c1f49
8 changed files with 53 additions and 4 deletions
@@ -9,6 +9,9 @@
:min-date="ANALYTICS_START_DATE_INPUT_VALUE"
:now-timestamp="queryRefreshTimestamp"
:trigger-class="triggerClass"
:trigger-type="triggerType"
:trigger-size="triggerSize"
:trigger-interaction="triggerInteraction"
@open="handleTimeframeOpen"
@commit="handleTimeframeCommit"
@apply="handleTimeframeApply"
@@ -23,6 +26,9 @@
<script setup lang="ts">
import {
type ButtonInteraction,
type ButtonSize,
type ButtonType,
type ComboboxOption,
TimeFramePicker as BaseTimeFramePicker,
type TimeFramePickerSelection,
@@ -58,6 +64,9 @@ const {
defineProps<{
triggerClass?: string
triggerType?: ButtonType
triggerSize?: ButtonSize
triggerInteraction?: ButtonInteraction
}>()
const draftSelectedGroupBy = ref(selectedGroupBy.value)
@@ -16,6 +16,7 @@
:max-tag-rows="1"
:trigger-class="analyticsQueryChipTriggerClass"
fit-content
trigger-type="base"
checkbox-position="right"
show-selection-actions
@open="handleProjectSelectOpen"
@@ -145,6 +146,7 @@
:dropdown-min-width="QUERY_BUILDER_DROPDOWN_MIN_WIDTH"
:display-value="selectedGroupByLabel"
:trigger-class="analyticsQueryChipTriggerClass"
trigger-type="base"
>
<template #prefix>
<ClockIcon class="size-5 shrink-0 text-primary" />
@@ -160,6 +162,7 @@
:dropdown-min-width="QUERY_BUILDER_DROPDOWN_MIN_WIDTH"
:trigger-class="analyticsQueryChipTriggerClass"
fit-content
trigger-type="base"
checkbox-position="right"
:placeholder="formatMessage(analyticsMessages.none)"
show-selection-actions
@@ -214,6 +217,7 @@
:searchable="projectOptions.length > 6"
fuzzy-search
:max-tag-rows="1"
trigger-type="base"
checkbox-position="right"
show-selection-actions
@open="handleProjectSelectOpen"
@@ -372,6 +376,7 @@
:options="groupByOptions"
:max-height="QUERY_BUILDER_DROPDOWN_MAX_HEIGHT"
:dropdown-min-width="QUERY_BUILDER_DROPDOWN_MIN_WIDTH"
trigger-type="base"
/>
</div>
</div>
@@ -401,6 +406,7 @@
:max-height="QUERY_BUILDER_DROPDOWN_MAX_HEIGHT"
:dropdown-width="QUERY_BUILDER_DROPDOWN_MIN_WIDTH"
:dropdown-min-width="QUERY_BUILDER_DROPDOWN_MIN_WIDTH"
trigger-type="base"
checkbox-position="right"
:placeholder="formatMessage(analyticsMessages.none)"
show-selection-actions
+6
View File
@@ -335,6 +335,7 @@
label: formatMessage(messages.lookupByEmail),
type: 'link',
to: '/admin/user_email',
tone: 'brand',
shown: isAdmin(auth.user),
},
{
@@ -342,6 +343,7 @@
label: formatMessage(messages.manageAffiliates),
type: 'link',
to: '/admin/affiliates',
tone: 'brand',
shown: isAdmin(auth.user),
},
{
@@ -349,6 +351,7 @@
label: formatMessage(messages.manageServerNotices),
type: 'link',
to: '/admin/servers/notices',
tone: 'brand',
shown: isAdmin(auth.user),
},
{
@@ -356,12 +359,14 @@
label: 'Server transfers',
type: 'link',
to: '/admin/servers/transfers',
tone: 'brand',
shown: isAdmin(auth.user),
},
{
id: 'servers-nodes',
label: 'Credit server nodes',
action: (event) => $refs.modal_batch_credit.show(event),
tone: 'brand',
shown: isAdmin(auth.user),
},
{
@@ -369,6 +374,7 @@
label: formatMessage(messages.analyticsEvents),
type: 'link',
to: '/admin/analytics/events',
tone: 'brand',
shown: isAdmin(auth.user),
},
]"
@@ -61,6 +61,7 @@
:searchable="reporterOrProjectOptions.length > 6"
:max-tag-rows="1"
fit-content
trigger-type="base"
checkbox-position="right"
show-selection-actions
should-show-select-all
@@ -20,6 +20,8 @@
:fit-content="true"
:searchable="preview.category.searchable"
:search-placeholder="preview.category.searchPlaceholder"
trigger-type="base"
trigger-size="lg"
:trigger-class="effectivePreviewTriggerClass"
:dropdown-width="getPreviewDropdownWidth(preview.category)"
:dropdown-min-width="getPreviewDropdownMinWidth(preview.category)"
@@ -748,8 +750,7 @@ const appliedFilterPreviews = computed(() =>
const hasAppliedFilters = computed(() => appliedFilterPreviews.value.length > 0)
const shouldShowClear = computed(() => hasAppliedFilters.value || props.showClear)
const DEFAULT_PREVIEW_TRIGGER_CLASS =
'h-10 max-w-[16rem] bg-surface-4 px-4 py-1.5 transition-all bg-surface-4 hover:brightness-110 active:brightness-110'
const DEFAULT_PREVIEW_TRIGGER_CLASS = 'max-w-[16rem]'
const effectivePreviewTriggerClass = computed(
() => props.previewTriggerClass ?? DEFAULT_PREVIEW_TRIGGER_CLASS,
)
@@ -420,7 +420,12 @@ import {
import { useVirtualScroll } from '../../composables/virtual-scroll'
import ButtonFrame from './buttons/ButtonFrame.vue'
import type { ButtonElementHandle, ButtonSize, ButtonType } from './buttons/types'
import type {
ButtonElementHandle,
ButtonInteraction,
ButtonSize,
ButtonType,
} from './buttons/types'
import StyledInput from './StyledInput.vue'
export interface MultiSelectOption<T> {
@@ -501,6 +506,7 @@ const props = withDefaults(
/** Apply the shared button frame to compact, button-owned multiselect triggers. */
triggerType?: ButtonType
triggerSize?: ButtonSize
triggerInteraction?: ButtonInteraction
fitContent?: boolean
/** Width for the teleported dropdown; defaults to the trigger width */
dropdownWidth?: string | number
@@ -527,6 +533,7 @@ const props = withDefaults(
clearable: true,
maxHeight: DEFAULT_MAX_HEIGHT,
triggerSize: 'md',
triggerInteraction: 'surface',
fitContent: false,
noOptionsMessage: 'No options available',
noResultsMessage: 'No results found',
@@ -556,6 +563,7 @@ const triggerButtonProps = computed(() =>
nativeType: 'button' as const,
type: props.triggerType,
size: props.triggerSize,
interaction: props.triggerInteraction,
disabled: props.disabled,
}
: {},
@@ -5,6 +5,9 @@
:display-value="selectedTimeframeLabel"
:max-height="maxHeight"
:trigger-class="triggerClass"
:trigger-type="triggerType"
:trigger-size="triggerSize"
:trigger-interaction="triggerInteraction"
:dropdown-min-width="timeframeDropdownMinWidth"
:outside-click-ignore="timeframeDropdownOutsideClickIgnore"
:dropdown-class="
@@ -189,7 +192,12 @@
</template>
<script setup lang="ts">
import { Button } from '#ui/components/base/buttons'
import {
Button,
type ButtonInteraction,
type ButtonSize,
type ButtonType,
} from '#ui/components/base/buttons'
import { MinusIcon, PlusIcon } from '@modrinth/assets'
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
@@ -387,11 +395,17 @@ const props = withDefaults(
nowTimestamp?: number
maxHeight?: number
triggerClass?: string
triggerType?: ButtonType
triggerSize?: ButtonSize
triggerInteraction?: ButtonInteraction
dropdownMinWidth?: string | number
customRangeDropdownMinWidth?: string | number
}>(),
{
maxHeight: TIMEFRAME_DROPDOWN_MAX_HEIGHT,
triggerType: 'base',
triggerSize: 'md',
triggerInteraction: 'surface',
dropdownMinWidth: TIMEFRAME_DROPDOWN_MIN_WIDTH,
customRangeDropdownMinWidth: CUSTOM_RANGE_DROPDOWN_MIN_WIDTH,
},
@@ -266,6 +266,7 @@ const moreActions = computed<OverflowMenuOption[]>(() => [
label: formatMessage(messages.billingButton),
icon: CurrencyIcon,
action: () => emit('openBilling'),
tone: 'orange',
shown: props.showStaffActions && props.isStaff,
},
{
@@ -284,6 +285,7 @@ const moreActions = computed<OverflowMenuOption[]>(() => [
label: formatMessage(messages.infoButton),
icon: InfoIcon,
action: () => emit('openInfo'),
tone: 'orange',
shown: props.showStaffActions && props.isStaff,
},
{
@@ -291,6 +293,7 @@ const moreActions = computed<OverflowMenuOption[]>(() => [
label: formatMessage(messages.analyticsButton),
icon: ChartIcon,
action: () => emit('openAnalytics'),
tone: 'orange',
shown: props.showStaffActions && props.isAdmin,
},
{
@@ -298,6 +301,7 @@ const moreActions = computed<OverflowMenuOption[]>(() => [
label: formatMessage(messages.editRoleButton),
icon: EditIcon,
action: () => emit('editRole'),
tone: 'orange',
shown: props.showStaffActions && props.isAdmin,
},
])