Skip to content

Commit

Permalink
Revert "fix(staggered-fade-and-slide): add data-index attr to animati…
Browse files Browse the repository at this point in the history
…on components"

This reverts commit e915a31.
  • Loading branch information
victorcg88 committed Aug 15, 2024
1 parent 4e36f7d commit b75e5c6
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<button @click="reset">Reset</button>

<StaggeredFadeAndSlide :stagger="500">
<li v-for="(item, index) in items" :key="item.id" :data-index="index">
<li v-for="item in items" :key="item.id">
{{ item.id }} - {{ item.name }}
<button @click="remove(item)">x</button>
</li>
Expand All @@ -21,9 +21,9 @@
<br />
<h1>Static content:</h1>
<StaggeredFadeAndSlide :stagger="50">
<li key="1" data-index="0">Element to animate</li>
<li key="2" data-index="1">Element to animate</li>
<li key="3" data-index="2">Element to animate</li>
<li key="1">Element to animate</li>
<li key="2">Element to animate</li>
<li key="3">Element to animate</li>
</StaggeredFadeAndSlide>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ or the `stagger` props:

```vue
<StaggeredFadeAndSlide tag="ul" :stagger="50">
<li key="1" data-index="0">Element to animate</li>
<li key="2" data-index="1">Element to animate</li>
<li key="3" data-index="2">Element to animate</li>
<li key="1">Element to animate</li>
<li key="2">Element to animate</li>
<li key="3">Element to animate</li>
</StaggeredFadeAndSlide>
```
</docs>
7 changes: 1 addition & 6 deletions packages/x-components/src/components/base-dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@
role="listbox"
tabindex="-1"
>
<li
v-for="(item, index) in items"
:key="item.id || item"
:data-index="index"
class="x-dropdown__list-item"
>
<li v-for="(item, index) in items" :key="item.id || item" class="x-dropdown__list-item">
<button
:ref="el => (itemsButtonRefs[index] = el)"
@click="emitSelectedItemChanged(item)"
Expand Down
3 changes: 1 addition & 2 deletions packages/x-components/src/components/items-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
data-test="items-list"
>
<li
v-for="(item, index) in computedItems"
v-for="item in computedItems"
:key="item.id"
:data-index="index"
class="x-items-list__item"
:class="item.class"
:data-test="item.dataTest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<li
v-for="(suggestion, index) in suggestionsToRender"
:key="suggestionsKeys[index]"
:data-index="index"
class="x-suggestions__item"
:class="suggestionItemClass"
data-test="suggestion-item"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<component :is="animation" v-if="hasFacets" class="x-facets-list" data-test="facets" tag="ul">
<li
v-for="({ facet, slotNameById, slotNameByModelName }, facetId, index) in mappedFacets"
v-for="({ facet, slotNameById, slotNameByModelName }, facetId) in mappedFacets"
:key="facetId"
:data-index="index"
class="x-facets-list__item"
data-test="facets-facet"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
data-test="base-filters"
>
<li
v-for="(filter, index) in renderedFilters"
v-for="filter in renderedFilters"
:key="filter.id"
:data-index="index"
class="x-filters__item"
data-test="base-filters-item"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
tag="ul"
>
<li
v-for="({ slotName, selectedFilter }, index) in mapSlot(selectedFilters)"
v-for="{ slotName, selectedFilter } in mapSlot(selectedFilters)"
:key="selectedFilter.id"
:data-index="index"
class="x-selected-filters-list__item"
data-test="selected-filters-list-item"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<component :is="animation" v-if="hasHistoryQueries" class="x-my-history" tag="ul">
<li
v-for="(historyQueries, date, index) in groupByDate"
v-for="(historyQueries, date) in groupByDate"
:key="date"
:data-index="index"
class="x-my-history-item"
data-test="my-history-item"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<component :is="animation" v-if="identifierResults.length" tag="ul" class="x-identifier-results">
<li
v-for="(identifierResult, index) in identifierResultsToRender"
v-for="identifierResult in identifierResultsToRender"
:key="identifierResult.id"
:data-index="index"
class="x-identifier-results__item"
data-test="identifier-results-item"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<li
v-for="(queryPreview, index) in renderedQueryPreviews"
:key="index"
:data-index="index"
data-test="query-preview-item"
>
<QueryPreview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
class="x-recommendations"
>
<li
v-for="(recommendation, index) in recommendations"
v-for="recommendation in recommendations"
:key="recommendation.id"
:data-index="index"
class="x-recommendations__item"
data-test="recommendation-item"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
data-test="related-tags"
>
<li
v-for="(relatedTag, index) in relatedTags"
v-for="relatedTag in relatedTags"
:key="relatedTag.query"
:data-index="index"
class="x-related-tags__item"
data-test="related-tag-item"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<li
v-for="(partialResult, index) in partialResults"
:key="`${partialResult.query}-${index}`"
:data-index="index"
class="x-partial-result"
data-test="partial-result"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<component :is="animation" tag="ul" class="x-option-list x-sort-list" data-test="sort-list">
<li
v-for="({ item, cssClasses, event }, index) in listItems"
v-for="{ item, cssClasses, event } in listItems"
:key="item"
:data-index="index"
:class="cssClasses"
class="x-option-list__item x-sort-list__item"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
role="list"
>
<BaseEventButton
v-for="({ item, cssClasses, event }, index) in listItems"
v-for="{ item, cssClasses, event } in listItems"
:key="item"
:data-index="index"
:class="[cssClasses, buttonClass]"
data-test="sort-picker-button"
:events="event"
Expand Down

0 comments on commit b75e5c6

Please sign in to comment.