Skip to content

Commit

Permalink
Merge pull request #436 from bethinkpl/fix-basic-rich-list-item-text-…
Browse files Browse the repository at this point in the history
…group-loading-state
  • Loading branch information
tweetgeek authored Nov 7, 2024
2 parents 8ce4958 + 918d2b5 commit b82abb7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
:is-selected="isSelected"
class="ds-basicRichListItem"
:class="{
'-ds-loading': state === RICH_LIST_ITEM_STATE.LOADING,
'-ds-small': size === RICH_LIST_ITEM_SIZE.SMALL,
}"
@mouseover="hovered = true"
Expand Down Expand Up @@ -77,6 +78,12 @@
padding: $space-2xs 0;
}
}
&.-ds-loading {
#{$root}__content {
flex: 1;
}
}
}
</style>

Expand Down Expand Up @@ -249,6 +256,7 @@ export default defineComponent({
return {
hovered: false,
RICH_LIST_ITEM_SIZE: Object.freeze(RICH_LIST_ITEM_SIZE),
RICH_LIST_ITEM_STATE: Object.freeze(RICH_LIST_ITEM_STATE),
};
},
computed: {
Expand All @@ -261,12 +269,12 @@ export default defineComponent({
return map[this.size];
},
textGroupState(): TextGroupState {
if (this.hovered && this.isInteractive) {
return TEXT_GROUP_STATES.HOVERED;
}
if (this.state === RICH_LIST_ITEM_STATE.LOADING) {
return TEXT_GROUP_STATES.LOADING;
}
if (this.hovered && this.isInteractive) {
return TEXT_GROUP_STATES.HOVERED;
}
return TEXT_GROUP_STATES.DEFAULT;
},
},
Expand Down

0 comments on commit b82abb7

Please # to comment.