@appscode/design-system 2.2.65 → 2.2.67
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,28 +1,39 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import { useClipboard } from "@vueuse/core";
|
|
4
|
+
import AcButton from "../button/Button.vue";
|
|
3
5
|
|
|
4
6
|
interface Props {
|
|
5
7
|
spacing?: string;
|
|
6
8
|
downloadBtn?: boolean;
|
|
9
|
+
code?: string;
|
|
7
10
|
copyBtn?: boolean;
|
|
8
11
|
}
|
|
9
12
|
|
|
10
|
-
withDefaults(defineProps<Props>(), {
|
|
13
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
11
14
|
spacing: "pr-48",
|
|
12
15
|
downloadBtn: false,
|
|
16
|
+
code: "",
|
|
13
17
|
copyBtn: true,
|
|
14
18
|
});
|
|
15
19
|
|
|
16
|
-
const
|
|
20
|
+
const source = ref(props.code);
|
|
21
|
+
|
|
22
|
+
const { copy, copied } = useClipboard({ source, legacy: true });
|
|
17
23
|
</script>
|
|
18
24
|
<template>
|
|
19
25
|
<div class="code-container p-0">
|
|
20
26
|
<pre class="ac-hscrollbar" :class="spacing">
|
|
21
|
-
|
|
27
|
+
{{ code }}
|
|
22
28
|
</pre>
|
|
23
29
|
<div class="buttons">
|
|
24
30
|
<ac-button v-if="downloadBtn" modifier-classes="is-primary small-button" icon-class="download" />
|
|
25
|
-
<ac-button
|
|
31
|
+
<ac-button
|
|
32
|
+
v-if="copyBtn"
|
|
33
|
+
:modifier-classes="'is-primary small-button'"
|
|
34
|
+
:icon-class="copied ? 'check' : 'copy'"
|
|
35
|
+
@click="copy()"
|
|
36
|
+
/>
|
|
26
37
|
</div>
|
|
27
38
|
</div>
|
|
28
39
|
</template>
|
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import { useClipboard } from "@vueuse/core";
|
|
4
|
+
import AcButton from "../button/Button.vue";
|
|
3
5
|
|
|
4
6
|
interface Props {
|
|
5
7
|
spacing?: string;
|
|
6
8
|
copyBtn?: boolean;
|
|
9
|
+
code?: string;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
|
-
withDefaults(defineProps<Props>(), {
|
|
12
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
10
13
|
spacing: "pr-48",
|
|
11
14
|
copyBtn: true,
|
|
15
|
+
code: "",
|
|
12
16
|
});
|
|
13
|
-
|
|
14
|
-
const
|
|
17
|
+
const source = ref(props.code);
|
|
18
|
+
const { copy, copied } = useClipboard({ source, legacy: true });
|
|
15
19
|
</script>
|
|
16
20
|
<template>
|
|
17
21
|
<div class="code-container p-0 b-1 is-rounded-4">
|
|
18
22
|
<div class="head is-flex is-justify-content-space-between is-align-items-center pt-7 px-4 b-b-1">
|
|
19
23
|
<div><slot name="left" /></div>
|
|
20
24
|
<ac-button
|
|
21
|
-
title="Copy"
|
|
25
|
+
:title="copied ? '' : 'Copy'"
|
|
22
26
|
v-if="copyBtn"
|
|
23
27
|
data-testid="kubeconfig-copy-button"
|
|
24
|
-
modifier-classes="is-outlined small-button mb-6"
|
|
25
|
-
icon-class="copy"
|
|
28
|
+
:modifier-classes="`is-outlined small-button mb-6 `"
|
|
29
|
+
:icon-class="copied ? 'check' : 'copy'"
|
|
30
|
+
@click="copy()"
|
|
26
31
|
/>
|
|
27
32
|
</div>
|
|
28
33
|
<pre class="ac-hscrollbar is-border-none">
|
|
29
|
-
|
|
34
|
+
{{ code }}
|
|
30
35
|
</pre>
|
|
31
36
|
</div>
|
|
32
37
|
</template>
|