@appscode/design-system 2.17.26 → 2.17.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.17.26",
3
+ "version": "2.17.27",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { defineProps, type Component } from "vue";
2
+ import { defineProps, defineEmits, type Component } from "vue";
3
3
  import AcButton from "../../v3/button/Button.vue";
4
+
4
5
  interface UsageRow {
5
6
  icon?: Component;
6
7
  label: string;
@@ -9,7 +10,7 @@ interface UsageRow {
9
10
 
10
11
  type Header = string | { label: string; button?: boolean; text?: string };
11
12
 
12
- withDefaults(
13
+ const props = withDefaults(
13
14
  defineProps<{
14
15
  title?: string;
15
16
  thead?: Header[];
@@ -21,6 +22,16 @@ withDefaults(
21
22
  tbody: () => [],
22
23
  },
23
24
  );
25
+
26
+ const emit = defineEmits<{
27
+ "header-button-click": [headerLabel: string, headerIndex: number];
28
+ }>();
29
+
30
+ const handleHeaderButtonClick = (header: Header, index: number) => {
31
+ if (typeof header === "object" && header.button) {
32
+ emit("header-button-click", header.label, index);
33
+ }
34
+ };
24
35
  </script>
25
36
 
26
37
  <template>
@@ -37,7 +48,7 @@ withDefaults(
37
48
  <ac-button
38
49
  modifier-classes="is-text has-text-primary p-0 height-auto"
39
50
  v-if="header.button"
40
- @click="$emit('total-click')"
51
+ @click="handleHeaderButtonClick(header, index)"
41
52
  >({{ header.text }})</ac-button
42
53
  >
43
54
  </div>