Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
chore: adjust typings, fix duplicate key error
Browse files Browse the repository at this point in the history
  • Loading branch information
tewshi authored and kelsos committed Aug 24, 2023
1 parent f9cbe67 commit dfa08ad
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 101 deletions.
6 changes: 3 additions & 3 deletions example/src/views/DataTableView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ onBeforeMount(() => {
<div class="grid grid-cols-1 gap-12 mb-14">
<div
v-for="({ title, table, emptySlot }, i) in emptyTables"
:key="i"
:key="`${title}${i}`"
class="flex flex-col space-y-3"
:data-cy="title"
>
Expand Down Expand Up @@ -645,7 +645,7 @@ onBeforeMount(() => {

<div
v-for="({ title, table }, i) in datatables"
:key="i"
:key="`${title}${i}`"
class="flex flex-col space-y-3"
:data-cy="title"
>
Expand Down Expand Up @@ -683,7 +683,7 @@ onBeforeMount(() => {
<div class="grid grid-cols-1 gap-12">
<div
v-for="({ title, table }, i) in apiDatatables"
:key="i"
:key="`${title}${i}`"
class="flex flex-col space-y-3"
:data-cy="title"
>
Expand Down
7 changes: 2 additions & 5 deletions example/src/views/ProgressView.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<script lang="ts" setup>
import { RuiProgress } from '@rotki/ui-library-compat';
import { type ProgressProps, RuiProgress } from '@rotki/ui-library-compat';
import { ref } from 'vue';
import { type DataType } from '@/types';
type ProgressData = DataType<typeof RuiProgress, number>;
const progress = ref<ProgressData[]>([
const progress = ref<ProgressProps[]>([
{
value: 40,
color: 'primary',
Expand Down
13 changes: 9 additions & 4 deletions example/src/views/TextFieldView.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<script lang="ts" setup>
import { RuiRevealableTextField, RuiTextField } from '@rotki/ui-library-compat';
import {
RuiRevealableTextField,
RuiTextField,
type TextFieldProps,
} from '@rotki/ui-library-compat';
import { ref } from 'vue';
import { type DataType, type Slots } from '@/types';
import { objectOmit } from '@vueuse/shared';
import { type Slots } from '@/types';
type TextFieldData = DataType<typeof RuiTextField, string> & Slots;
type TextFieldData = TextFieldProps & Slots;
const textFields = ref<TextFieldData[]>([
{ value: '', color: 'primary' },
Expand Down Expand Up @@ -211,7 +216,7 @@ const revealableTextFields = ref([
:key="i"
v-model="field.value"
placeholder="Placeholder"
v-bind="field"
v-bind="objectOmit(field, ['value'])"
/>
</div>
</div>
Expand Down
178 changes: 89 additions & 89 deletions example/src/views/TooltipView.vue
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
<script lang="ts" setup>
import {
type ButtonProps,
RuiButton,
RuiTooltip,
type TooltipProps,
} from '@rotki/ui-library-compat/components';
import { objectOmit } from '@vueuse/shared';
import { ref } from 'vue';
import { type DataType } from '@/types';
const tooltips = ref<
(TooltipProps & { buttonColor?: DataType<typeof RuiButton>['color'] })[]
>([
{
disabled: false,
hideArrow: true,
text: 'Bottom',
buttonColor: 'primary',
popper: { placement: 'bottom' },
},
{
disabled: false,
hideArrow: true,
text: 'Top',
buttonColor: 'secondary',
popper: { placement: 'top' },
},
{
disabled: false,
hideArrow: true,
text: 'Left',
buttonColor: 'error',
popper: { placement: 'left' },
},
{
disabled: false,
hideArrow: true,
text: 'Right',
buttonColor: 'info',
popper: { placement: 'right' },
},
{
disabled: false,
hideArrow: false,
text: 'Bottom With arrow',
buttonColor: 'primary',
popper: { placement: 'bottom' },
},
{
disabled: false,
hideArrow: false,
text: 'Top With arrow',
buttonColor: 'secondary',
popper: { placement: 'top' },
},
{
disabled: false,
hideArrow: false,
text: 'Left With arrow',
buttonColor: 'error',
popper: { placement: 'left' },
},
{
disabled: false,
hideArrow: false,
text: 'Right With arrow',
buttonColor: 'info',
popper: { placement: 'right' },
},
{
disabled: true,
hideArrow: false,
text: 'Tooltip disabled',
buttonColor: 'primary',
popper: { placement: 'bottom' },
},
{
disabled: true,
hideArrow: false,
text: 'Tooltip disabled',
buttonColor: 'secondary',
popper: { placement: 'top' },
},
{
disabled: true,
hideArrow: false,
text: 'Tooltip disabled',
buttonColor: 'error',
popper: { placement: 'left' },
},
{
disabled: true,
hideArrow: false,
text: 'Tooltip disabled',
buttonColor: 'info',
popper: { placement: 'right' },
},
]);
const tooltips = ref<(TooltipProps & { buttonColor?: ButtonProps['color'] })[]>(
[
{
disabled: false,
hideArrow: true,
text: 'Bottom',
buttonColor: 'primary',
popper: { placement: 'bottom' },
},
{
disabled: false,
hideArrow: true,
text: 'Top',
buttonColor: 'secondary',
popper: { placement: 'top' },
},
{
disabled: false,
hideArrow: true,
text: 'Left',
buttonColor: 'error',
popper: { placement: 'left' },
},
{
disabled: false,
hideArrow: true,
text: 'Right',
buttonColor: 'info',
popper: { placement: 'right' },
},
{
disabled: false,
hideArrow: false,
text: 'Bottom With arrow',
buttonColor: 'primary',
popper: { placement: 'bottom' },
},
{
disabled: false,
hideArrow: false,
text: 'Top With arrow',
buttonColor: 'secondary',
popper: { placement: 'top' },
},
{
disabled: false,
hideArrow: false,
text: 'Left With arrow',
buttonColor: 'error',
popper: { placement: 'left' },
},
{
disabled: false,
hideArrow: false,
text: 'Right With arrow',
buttonColor: 'info',
popper: { placement: 'right' },
},
{
disabled: true,
hideArrow: false,
text: 'Tooltip disabled',
buttonColor: 'primary',
popper: { placement: 'bottom' },
},
{
disabled: true,
hideArrow: false,
text: 'Tooltip disabled',
buttonColor: 'secondary',
popper: { placement: 'top' },
},
{
disabled: true,
hideArrow: false,
text: 'Tooltip disabled',
buttonColor: 'error',
popper: { placement: 'left' },
},
{
disabled: true,
hideArrow: false,
text: 'Tooltip disabled',
buttonColor: 'info',
popper: { placement: 'right' },
},
],
);
</script>

<template>
Expand Down

0 comments on commit dfa08ad

Please sign in to comment.