@appscode/design-system 2.17.25 → 2.17.26

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.25",
3
+ "version": "2.17.26",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -1,15 +1,18 @@
1
1
  <script setup lang="ts">
2
2
  import { defineProps, type Component } from "vue";
3
-
3
+ import AcButton from "../../v3/button/Button.vue";
4
4
  interface UsageRow {
5
5
  icon?: Component;
6
6
  label: string;
7
7
  values: (string | number)[];
8
8
  }
9
+
10
+ type Header = string | { label: string; button?: boolean; text?: string };
11
+
9
12
  withDefaults(
10
13
  defineProps<{
11
14
  title?: string;
12
- thead?: string[];
15
+ thead?: Header[];
13
16
  tbody?: UsageRow[];
14
17
  }>(),
15
18
  {
@@ -24,8 +27,24 @@ withDefaults(
24
27
  <h5 class="mb-8">{{ title }}</h5>
25
28
  <div class="usage-table-card">
26
29
  <div class="table-row thead">
27
- <div v-for="(header, index) in thead" :key="index" class="table-cell">{{ header }}</div>
30
+ <div v-for="(header, index) in thead" :key="index" class="table-cell">
31
+ <template v-if="typeof header === 'string'">
32
+ {{ header }}
33
+ </template>
34
+ <template v-else>
35
+ <div class="is-flex is-align-items-center is-justify-content-flex-end gap-4">
36
+ <span>{{ header.label }}</span>
37
+ <ac-button
38
+ modifier-classes="is-text has-text-primary p-0 height-auto"
39
+ v-if="header.button"
40
+ @click="$emit('total-click')"
41
+ >({{ header.text }})</ac-button
42
+ >
43
+ </div>
44
+ </template>
45
+ </div>
28
46
  </div>
47
+
29
48
  <div v-for="(row, rowIndex) in tbody" :key="rowIndex" class="table-row">
30
49
  <div class="table-cell">
31
50
  <div class="is-flex gap-8">
@@ -35,7 +54,9 @@ withDefaults(
35
54
  <span>{{ row.label }}</span>
36
55
  </div>
37
56
  </div>
38
- <div v-for="(val, valIndex) in row.values" :key="valIndex" class="table-cell">{{ val }}</div>
57
+ <div v-for="(val, valIndex) in row.values" :key="valIndex" class="table-cell">
58
+ {{ val }}
59
+ </div>
39
60
  </div>
40
61
  </div>
41
62
  </template>
@@ -15,7 +15,7 @@ interface Props {
15
15
  schema?: Record<string, unknown>;
16
16
  uri: string;
17
17
  };
18
- needsUpdateOnChange?: boolean
18
+ needsUpdateOnChange?: boolean;
19
19
  }
20
20
 
21
21
  const props = withDefaults(defineProps<Props>(), {
@@ -29,7 +29,7 @@ const props = withDefaults(defineProps<Props>(), {
29
29
  editorTheme: "",
30
30
  wordWrap: "on",
31
31
  validation: () => ({ uri: "" }),
32
- needsUpdateOnChange: false
32
+ needsUpdateOnChange: false,
33
33
  });
34
34
 
35
35
  const emit = defineEmits(["update:modelValue"]);
@@ -65,8 +65,7 @@ const theme = computed(() => {
65
65
  const onChange = (e: Event) => {
66
66
  if (typeof e === "string") {
67
67
  editorContent.value = e;
68
- if(props.needsUpdateOnChange)
69
- emit("update:modelValue", e);
68
+ if (props.needsUpdateOnChange) emit("update:modelValue", e);
70
69
  }
71
70
  };
72
71