mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-02 18:07:51 +00:00
* fix(nc-gui): some ts warnings * fix(nc-gui): columnFilter file warnings * fix(nc-gui): fix ts errors * fix(nc-gui): pr review changes * fix(nc-gui): update NcCheckbox change event * fix(nc-gui): pr review changes
45 lines
1.0 KiB
Vue
45 lines
1.0 KiB
Vue
<script lang="ts" setup>
|
|
interface Props {
|
|
checked?: boolean
|
|
size?: 'small' | 'default' | 'large'
|
|
disabled?: boolean
|
|
}
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
size: 'default',
|
|
disabled: false,
|
|
})
|
|
|
|
const emit = defineEmits(['change', 'update:checked'])
|
|
|
|
const checked = useVModel(props, 'checked', emit)
|
|
|
|
const onChange = (e: Event) => {
|
|
emit('change', e, (e.target as HTMLInputElement).checked)
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<a-checkbox v-model:checked="checked" class="nc-checkbox" :disabled="props.disabled" @change="onChange">
|
|
<slot />
|
|
</a-checkbox>
|
|
</template>
|
|
|
|
<style>
|
|
.nc-checkbox {
|
|
@apply flex flex-row !items-center;
|
|
}
|
|
.nc-checkbox > .ant-checkbox {
|
|
@apply flex !border-0 !p-0 !h-4 !w-4 !rounded !-mt-1.5 mr-0.75 shadow-sm shadow-gray-100;
|
|
}
|
|
.nc-checkbox > .ant-checkbox > .ant-checkbox-input {
|
|
@apply !p-0 !h-4 !w-4 !border-0;
|
|
}
|
|
.nc-checkbox > .ant-checkbox::after {
|
|
@apply !border-0 !h-4 !w-4 !rounded;
|
|
}
|
|
.nc-checkbox > .ant-checkbox > .ant-checkbox-inner {
|
|
@apply !h-4 !w-4 !rounded;
|
|
}
|
|
</style>
|