@milaboratories/uikit 2.2.6 → 2.2.8
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/CHANGELOG.md +12 -0
- package/dist/pl-uikit.js +1517 -1516
- package/dist/pl-uikit.umd.cjs +9 -9
- package/dist/src/index.d.ts +0 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/PlLogView/PlLogView.vue +16 -1
- package/src/components/PlLogView/pl-log-view.scss +7 -2
- package/src/index.ts +0 -1
- package/dist/src/components/PlCopyData/PlCopyData.vue.d.ts +0 -6
- package/dist/src/components/PlCopyData/index.d.ts +0 -1
- package/src/components/PlCopyData/PlCopyData.vue +0 -20
- package/src/components/PlCopyData/index.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/uikit",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/pl-uikit.umd.js",
|
|
6
6
|
"module": "dist/pl-uikit.js",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"vue-tsc": "^2.1.6",
|
|
33
33
|
"yarpm": "^1.2.0",
|
|
34
34
|
"svgo": "^3.3.2",
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
35
|
+
"@platforma-sdk/model": "^1.10.12",
|
|
36
|
+
"@milaboratories/helpers": "^1.6.6"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"dev": "vite",
|
|
@@ -16,6 +16,7 @@ import type { AnyLogHandle, Platforma, ValueOrErrors } from '@platforma-sdk/mode
|
|
|
16
16
|
import { useLogHandle } from './useLogHandle';
|
|
17
17
|
import { useLabelNotch } from '@/utils/useLabelNotch';
|
|
18
18
|
import DoubleContour from '@/utils/DoubleContour.vue';
|
|
19
|
+
import { PlTooltip } from '../PlTooltip';
|
|
19
20
|
|
|
20
21
|
const getOutputError = <T,>(o?: ValueOrErrors<T>) => {
|
|
21
22
|
if (o && o.ok === false) {
|
|
@@ -70,9 +71,18 @@ const computedError = computed(() => logState.value?.error ?? props.error ?? get
|
|
|
70
71
|
|
|
71
72
|
const computedValue = computed(() => logState.value?.lines ?? props.value ?? okOptional(props.output));
|
|
72
73
|
|
|
74
|
+
const copyActive = ref(false);
|
|
75
|
+
|
|
73
76
|
useLabelNotch(root);
|
|
74
77
|
|
|
78
|
+
const iconName = computed(() => (copyActive.value ? 'clipboard-copied' : 'clipboard'));
|
|
79
|
+
|
|
75
80
|
const onClickCopy = () => {
|
|
81
|
+
copyActive.value = true;
|
|
82
|
+
setTimeout(() => {
|
|
83
|
+
copyActive.value = false;
|
|
84
|
+
}, 1200);
|
|
85
|
+
|
|
76
86
|
if (computedValue.value && typeof computedValue.value === 'string') {
|
|
77
87
|
navigator.clipboard.writeText(computedValue.value);
|
|
78
88
|
}
|
|
@@ -106,7 +116,12 @@ const onContentScroll = (ev: Event) => {
|
|
|
106
116
|
<div ref="root" class="pl-log-view" :class="{ 'has-error': computedError }">
|
|
107
117
|
<label v-if="label"> {{ label }} </label>
|
|
108
118
|
<DoubleContour class="pl-log-view__contour" />
|
|
109
|
-
<
|
|
119
|
+
<div class="pl-log-view__copy">
|
|
120
|
+
<PlTooltip :close-delay="800" position="top">
|
|
121
|
+
<PlMaskIcon24 title="Copy content" :name="iconName" @click="onClickCopy" />
|
|
122
|
+
<template #tooltip>{{ copyActive ? 'copied' : 'copy' }}</template>
|
|
123
|
+
</PlTooltip>
|
|
124
|
+
</div>
|
|
110
125
|
<div v-if="computedError" class="pl-log-view__error">{{ computedError }}</div>
|
|
111
126
|
<div v-else ref="contentRef" class="pl-log-view__content" @scroll="onContentScroll">{{ computedValue }}</div>
|
|
112
127
|
</div>
|
|
@@ -46,11 +46,16 @@
|
|
|
46
46
|
position: absolute;
|
|
47
47
|
top: 12px;
|
|
48
48
|
right: 12px;
|
|
49
|
-
background-color: var(--ic-02);
|
|
50
49
|
cursor: pointer;
|
|
51
50
|
|
|
51
|
+
.mask-24 {
|
|
52
|
+
background-color: var(--ic-02);
|
|
53
|
+
}
|
|
54
|
+
|
|
52
55
|
&:hover {
|
|
53
|
-
|
|
56
|
+
.mask-24 {
|
|
57
|
+
background-color: var(--txt-01);
|
|
58
|
+
}
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
61
|
|
package/src/index.ts
CHANGED
|
@@ -48,7 +48,6 @@ export * from './components/PlTabs';
|
|
|
48
48
|
export * from './components/PlFileDialog';
|
|
49
49
|
export * from './components/PlFileInput';
|
|
50
50
|
export * from './components/PlNotificationAlert';
|
|
51
|
-
export * from './components/PlCopyData';
|
|
52
51
|
|
|
53
52
|
export * from './components/PlMaskIcon16';
|
|
54
53
|
export * from './components/PlMaskIcon24';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
-
copy: (...args: any[]) => void;
|
|
3
|
-
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
-
onCopy?: ((...args: any[]) => any) | undefined;
|
|
5
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as PlCopyData } from './PlCopyData.vue';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, ref } from 'vue';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @TODO nicolaygiman ask me!!!
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const emit = defineEmits(['copy']);
|
|
9
|
-
const isActive = ref(false);
|
|
10
|
-
const icon = computed(() => (isActive.value ? 'mask-clipboard-copied' : 'mask-clipboard'));
|
|
11
|
-
|
|
12
|
-
function copyData() {
|
|
13
|
-
isActive.value = true;
|
|
14
|
-
setTimeout(() => (isActive.value = false), 700);
|
|
15
|
-
emit('copy');
|
|
16
|
-
}
|
|
17
|
-
</script>
|
|
18
|
-
<template>
|
|
19
|
-
<div :class="icon" class="mask-24" @click="copyData" />
|
|
20
|
-
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as PlCopyData } from './PlCopyData.vue';
|