Skip to content

Commit

Permalink
fix: improved types
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitano committed Nov 5, 2021
1 parent 1121f4b commit 733c6f8
Show file tree
Hide file tree
Showing 24 changed files with 53 additions and 29 deletions.
11 changes: 11 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,15 @@ export {

export * from './src/components/VToast';
export * from './src/utils';
export * from './src/components/VAppBar/VAppBar';
export * from './src/components/VBadge/VBadge';
export * from './src/components/VBreadcrumbs/VBreadcrumbs';
export * from './src/components/VBtn/VBtn';
export * from './src/components/VDataTable/VDataTable';
export * from './src/components/VDropdown/VDropdown';
export * from './src/components/VInput/VInput';
export * from './src/components/VNavbar/VNavbar';
export * from './src/components/VTabs/VTabs';
export * from './src/components/VToast/VToast';
export * from './src/components/VModal/VModal';
export default plugin;
Empty file removed src/components/VAlert/VAlert.d.ts
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type {PropType} from 'vue';
import {VPagination} from '../VPagination/VPagination';

export interface VDataTableItem {
Expand Down
File renamed without changes.
18 changes: 14 additions & 4 deletions src/components/VEditor/VEditor.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<script lang="ts">
export default {
inheritAttrs: false,
};
</script>

<script setup lang="ts">
import {defineAsyncComponent, ref, toRefs, watch} from 'vue';
import {defineAsyncComponent, PropType, ref, toRefs, watch} from 'vue';
import {ErrorMessage} from 'vee-validate';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
import {component as ckeditor} from '@ckeditor/ckeditor5-vue';
Expand All @@ -11,11 +17,11 @@ const VTextarea = defineAsyncComponent(
const props = defineProps({
modelValue: {
type: String,
default: null,
default: '',
},
value: {
type: String,
default: null,
default: '',
},
name: {
type: String,
Expand All @@ -26,14 +32,18 @@ const props = defineProps({
default: false,
},
errorMessages: {
type: Array,
type: Array as PropType<string[]>,
default: () => [],
},
theme: {
type: String,
default: 'ckeditor',
validator: (v: string) => ['quill', 'ckeditor', 'textarea'].includes(v),
},
readonly: {
type: Boolean,
default: false,
},
});
const emit = defineEmits([
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 24 additions & 9 deletions src/components/VNavDrawer/VNavDrawer.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script setup lang="ts">
import { computed, PropType, toRefs } from 'vue';
import { XIcon } from '@heroicons/vue/outline';
import {computed, PropType, toRefs} from 'vue';
import {XIcon} from '@heroicons/vue/outline';
import VMenu from '../VMenu/VMenu.vue';
import VLogo from '../VLogo/VLogo.vue';
import { ChevronLeftIcon } from '@heroicons/vue/solid';
import { getBgColor } from '../../utils';
import { VNavbarMenuItem } from '../../../types';
import {ChevronLeftIcon} from '@heroicons/vue/solid';
import {getBgColor} from '../../utils';
import {VNavbarMenuItem} from '../VNavbar/VNavbar';
const props = defineProps({
modelValue: {
Expand Down Expand Up @@ -42,7 +42,7 @@ const props = defineProps({
},
});
const { modelValue, mini, menus, logoProps, dark, color, hideToggle } =
const {modelValue, mini, menus, logoProps, dark, color, hideToggle} =
toRefs(props);
const emit = defineEmits(['update:modelValue', 'update:mini', 'toggle:click']);
Expand Down Expand Up @@ -77,7 +77,19 @@ const bgColor = computed(() =>
</transition>

<div
class="fixed top-0 left-0 z-20 h-screen min-h-screen shadow-md p-2 transition-all duration-300 flex flex-col"
class="
fixed
top-0
left-0
z-20
h-screen
min-h-screen
shadow-md
p-2
transition-all
duration-300
flex flex-col
"
:class="[
bgColor,
mini
Expand All @@ -86,7 +98,7 @@ const bgColor = computed(() =>
]"
>
<div class="hidden sm:block">
<slot v-if="!hideToggle" name="toggle" :on="{ click: toggleMenu }">
<slot v-if="!hideToggle" name="toggle" :on="{click: toggleMenu}">
<v-btn
size="sm"
icon
Expand All @@ -97,7 +109,10 @@ const bgColor = computed(() =>
color="primary"
@click="toggleMenu"
>
<ChevronLeftIcon class="w-5 h-5" :class="[mini ? 'rotate-180' : '']" />
<ChevronLeftIcon
class="w-5 h-5"
:class="[mini ? 'rotate-180' : '']"
/>
</v-btn>
</slot>
<slot v-if="mini" name="logo.mini" />
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/VStats/VStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {computed, ref, toRefs} from 'vue';
import VCard from '../VCard/VCard.vue';
import VBadge from '../VBadge/VBadge.vue';
import VueFeather from 'vue-feather';
import {Colors} from '../../../types';
import {Colors} from '../../types';
interface Props {
title?: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/VSwitch/VSwitch.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import {toRefs, watch, computed, ref, inject} from 'vue';
import {Switch, SwitchGroup, SwitchLabel} from '@headlessui/vue';
import type {Colors} from '../../../types';
import type {Colors} from '../../types';
const props = defineProps({
modelValue: {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/VToast/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './composition';
export * from './module';
export * from './VToast.d';
export * from './VToast';
File renamed without changes.
12 changes: 0 additions & 12 deletions src/types/index.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './colors';

0 comments on commit 733c6f8

Please sign in to comment.