@milaboratories/uikit 2.2.61 → 2.2.63
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 +4397 -4339
- package/dist/pl-uikit.js.map +1 -1
- package/dist/pl-uikit.umd.cjs +6 -6
- package/dist/pl-uikit.umd.cjs.map +1 -1
- package/dist/src/components/PlFileDialog/Remote.vue.d.ts +1 -1
- package/dist/src/components/PlLogView/PlLogView.vue.d.ts +8 -0
- package/dist/src/components/PlLogView/useLogHandle.d.ts +1 -1
- package/dist/src/components/PlTextField/PlTextField.vue.d.ts +3 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/PlDropdownMulti/PlDropdownMulti.vue +4 -2
- package/src/components/PlFileDialog/Local.vue +5 -5
- package/src/components/PlFileDialog/Remote.vue +5 -5
- package/src/components/PlLogView/PlLogView.vue +13 -2
- package/src/components/PlLogView/useLogHandle.ts +2 -2
- package/src/components/PlTextField/PlTextField.vue +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/uikit",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.63",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/pl-uikit.umd.js",
|
|
6
6
|
"module": "dist/pl-uikit.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"svgo": "^3.3.2",
|
|
36
36
|
"@types/d3": "^7.4.3",
|
|
37
37
|
"@milaboratories/helpers": "^1.6.11",
|
|
38
|
-
"@platforma-sdk/model": "^1.
|
|
38
|
+
"@platforma-sdk/model": "^1.27.10",
|
|
39
39
|
"@milaboratories/eslint-config": "^1.0.4"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
@@ -99,14 +99,16 @@ const placeholderRef = computed(() => {
|
|
|
99
99
|
return props.modelValue.length > 0 ? '' : props.placeholder;
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
+
const normalizedOptionsRef = computed(() => normalizeListOptions(props.options ?? []));
|
|
103
|
+
|
|
102
104
|
const selectedOptionsRef = computed(() => {
|
|
103
|
-
return
|
|
105
|
+
return selectedValuesRef.value.map((v) => normalizedOptionsRef.value.find((opt) => deepEqual(opt.value, v))).filter((v) => v !== undefined);
|
|
104
106
|
});
|
|
105
107
|
|
|
106
108
|
const filteredOptionsRef = computed(() => {
|
|
107
109
|
const selectedValues = unref(selectedValuesRef);
|
|
108
110
|
|
|
109
|
-
const options =
|
|
111
|
+
const options = unref(normalizedOptionsRef);
|
|
110
112
|
|
|
111
113
|
return (
|
|
112
114
|
data.search
|
|
@@ -3,7 +3,7 @@ import style from './pl-file-dialog.module.scss';
|
|
|
3
3
|
import type { ImportedFiles } from '@/types';
|
|
4
4
|
import { PlIcon24 } from '../PlIcon24';
|
|
5
5
|
import { computed, reactive } from 'vue';
|
|
6
|
-
import type
|
|
6
|
+
import { getRawPlatformaInstance, type OpenDialogFilter } from '@platforma-sdk/model';
|
|
7
7
|
import { normalizeExtensions } from './utils';
|
|
8
8
|
|
|
9
9
|
const props = defineProps<{
|
|
@@ -19,10 +19,10 @@ const data = reactive({
|
|
|
19
19
|
const label = computed(() => (props.multi ? 'Drag & Drop files here or click to add' : 'Drag & Drop file here or click to add'));
|
|
20
20
|
|
|
21
21
|
const onDrop = async (ev: DragEvent) => {
|
|
22
|
-
const fileToImportHandle =
|
|
22
|
+
const fileToImportHandle = getRawPlatformaInstance()?.lsDriver?.fileToImportHandle;
|
|
23
23
|
|
|
24
24
|
if (!fileToImportHandle) {
|
|
25
|
-
return console.error('API
|
|
25
|
+
return console.error('API getPlatformaRawInstance().lsDriver.fileToImportHandle is not available');
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const extensions = normalizeExtensions(props.extensions);
|
|
@@ -54,7 +54,7 @@ const openNativeDialog = async () => {
|
|
|
54
54
|
: [];
|
|
55
55
|
|
|
56
56
|
if (props.multi) {
|
|
57
|
-
|
|
57
|
+
getRawPlatformaInstance()?.lsDriver
|
|
58
58
|
.showOpenMultipleFilesDialog({
|
|
59
59
|
title: 'Select files to import',
|
|
60
60
|
filters,
|
|
@@ -68,7 +68,7 @@ const openNativeDialog = async () => {
|
|
|
68
68
|
})
|
|
69
69
|
.catch((err) => (data.error = err));
|
|
70
70
|
} else {
|
|
71
|
-
|
|
71
|
+
getRawPlatformaInstance()?.lsDriver
|
|
72
72
|
.showOpenSingleFileDialog({
|
|
73
73
|
title: 'Select file to import',
|
|
74
74
|
filters,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useEventListener } from '@/composition/useEventListener';
|
|
3
3
|
import type { ImportedFiles } from '@/types';
|
|
4
4
|
import { between, notEmpty, tapIf } from '@milaboratories/helpers';
|
|
5
|
-
import type
|
|
5
|
+
import { getRawPlatformaInstance, type StorageHandle } from '@platforma-sdk/model';
|
|
6
6
|
import { computed, onMounted, reactive, toRef, watch } from 'vue';
|
|
7
7
|
import { PlDropdown } from '../PlDropdown';
|
|
8
8
|
import { PlIcon16 } from '../PlIcon16';
|
|
@@ -58,7 +58,7 @@ const lookup = computed(() => {
|
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
const query = (storageHandle: StorageHandle, dirPath: string) => {
|
|
61
|
-
if (!
|
|
61
|
+
if (!getRawPlatformaInstance()) {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -68,7 +68,7 @@ const query = (storageHandle: StorageHandle, dirPath: string) => {
|
|
|
68
68
|
|
|
69
69
|
data.currentLoadingPath = dirPath;
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
getRawPlatformaInstance().lsDriver
|
|
72
72
|
.listFiles(storageHandle, dirPath)
|
|
73
73
|
.then((res) => {
|
|
74
74
|
if (dirPath !== data.dirPath) {
|
|
@@ -186,11 +186,11 @@ const deselectAll = () => changeAll(false);
|
|
|
186
186
|
const loadAvailableStorages = () => {
|
|
187
187
|
resetData();
|
|
188
188
|
deselectAll();
|
|
189
|
-
if (!
|
|
189
|
+
if (!getRawPlatformaInstance()) {
|
|
190
190
|
console.warn('platforma API is not found');
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
getRawPlatformaInstance().lsDriver
|
|
194
194
|
.getStorageList()
|
|
195
195
|
.then((storageEntries) => {
|
|
196
196
|
// local storage is always returned by the ML, so we need to remove it from remote dialog manually
|
|
@@ -31,6 +31,10 @@ const props = defineProps<{
|
|
|
31
31
|
* String contents
|
|
32
32
|
*/
|
|
33
33
|
value?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The content to copy (Note: it takes precedence over value property)
|
|
36
|
+
*/
|
|
37
|
+
valueToCopy?: string;
|
|
34
38
|
/**
|
|
35
39
|
* AnyLogHandle
|
|
36
40
|
*/
|
|
@@ -85,8 +89,15 @@ const onClickCopy = () => {
|
|
|
85
89
|
copyActive.value = false;
|
|
86
90
|
}, 1200);
|
|
87
91
|
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
let toCopy: string | undefined = undefined;
|
|
93
|
+
if (props.valueToCopy) {
|
|
94
|
+
toCopy = props.valueToCopy;
|
|
95
|
+
} else if (computedValue.value && typeof computedValue.value === 'string') {
|
|
96
|
+
toCopy = computedValue.value;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (toCopy !== undefined) {
|
|
100
|
+
navigator.clipboard.writeText(toCopy);
|
|
90
101
|
}
|
|
91
102
|
};
|
|
92
103
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { reactive, type Reactive, ref, watch } from 'vue';
|
|
2
2
|
import { useTimeoutPoll, whenever } from '@vueuse/core';
|
|
3
|
-
import type
|
|
3
|
+
import { getRawPlatformaInstance, type AnyLogHandle, type Platforma } from '@platforma-sdk/model';
|
|
4
4
|
|
|
5
5
|
type LogState = {
|
|
6
6
|
logHandle: AnyLogHandle;
|
|
@@ -32,7 +32,7 @@ export function useLogHandle(
|
|
|
32
32
|
|
|
33
33
|
if (currentLogState === undefined) return;
|
|
34
34
|
|
|
35
|
-
const platforma = props.mockPlatforma ??
|
|
35
|
+
const platforma = props.mockPlatforma ?? getRawPlatformaInstance();
|
|
36
36
|
|
|
37
37
|
if (!platforma) {
|
|
38
38
|
console.warn('Platforma API is not available');
|