@appscode/design-system 2.17.24 → 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,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?:
|
|
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">
|
|
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">
|
|
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,6 +15,7 @@ interface Props {
|
|
|
15
15
|
schema?: Record<string, unknown>;
|
|
16
16
|
uri: string;
|
|
17
17
|
};
|
|
18
|
+
needsUpdateOnChange?: boolean;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -28,6 +29,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
28
29
|
editorTheme: "",
|
|
29
30
|
wordWrap: "on",
|
|
30
31
|
validation: () => ({ uri: "" }),
|
|
32
|
+
needsUpdateOnChange: false,
|
|
31
33
|
});
|
|
32
34
|
|
|
33
35
|
const emit = defineEmits(["update:modelValue"]);
|
|
@@ -61,7 +63,10 @@ const theme = computed(() => {
|
|
|
61
63
|
});
|
|
62
64
|
|
|
63
65
|
const onChange = (e: Event) => {
|
|
64
|
-
if (typeof e === "string")
|
|
66
|
+
if (typeof e === "string") {
|
|
67
|
+
editorContent.value = e;
|
|
68
|
+
if (props.needsUpdateOnChange) emit("update:modelValue", e);
|
|
69
|
+
}
|
|
65
70
|
};
|
|
66
71
|
|
|
67
72
|
const onEditorMount = (editor: Record<string, unknown>) => {
|