Skip to content

Commit

Permalink
fix(animation): fix Expected Object, got Function on animations props (
Browse files Browse the repository at this point in the history
  • Loading branch information
joseacabaneros authored May 30, 2024
1 parent b72296c commit 4467edc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
13 changes: 3 additions & 10 deletions packages/x-components/src/components/base-dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,8 @@

<script lang="ts">
import { Identifiable } from '@empathyco/x-types';
import Vue, {
computed,
defineComponent,
nextTick,
onBeforeUnmount,
PropType,
ref,
watch
} from 'vue';
import { computed, defineComponent, nextTick, onBeforeUnmount, PropType, ref, watch } from 'vue';
import { AnimationProp } from '../types';
import { getTargetElement } from '../utils/html';
import { normalizeString } from '../utils/normalize';
import { isInRange } from '../utils/number';
Expand Down Expand Up @@ -123,7 +116,7 @@
* so only `<transition>` components are allowed.
*/
animation: {
type: Object as PropType<string | typeof Vue>,
type: AnimationProp,
default: () => NoElement
},
/** Time to wait without receiving any keystroke before resetting the items search query. */
Expand Down
16 changes: 5 additions & 11 deletions packages/x-components/src/components/modals/base-modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,10 @@
</template>

<script lang="ts">
import Vue, {
defineComponent,
nextTick,
onBeforeUnmount,
onMounted,
PropType,
ref,
watch
} from 'vue';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import Vue, { defineComponent, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { useDebounce } from '../../composables/use-debounce';
import { AnimationProp } from '../../types';
import { getTargetElement } from '../../utils/html';
import Fade from '../animations/fade.vue';
import { NoElement } from '../no-element';
Expand Down Expand Up @@ -77,15 +71,15 @@
referenceSelector: String,
/** Animation to use for opening/closing the modal.This animation only affects the content. */
animation: {
type: Object as PropType<string | typeof Vue>,
type: AnimationProp,
default: () => NoElement
},
/**
* Animation to use for the overlay (backdrop) part of the modal. By default, it uses
* a fade transition.
*/
overlayAnimation: {
type: Object as PropType<string | typeof Vue>,
type: AnimationProp,
default: () => Fade
},
/** Class inherited by content element. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
* @public
*/
resetOn: {
type: Array as PropType<XEvent | XEvent[]>,
type: [String, Array] as PropType<XEvent | XEvent[]>,
default: () => [
'SearchBoxQueryChanged',
'SortChanged',
Expand Down

0 comments on commit 4467edc

Please sign in to comment.