diff --git a/packages/x-components/src/components/__tests__/no-element.spec.ts b/packages/x-components/src/components/__tests__/no-element.spec.ts deleted file mode 100644 index e9febd19d5..0000000000 --- a/packages/x-components/src/components/__tests__/no-element.spec.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { mount } from '@vue/test-utils'; -import { getDataTestSelector } from '../../__tests__/utils'; -import { NoElement } from '../no-element'; - -describe('testing no component', () => { - it('renders the first node passed in the default slot and bind the css classes', () => { - const wrapper = mount({ - template: ` - -
test
-
`, - components: { - NoElement - } - }); - expect(wrapper.find(getDataTestSelector('node')).element).toBeDefined(); - expect(wrapper.find(getDataTestSelector('node')).classes()).toEqual(['test']); - }); -}); diff --git a/packages/x-components/src/components/animations/index.ts b/packages/x-components/src/components/animations/index.ts index 26240a7f04..2c4fb0a84c 100644 --- a/packages/x-components/src/components/animations/index.ts +++ b/packages/x-components/src/components/animations/index.ts @@ -4,6 +4,7 @@ export { default as CollapseWidth } from './collapse-width.vue'; export { default as CrossFade } from './cross-fade.vue'; export { default as Fade } from './fade.vue'; export { default as FadeAndSlide } from './fade-and-slide.vue'; +export { default as NoAnimation } from './no-animation.vue'; export { default as StaggeredFadeAndSlide } from './staggered-fade-and-slide.vue'; export { default as StaggeringTransitionGroup } from './staggering-transition-group.vue'; export { createDirectionalAnimationFactory } from './create-directional-animation-factory'; diff --git a/packages/x-components/src/components/animations/no-animation.vue b/packages/x-components/src/components/animations/no-animation.vue new file mode 100644 index 0000000000..86034a9501 --- /dev/null +++ b/packages/x-components/src/components/animations/no-animation.vue @@ -0,0 +1,14 @@ + diff --git a/packages/x-components/src/components/base-dropdown.vue b/packages/x-components/src/components/base-dropdown.vue index b40341033d..4bacbb459c 100644 --- a/packages/x-components/src/components/base-dropdown.vue +++ b/packages/x-components/src/components/base-dropdown.vue @@ -80,11 +80,8 @@ import { Identifiable } from '@empathyco/x-types'; 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'; - import { debounce as debounceFunction } from '../utils/debounce'; - import { NoElement } from './no-element'; + import { debounceFunction, normalizeString, getTargetElement, isInRange } from '../utils'; + import { NoAnimation } from './animations'; type DropdownItem = string | number | Identifiable; let dropdownCount = 0; @@ -95,7 +92,6 @@ */ export default defineComponent({ name: 'BaseDropdown', - components: { NoElement }, props: { /** List of items to display.*/ items: { @@ -117,7 +113,7 @@ */ animation: { type: AnimationProp, - default: () => NoElement + default: () => NoAnimation }, /** Time to wait without receiving any keystroke before resetting the items search query. */ searchTimeoutMs: { diff --git a/packages/x-components/src/components/display-emitter.vue b/packages/x-components/src/components/display-emitter.vue index 720c9a0506..59a9d1e667 100644 --- a/packages/x-components/src/components/display-emitter.vue +++ b/packages/x-components/src/components/display-emitter.vue @@ -2,7 +2,6 @@ import { defineComponent, getCurrentInstance, - h, onMounted, onUnmounted, PropType, @@ -30,7 +29,7 @@ let unwatchDisplay: WatchStopHandle | undefined; onMounted(() => { - const element = getCurrentInstance()?.proxy.$el as HTMLElement | undefined; + const element = getCurrentInstance()?.proxy?.$el as HTMLElement | undefined; if (element) { unwatchDisplay = useEmitDisplayEvent({ element, diff --git a/packages/x-components/src/components/filters/labels/base-price-filter-label.vue b/packages/x-components/src/components/filters/labels/base-price-filter-label.vue index 40de7cfa04..048330fc5e 100644 --- a/packages/x-components/src/components/filters/labels/base-price-filter-label.vue +++ b/packages/x-components/src/components/filters/labels/base-price-filter-label.vue @@ -1,5 +1,5 @@ diff --git a/packages/x-components/src/components/index.ts b/packages/x-components/src/components/index.ts index 911e226bae..3f751fbb89 100644 --- a/packages/x-components/src/components/index.ts +++ b/packages/x-components/src/components/index.ts @@ -24,7 +24,6 @@ export { default as GlobalXBus } from './global-x-bus.vue'; export { default as Highlight } from './highlight.vue'; export { default as ItemsList } from './items-list.vue'; export { default as LocationProvider } from './location-provider.vue'; -export { NoElement } from './no-element'; export { default as SlidingPanel } from './sliding-panel.vue'; export { default as SnippetCallbacks } from './snippet-callbacks.vue'; export { default as PageLoaderButton } from './page-loader-button.vue'; diff --git a/packages/x-components/src/components/location-provider.vue b/packages/x-components/src/components/location-provider.vue index 0dc38d159b..74568b3d77 100644 --- a/packages/x-components/src/components/location-provider.vue +++ b/packages/x-components/src/components/location-provider.vue @@ -1,7 +1,6 @@ diff --git a/packages/x-components/src/components/modals/base-events-modal.vue b/packages/x-components/src/components/modals/base-events-modal.vue index 4d4a7fe449..db99852842 100644 --- a/packages/x-components/src/components/modals/base-events-modal.vue +++ b/packages/x-components/src/components/modals/base-events-modal.vue @@ -1,6 +1,5 @@ diff --git a/packages/x-components/src/components/modals/base-id-modal-open.vue b/packages/x-components/src/components/modals/base-id-modal-open.vue index 0c4e201c57..acc11f96a7 100644 --- a/packages/x-components/src/components/modals/base-id-modal-open.vue +++ b/packages/x-components/src/components/modals/base-id-modal-open.vue @@ -1,27 +1,17 @@ diff --git a/packages/x-components/src/components/modals/base-id-modal.vue b/packages/x-components/src/components/modals/base-id-modal.vue index 4525b49d41..e52d10d1e1 100644 --- a/packages/x-components/src/components/modals/base-id-modal.vue +++ b/packages/x-components/src/components/modals/base-id-modal.vue @@ -1,6 +1,5 @@