Skip to content

Commit

Permalink
fix(kemptystate): add title slot, tweak action slot
Browse files Browse the repository at this point in the history
  • Loading branch information
portikM committed Mar 5, 2024
1 parent 3551d76 commit 0ad2ccd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
26 changes: 26 additions & 0 deletions docs/components/empty-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,32 @@ Slot for passing message content. When provided, takes precedence over the [`mes
</KEmptyState>
```

### title

Slot for passing title text.

<KEmptyState
action-button-text="Action"
message="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec purus feugiat, molestie ipsum et, consequat nibh."
title="Lorem Ipsum Dolor Sit Amet"
>
<template #title>
Empty State Slotted Title
</template>
</KEmptyState>

```html
<KEmptyState
action-button-text="Action"
message="Lorem ipsum dolor sit amet..."
title="Lorem Ipsum Dolor Sit Amet"
>
<template #title>
<h1>Empty State Slotted Title</h1>
</template>
</KEmptyState>
```

### icon

Slot for providing custom icon.
Expand Down
8 changes: 4 additions & 4 deletions docs/components/pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Pass in a boolean value for whether or not the offset-based next button should b

## Events

### pageChange
### page-change

Emitted when the page has been changed. The page number is returned starting at 1 rather than 0 to be easier to use directly in the UI.

Expand All @@ -225,7 +225,7 @@ Emitted when the page has been changed. The page number is returned starting at
}
```

### pageSizeChange
### page-size-change

Emitted when the number of items per page has been changed.

Expand All @@ -236,11 +236,11 @@ Emitted when the number of items per page has been changed.
}
```

### getNextOffset
### get-next-offset

Emitted when next arrow button clicked when [`offset` prop](#offset) is true.

### getPreviousOffset
### get-previous-offset

Emitted when previous arrow button clicked when [`offset` prop](#offset) is true.

Expand Down
1 change: 0 additions & 1 deletion docs/guide/migrating-to-version-9.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ Component has been renamed to `KDropdown`

#### Slots

* `title` slot has been removed. You can use the new `title` prop instead
* `message` slot has been renamed to `default`
* `cta` slot has been renamed to `action`

Expand Down
12 changes: 7 additions & 5 deletions src/components/KEmptyState/KEmptyState.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
/>
</slot>
</div>
<span
v-if="title"
<div
v-if="title || $slots.title"
class="empty-state-title"
>
{{ title }}
</span>
<slot name="title">
{{ title }}
</slot>
</div>
<div
v-if="message || $slots.default"
class="empty-state-message"
Expand All @@ -31,7 +33,7 @@
</div>
</div>
<div
v-if="actionButtonVisible && (actionButtonText || $slots.action)"
v-if="(actionButtonVisible && actionButtonText) || $slots.action"
class="empty-state-action"
>
<slot name="action">
Expand Down

0 comments on commit 0ad2ccd

Please sign in to comment.