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

feat(ktable): component reskin [KHCP-9002] #2151

Merged
merged 34 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
83f8fa2
fix(deps): update dependency @kong/icons to ^1.9.0 (#2144)
renovate[bot] Apr 17, 2024
ff63495
chore(release): 9.0.0-alpha.145 [skip ci]
semantic-release-bot Apr 17, 2024
9e5cd34
chore(deps): update dependency @kong-ui-public/sandbox-layout to ^2.0…
renovate[bot] Apr 18, 2024
c8c663d
feat(kcodeblock, kcatalog, kcollapse, kstepper): components reskin (#…
portikM Apr 18, 2024
ec8f19c
chore(release): 9.0.0-alpha.146 [skip ci]
semantic-release-bot Apr 18, 2024
6df3289
chore(deps): update dependency @kong-ui-public/sandbox-layout to ^2.0…
renovate[bot] Apr 18, 2024
45cc18f
feat(ktable): reskin props [KHCP-9002]
portikM Apr 22, 2024
b3866bb
fix(ktable): rename events [KHCP-9002]
portikM Apr 22, 2024
f63454a
fix(ktable): fix sortable prop conditions [KHCP-9002]
portikM Apr 22, 2024
2807d12
test(ktable): fix component tests [KHCP-9002]
portikM Apr 22, 2024
a15bc80
feat(ktable): reskin selectors [KHCP-9002]
portikM Apr 22, 2024
1601898
feat(ktable): reskin component [KHCP-9002]
portikM Apr 22, 2024
2cab21a
fix(ktable): misc fixes & updates [KHCP-9002]
portikM Apr 23, 2024
ad53fac
docs(ktable): update component docs [KHCP-9002]
portikM Apr 24, 2024
8149cd4
docs(tabs): disabled tab tooltip example [KHCP-9002]
portikM Apr 24, 2024
549b5e5
revert(kexternallink): revert changes [KHCP-9002]
portikM Apr 24, 2024
c8dcdfc
feat(ktable): add column header tooltip [KHCP-9002]
portikM Apr 25, 2024
8d3da7c
test(ktable): add column header tooltip test [KHCP-9002]
portikM Apr 25, 2024
062f77e
docs(ktable, kcatalog): pagination section [KHCP-9002]
portikM Apr 25, 2024
d9b9322
docs(ktable): add examples [KHCP-9002]
portikM Apr 25, 2024
513d219
chore: fix package.json [KHCP-9002]
portikM Apr 26, 2024
97a1dd2
fix(ktable): apply pr feedback
portikM Apr 26, 2024
2661f64
fix(ktable): address pr feedback [KHCP-9002]
portikM Apr 26, 2024
b7a2a3c
fix(ktable): minor type fix [KHCP-9002]
portikM Apr 26, 2024
814a9a4
fix: resolve conflicts
portikM May 6, 2024
1327ffe
fix(ktable): minor fix [KHCP-9002]
portikM May 6, 2024
eb4eb08
fix(utilities): remove client side sorter function [KHCP-9002]
portikM May 6, 2024
dd8046b
chore(sandbox): minor tweak [KHCP-9002]
portikM May 6, 2024
b9bfc29
fix(utilities): add client side sorter function back [KHCP-9002]
portikM May 6, 2024
0df734e
fix(ktable): add default sorter function back [KHCP-9002]
portikM May 6, 2024
e4cb43a
docs(table): minor updates [KHCP-9002]
portikM May 6, 2024
a342b76
docs(table): tweak wording [KHCP-9002]
portikM May 7, 2024
6e875e3
docs(table): apply pr feedback
portikM May 7, 2024
b393f49
fix(kskeleton): adjust table row height [KHCP-9002]
portikM May 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 79 additions & 92 deletions docs/components/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,105 +175,22 @@ const itemDeleted = () => {

Pass in a string of search input for server-side table filtering.

### paginationTotalItems
## Pagination

Pass the total number of items in the set to populate the pagination text. See [KPagination component docs](/components/pagination) for more details.
KCatalog uses KPagination component under the hood and exposes a few props as a way to modify how pagination looks and behaves in card catalogs. See [KPagination](/components/pagination.html#props) docs for more details and examples:

If not provided the fetcher response should return a top-level property `total` or return a `data` property that is an array.

### paginationNeighbors

Pass in a number of pagination neighbors to be used by the pagination component. See more detail in the [KPagination component docs](/components/pagination.html#neighbors).

### paginationPageSizes

Pass in an array of page sizes for the page size dropdown. If not provided will default to the following:

```ts
[15, 30, 50, 75, 100]
```

### disablePaginationPageJump

Set this to `true` to limit pagination navigation to `previous` / `next` page only.

<KCatalog :fetcher="fetcher" :disablePaginationPageJump="true" :paginationPageSizes="[4, 5, 6]" :initial-fetcher-params="{ pageSize: 4, page: 1 }" />

```html
<KCatalog :disable-pagination-page-jump="true" :fetcher="fetcher" />
```
* `paginationTotalItems`
* `paginationNeighbors`
* `paginationPageSizes`
* `disablePaginationPageJump`

### disablePagination

Set this to `true` to remove the pagination bar when using a fetcher.
Set this to `true` to hide pagination when using a fetcher.

### hidePaginationWhenOptional

Set this to `true` to hide the pagination UI when the table record count is less than or equal to the `pageSize`.

## KCatalogItem

KCatalog generates a KCatalogItem for each item in the `items` property. At the most basic level, KCatalogItem is a wrapper around KCard to display correctly inside KCatalog. You can use the `body` slot of the KCatalog to manually create your own catalog items.

### Props

#### item

Object instance of `CatalogItem` from which card content is built.

#### truncate

A boolean (default to `true`), whether or not to truncate the description text.

```html
<KCatalogItem :item="item" :truncate="false" class="catalog-item" />
```

### Slots

#### card-title

The title content for the card.

#### card-body

The body content for the card.

#### card-footer

The footer content for the card.

<KCatalogItem>
<template #card-title>
Card Title
</template>
<template #card-body>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nec justo libero. Nullam accumsan quis ipsum vitae tempus. Integer non pharetra orci. Suspendisse potenti.
</template>
<template #card-footer>
<KBadge appearance="neutral">Card footer</KBadge>
</template>
</KCatalogItem>

```html
<KCatalogItem>
<template #card-title>
Card Title
</template>
<template #card-body>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nec justo libero. Nullam accumsan quis ipsum vitae tempus. Integer non pharetra orci. Suspendisse potenti.
</template>
<template #card-footer>
<KBadge appearance="neutral">Card footer</KBadge>
</template>
</KCatalogItem>
```

### Events

#### click

Fired when item is clicked. Event payload is item object.
Set this to `true` to hide pagination when the table record count is less than or equal to the `pageSize`.

## States

Expand All @@ -293,7 +210,9 @@ Set the following props to handle empty state:
- `emptyStateActionMessage` - Button text for empty state action
- `emptyStateActionRoute` - Route for empty state action

:::tip
Should you want to display an icon inside of action button, you can use `empty-state-action-icon` slot.
:::

When empty state action button is clicked, KCatalog emits the `empty-state-action-click` event.

Expand Down Expand Up @@ -480,9 +399,13 @@ The `toolbar` slot allows you to slot catalog controls rendered at the top of th

Slot content to be displayed when empty.

### empty-state-action-icon

Slot for icon to be displayed in front of action button text in empty state. See [empty state](#empty) section for example of usage of this slot.

### error-state

Slot content to be displayed when in an error state.
Slot content to be displayed when in error state.

## Events

Expand Down Expand Up @@ -520,6 +443,70 @@ Returns the `state` and `hasData` (boolean) of the catalog, `state` can be one o
- `error` - when the catalog fetch failed
- `success` - when the catalog fetch completed successfully

## KCatalogItem

KCatalog generates a KCatalogItem for each item in the `items` property. At the most basic level, KCatalogItem is a wrapper around KCard to display correctly inside KCatalog. You can use the `body` slot of the KCatalog to manually create your own catalog items.

### Props

#### item

Object instance of `CatalogItem` from which card content is built.

#### truncate

A boolean (default to `true`), whether or not to truncate the description text.

```html
<KCatalogItem :item="item" :truncate="false" class="catalog-item" />
```

### Slots

#### card-title

The title content for the card.

#### card-body

The body content for the card.

#### card-footer

The footer content for the card.

<KCatalogItem>
<template #card-title>
Card Title
</template>
<template #card-body>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nec justo libero. Nullam accumsan quis ipsum vitae tempus. Integer non pharetra orci. Suspendisse potenti.
</template>
<template #card-footer>
<KBadge appearance="neutral">Card footer</KBadge>
</template>
</KCatalogItem>

```html
<KCatalogItem>
<template #card-title>
Card Title
</template>
<template #card-body>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nec justo libero. Nullam accumsan quis ipsum vitae tempus. Integer non pharetra orci. Suspendisse potenti.
</template>
<template #card-footer>
<KBadge appearance="neutral">Card footer</KBadge>
</template>
</KCatalogItem>
```

### Events

#### click

Fired when item is clicked. Event payload is item object.

<script setup lang="ts">
import { ref, reactive } from 'vue'
import { AddIcon, MoreIcon } from '@kong/icons'
Expand Down
Loading
Loading