@milaboratories/uikit 2.2.6 → 2.2.7

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": "@milaboratories/uikit",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "type": "module",
5
5
  "main": "dist/pl-uikit.umd.js",
6
6
  "module": "dist/pl-uikit.js",
@@ -33,7 +33,7 @@
33
33
  "yarpm": "^1.2.0",
34
34
  "svgo": "^3.3.2",
35
35
  "@milaboratories/helpers": "^1.6.6",
36
- "@platforma-sdk/model": "^1.10.2"
36
+ "@platforma-sdk/model": "^1.10.12"
37
37
  },
38
38
  "scripts": {
39
39
  "dev": "vite",
@@ -70,9 +70,18 @@ const computedError = computed(() => logState.value?.error ?? props.error ?? get
70
70
 
71
71
  const computedValue = computed(() => logState.value?.lines ?? props.value ?? okOptional(props.output));
72
72
 
73
+ const copyActive = ref(false);
74
+
73
75
  useLabelNotch(root);
74
76
 
77
+ const iconName = computed(() => (copyActive.value ? 'clipboard-copied' : 'clipboard'));
78
+
75
79
  const onClickCopy = () => {
80
+ copyActive.value = true;
81
+ setTimeout(() => {
82
+ copyActive.value = false;
83
+ }, 1200);
84
+
76
85
  if (computedValue.value && typeof computedValue.value === 'string') {
77
86
  navigator.clipboard.writeText(computedValue.value);
78
87
  }
@@ -106,7 +115,7 @@ const onContentScroll = (ev: Event) => {
106
115
  <div ref="root" class="pl-log-view" :class="{ 'has-error': computedError }">
107
116
  <label v-if="label"> {{ label }} </label>
108
117
  <DoubleContour class="pl-log-view__contour" />
109
- <PlMaskIcon24 title="Copy content" class="pl-log-view__copy" name="clipboard" @click="onClickCopy" />
118
+ <PlMaskIcon24 title="Copy content" class="pl-log-view__copy" :name="iconName" @click="onClickCopy" />
110
119
  <div v-if="computedError" class="pl-log-view__error">{{ computedError }}</div>
111
120
  <div v-else ref="contentRef" class="pl-log-view__content" @scroll="onContentScroll">{{ computedValue }}</div>
112
121
  </div>
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';