Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(components): remove warnings first batch #1575

Merged
merged 9 commits into from
Jul 26, 2024
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<!-- eslint-disable-next-line vue/attributes-order -->
<transition v-bind="$attrs" v-on="$listeners" name="x-animate-width-">
<transition name="x-animate-width-">
<!-- @slot (Required) Transition content -->
<slot />
</transition>
Expand All @@ -15,8 +14,7 @@
* @public
*/
export default defineComponent({
name: 'AnimateWidth',
inheritAttrs: false
name: 'AnimateWidth'
});
</script>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<!-- eslint-disable vue/attributes-order -->
<transition
v-bind="$attrs"
v-on="$listeners"
@enter="expand"
@after-enter="cleanUpAnimationStyles"
@leave="collapse"
Expand All @@ -26,7 +23,6 @@
*/
export default defineComponent({
name: 'CollapseHeight',
inheritAttrs: false,
props: {
/**
* Indicates if the transition must be applied on the initial render of the node.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<!-- eslint-disable vue/attributes-order -->
<transition
v-bind="$attrs"
v-on="$listeners"
@enter="expand"
@after-enter="cleanUpAnimationStyles"
@leave="collapse"
Expand All @@ -26,7 +23,6 @@
*/
export default defineComponent({
name: 'CollapseWidth',
inheritAttrs: false,
props: {
/**
* Indicates if the transition must be applied on the initial render of the node.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<!-- eslint-disable-next-line vue/attributes-order -->
<transition v-bind="$attrs" v-on="$listeners" name="x-cross-fade-" :appear="appear">
<transition name="x-cross-fade-" :appear="appear">
<!-- @slot (Required) to add content to the transition -->
<slot />
</transition>
Expand All @@ -17,7 +16,6 @@
*/
export default defineComponent({
name: 'CrossFade',
inheritAttrs: false,
props: {
/**
* Indicates if the transition must be applied on the initial render of the node.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<template>
<!-- eslint-disable vue/attributes-order -->
<transition-group
v-bind="$attrs"
v-on="$listeners"
class="x-fade-and-slide"
:name="name"
:tag="tag"
:appear="appear"
>
<transition-group class="x-fade-and-slide" :name="name" :tag="tag" :appear="appear">
<!-- @slot (Required) Transition-group content -->
<slot />
</transition-group>
Expand All @@ -25,7 +17,6 @@
*/
export default defineComponent({
name: 'FadeAndSlide',
inheritAttrs: false,
props: {
/**
* HTML Element that the transition-group children will be wrapped in.
Expand Down
4 changes: 1 addition & 3 deletions packages/x-components/src/components/animations/fade.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<!-- eslint-disable-next-line vue/attributes-order -->
<transition v-bind="$attrs" v-on="$listeners" name="x-fade-" :appear="appear">
<transition name="x-fade-" :appear="appear">
<!-- @slot (Required) to add content to the transition -->
<slot />
</transition>
Expand All @@ -17,7 +16,6 @@
*/
export default defineComponent({
name: 'Fade',
inheritAttrs: false,
props: {
/** Indicates if the transition must be applied on the initial render of the node. */
appear: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<template>
<!-- eslint-disable vue/attributes-order -->
<StaggeringTransitionGroup
v-bind="$attrs"
v-on="$listeners"
class="x-staggered-fade-and-slide"
:name="name"
:appear="appear"
>
<StaggeringTransitionGroup class="x-staggered-fade-and-slide" :name="name" :appear="appear">
<!-- @slot (Required) Transition-group content -->
<slot />
</StaggeringTransitionGroup>
Expand All @@ -26,7 +19,6 @@
export default defineComponent({
name: 'StaggeredFadeAndSlide',
components: { StaggeringTransitionGroup },
inheritAttrs: false,
props: {
/**
* Indicates if the transition must be applied on the initial render of the node.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<button ref="rootRef" v-on="$listeners" @click="emitEvents" data-test="event-button">
<button ref="rootRef" @click="emitEvents" data-test="event-button">
<!-- @slot (Required) Button content with a text, an icon or both -->
<slot />
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<BaseEventButton
v-on="$listeners"
:events="events"
class="x-events-modal-close-button x-button"
data-test="close-modal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<BaseEventButton
v-on="$listeners"
:events="events"
class="x-events-modal-open-button x-button"
data-test="open-modal"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<BaseEventsModalClose
v-on="$listeners"
class="x-close-main-modal"
data-test="close-main-modal"
:closingEvent="closingEvent"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<BaseEventsModalOpen
v-on="$listeners"
class="x-open-main-modal"
data-test="open-main-modal"
:openingEvent="openingEvent"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<BaseEventButton
v-on="$listeners"
:events="events"
class="x-base-id-toggle-panel-button x-button"
data-test="base-id-toggle-button"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<BaseEventButton
v-on="$listeners"
:events="events"
class="x-result-add-to-cart x-button"
data-test="result-add-to-cart"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<button ref="el" @click="emitEvents" v-on="$listeners" :class="dynamicCSSClasses">
<button ref="el" @click="emitEvents" :class="dynamicCSSClasses">
<!--
@slot Button content
@binding {Suggestion} suggestion - Suggestion data
Expand Down
24 changes: 2 additions & 22 deletions packages/x-components/src/store/x.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,7 @@ export type XModuleState = { [Key in keyof RootXStoreState['x']]: null };
*
* @internal
*/
export const RootXStoreModule: Module<XModuleState, any> = {
state: () => ({
device: null,
empathize: null,
extraParams: null,
facets: null,
historyQueries: null,
identifierResults: null,
nextQueries: null,
popularSearches: null,
queriesPreview: null,
querySuggestions: null,
recommendations: null,
relatedTags: null,
scroll: null,
search: null,
searchBox: null,
semanticQueries: null,
tagging: null,
url: null,
experienceControls: null
}),
export const RootXStoreModule: Module<any, any> = {
state: () => ({}),
namespaced: true
};
2 changes: 1 addition & 1 deletion packages/x-components/src/views/home/aside.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ClearFilters />
<SelectedFiltersList>
<template #default="{ filter }">
<SimpleFilter :filter="filter" class="x-facet-filter-success">
<SimpleFilter :filter="filter" :cssClasses="['x-facet-filter-success']">
<template #label>{{ filter.label ?? filter.id }}</template>
</SimpleFilter>
</template>
Expand Down
2 changes: 1 addition & 1 deletion packages/x-components/src/views/home/result.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
required: true
}
},
data() {
setup() {
return {
crossFade: CrossFade
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Facet, Filter, isHierarchicalFacet } from '@empathyco/x-types';
import { computed, defineComponent, h, PropType, Ref, ref, watch } from 'vue';
import { computed, defineComponent, PropType, Ref, ref, watch } from 'vue';
import { clone } from '../../../../utils';
import { areFiltersDifferent } from '../../../../utils/filters';
import { GroupId } from '../../store/types';
Expand Down Expand Up @@ -110,9 +110,7 @@
{ immediate: true }
);

return () => {
return h();
};
return () => '';
joseacabaneros marked this conversation as resolved.
Show resolved Hide resolved
}
});
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Dictionary } from '@empathyco/x-utils';
import { computed, defineComponent, h, PropType } from 'vue';
import { computed, defineComponent, PropType } from 'vue';
import { BooleanFilter } from '@empathyco/x-types';
import { useXBus } from '../../../../composables/use-x-bus';
import { XEvent, XEventsTypes } from '../../../../wiring/events.types';
Expand All @@ -20,6 +20,7 @@
export default defineComponent({
name: 'RenderlessFilter',
xModule: facetsXModule.name,
inheritAttrs: false,
props: {
/** The filter data to render. */
filter: {
Expand Down Expand Up @@ -66,7 +67,7 @@
clickFilter: emitClickEvents,
cssClasses: innerCssClasses.value,
isDisabled: isDisabled.value
}) ?? h();
}) ?? '';
joseacabaneros marked this conversation as resolved.
Show resolved Hide resolved
}
});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
isVisible.value
? slots.default?.({ selectedFilters: selectedFilters.value })[0] ??
h('span', `${selectedFilters.value.length}`)
: h();
: '';
}
});
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<BaseEventButton
v-on="$listeners"
:events="events"
class="x-query-preview-button x-button"
data-test="query-preview-button"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<component :is="tag" ref="rootRef" v-on="$listeners" :data-scroll="item.id">
<component :is="tag" ref="rootRef" :data-scroll="item.id">
<slot />
</component>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
@scroll:at-start="emitScrollAtStart"
@scroll:almost-at-end="emitScrollAlmostAtEnd"
@scroll:at-end="emitScrollAtEnd"
v-on="$listeners"
v-bind="$attrs"
:id="id"
>
<slot />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
@keydown.enter="emitUserPressedEnterKey"
@keydown.up.down.prevent="emitUserPressedArrowKey"
@beforeinput="preventSpecialKey"
v-on="$listeners"
:maxlength="maxLength"
:value="query"
autocomplete="off"
Expand Down
Loading