Skip to content

Commit

Permalink
Merge branch 'main' into feat-615/align-property-types-for-form-compo…
Browse files Browse the repository at this point in the history
…nents
  • Loading branch information
ChristianBusshoff authored Jan 21, 2025
2 parents 4858c76 + cc74fd8 commit b51f517
Show file tree
Hide file tree
Showing 17 changed files with 88 additions and 7 deletions.
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@
"strange-elephants-cover",
"strange-starfishes-sparkle",
"strange-students-yawn",
"strange-teachers-hope",
"strange-timers-poke",
"strong-dolls-end",
"stupid-bottles-clap",
Expand Down
5 changes: 5 additions & 0 deletions .changeset/strange-teachers-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"sit-onyx": patch
---

Added empty slot to DataGrid to be able to pass custom empty content
7 changes: 7 additions & 0 deletions apps/demo-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# demo-app

## 1.0.0-beta.129

### Patch Changes

- Updated dependencies [70e1088]
- [email protected]

## 1.0.0-beta.128

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "demo-app",
"private": true,
"version": "1.0.0-beta.128",
"version": "1.0.0-beta.129",
"type": "module",
"scripts": {
"dev": "turbo run turbo:dev --filter=.",
Expand Down
7 changes: 7 additions & 0 deletions apps/playground/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# playground

## 1.0.0-beta.129

### Patch Changes

- Updated dependencies [70e1088]
- [email protected]

## 1.0.0-beta.128

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/playground/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "playground",
"version": "1.0.0-beta.128",
"version": "1.0.0-beta.129",
"description": "Playground for the onyx Vue components",
"type": "module",
"author": "Schwarz IT KG",
Expand Down
7 changes: 7 additions & 0 deletions packages/chartjs-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sit-onyx/chartjs-plugin

## 1.0.0-beta.129

### Patch Changes

- Updated dependencies [70e1088]
- [email protected]

## 1.0.0-beta.128

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/chartjs-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sit-onyx/chartjs-plugin",
"description": "A Chart.js plugin for the onyx design system created by Schwarz IT",
"version": "1.0.0-beta.128",
"version": "1.0.0-beta.129",
"type": "module",
"author": "Schwarz IT KG",
"license": "Apache-2.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/nuxt/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sit-onyx/nuxt

## 1.0.0-beta.130

### Patch Changes

- Updated dependencies [70e1088]
- [email protected]

## 1.0.0-beta.129

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sit-onyx/nuxt",
"version": "1.0.0-beta.129",
"version": "1.0.0-beta.130",
"description": "A Nuxt module to easily integrate onyx into Nuxt projects",
"author": "Schwarz IT KG",
"license": "Apache-2.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/sit-onyx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# sit-onyx

## 1.0.0-beta.129

### Patch Changes

- 70e1088: Added empty slot to DataGrid to be able to pass custom empty content

## 1.0.0-beta.128

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/sit-onyx/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sit-onyx",
"description": "A design system and Vue.js component library created by Schwarz IT",
"version": "1.0.0-beta.128",
"version": "1.0.0-beta.129",
"type": "module",
"author": "Schwarz IT KG",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import pin from "@sit-onyx/icons/pin.svg?raw";
import trash from "@sit-onyx/icons/trash.svg?raw";
import type { Meta, StoryObj } from "@storybook/vue3";
import { h } from "vue";
import OnyxEmpty from "../OnyxEmpty/OnyxEmpty.vue";
import OnyxIcon from "../OnyxIcon/OnyxIcon.vue";
import OnyxMenuItem from "../OnyxNavBar/modules/OnyxMenuItem/OnyxMenuItem.vue";
import OnyxSystemButton from "../OnyxSystemButton/OnyxSystemButton.vue";
Expand Down Expand Up @@ -72,3 +73,10 @@ export const HeaderInteractions = {
],
},
} satisfies Story;

export const CustomEmptyState = {
args: {
columns: ["name", "age", "birthday"],
empty: () => h(OnyxEmpty, null, { default: "DataGrid is empty" }),
},
} satisfies Story;
15 changes: 14 additions & 1 deletion packages/sit-onyx/src/components/OnyxDataGrid/OnyxDataGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ const props = withDefaults(defineProps<OnyxDataGridProps<TEntry, TFeatures>>(),
const { t } = injectI18n();
defineSlots<{
/**
* Optional slot to customize the empty state when no data exist.
*
* If unset, the default empty content of OnyxTable will be displayed.
*/
empty?(): unknown;
}>();
// Using Ref types to avoid `UnwrapRef` issues
const renderColumns: Ref<DataGridRendererColumn<TEntry, object>[]> = ref([]);
const renderRows: Ref<DataGridRendererRow<TEntry, DataGridMetadata>[]> = ref([]);
Expand Down Expand Up @@ -53,5 +62,9 @@ watch(
</script>
<template>
<OnyxDataGridRenderer :columns="renderColumns" :rows="renderRows" />
<OnyxDataGridRenderer :columns="renderColumns" :rows="renderRows">
<template #empty>
<slot name="empty" />
</template>
</OnyxDataGridRenderer>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ const props = withDefaults(defineProps<OnyxDataGridRendererProps<TEntry, TMetada
striped: true,
withVerticalBorders: true,
});
defineSlots<{
/**
* Optional slot to customize the empty state when no data exist.
*
* If unset, the default empty content of OnyxTable will be displayed.
*/
empty?(): unknown;
}>();
</script>

<template>
Expand All @@ -34,6 +43,10 @@ const props = withDefaults(defineProps<OnyxDataGridRendererProps<TEntry, TMetada
</td>
</template>
</tr>

<template #empty>
<slot name="empty" />
</template>
</OnyxTable>
</template>

Expand Down
7 changes: 7 additions & 0 deletions packages/vitepress-theme/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @sit-onyx/vitepress-theme

## 1.0.0-beta.130

### Patch Changes

- Updated dependencies [70e1088]
- [email protected]

## 1.0.0-beta.129

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/vitepress-theme/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sit-onyx/vitepress-theme",
"description": "VitePress theme that uses the onyx design system",
"version": "1.0.0-beta.129",
"version": "1.0.0-beta.130",
"type": "module",
"author": "Schwarz IT KG",
"license": "Apache-2.0",
Expand Down

0 comments on commit b51f517

Please sign in to comment.