mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-03 00:26:47 +00:00
* feat: basic ui for aggregation * feat: update aggregation in ui * feat: aggregation api implementation * feat: attachment aggregation.ts * fix: some changes * fix: rebase * feat: aggregation for links, rollup, ltar, formula, lookup * fix: type errors * fix: move from data-alias controller, service to data-table service, controller * chore: inline docs for aggregations * fix: handle edge cases * fix: ui bugs * feat: working ui aggregation * fix: minor issue * fix: rollup and links fix count * fix: handle ID Column * fix: minor fixes * fix: update aggregation on data change * fix: round to 2 decimal places * fix: stddev computation error replace with stddev_pop * fix: use pg age function * feat: new record layout * fix: shared view aggregations * feat: aggregations based on formula result * fix: temp pagination * feat: ncpagination v2 * feat: ncpagination v2 * fix: playwright tests * fix: pending changes * fix: failing tests * feat: mysql2 aggregations * fix: build * fix: record count * fix: cleanup * fix: disable count aggregation * feat: expiremental sqlite3 aggregation * fix: mysql2 median * fix:minor issues * refactor: rename column to column_query fix: remove default aggregations fix: disable aggregation for specific dbtype and Foreign Key * fix: remove unwanted else case * fix: aggregation not loading * fix: rebase * fix: rebase * fix: pagination fixed height * fix: respect locked mode for aggregations * fix: pagination component * fix: pagination component * fix: replace Math.random
80 lines
1.8 KiB
Vue
80 lines
1.8 KiB
Vue
<script lang="ts" setup>
|
|
const props = withDefaults(
|
|
defineProps<{
|
|
trigger?: Array<'click' | 'hover' | 'contextmenu'>
|
|
visible?: boolean | undefined
|
|
overlayClassName?: string | undefined
|
|
disabled?: boolean
|
|
placement?: 'bottom' | 'top' | 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight' | 'topCenter' | 'bottomCenter'
|
|
autoClose?: boolean
|
|
}>(),
|
|
{
|
|
trigger: () => ['click'],
|
|
visible: undefined,
|
|
placement: 'bottomLeft',
|
|
disabled: false,
|
|
overlayClassName: undefined,
|
|
autoClose: true,
|
|
},
|
|
)
|
|
|
|
const emits = defineEmits(['update:visible'])
|
|
|
|
const trigger = toRef(props, 'trigger')
|
|
|
|
const overlayClassName = toRef(props, 'overlayClassName')
|
|
|
|
const placement = toRef(props, 'placement')
|
|
|
|
const autoClose = computed(() => props.autoClose)
|
|
|
|
const overlayClassNameComputed = computed(() => {
|
|
let className = 'nc-dropdown bg-white rounded-lg border-1 border-gray-200 shadow-lg'
|
|
if (overlayClassName.value) {
|
|
className += ` ${overlayClassName.value}`
|
|
}
|
|
return className
|
|
})
|
|
|
|
const visible = useVModel(props, 'visible', emits)
|
|
|
|
onKeyStroke('Escape', () => {
|
|
if (visible.value && autoClose.value) {
|
|
visible.value = false
|
|
}
|
|
})
|
|
|
|
const overlayWrapperDomRef = ref<HTMLElement | null>(null)
|
|
|
|
onClickOutside(overlayWrapperDomRef, () => {
|
|
if (!autoClose.value) return
|
|
|
|
visible.value = false
|
|
})
|
|
|
|
const onVisibleUpdate = (event: any) => {
|
|
if (visible !== undefined) {
|
|
visible.value = event
|
|
} else {
|
|
emits('update:visible', event)
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<a-dropdown
|
|
:disabled="disabled"
|
|
:visible="visible"
|
|
:placement="placement"
|
|
:trigger="trigger"
|
|
:overlay-class-name="overlayClassNameComputed"
|
|
@update:visible="onVisibleUpdate"
|
|
>
|
|
<slot />
|
|
|
|
<template #overlay>
|
|
<slot ref="overlayWrapperDomRef" name="overlay" />
|
|
</template>
|
|
</a-dropdown>
|
|
</template>
|