@platforma-sdk/ui-vue 1.42.23 → 1.42.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/.turbo/turbo-build.log +15 -15
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js +48 -51
- package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/FilterSidebar.vue3.js +6 -8
- package/dist/components/PlAnnotations/components/FilterSidebar.vue3.js.map +1 -1
- package/dist/plugins/Monetization/LimitCard.vue2.js +59 -46
- package/dist/plugins/Monetization/LimitCard.vue2.js.map +1 -1
- package/dist/plugins/Monetization/LimitCard.vue3.js +21 -17
- package/dist/plugins/Monetization/LimitCard.vue3.js.map +1 -1
- package/dist/plugins/Monetization/MonetizationSidebar.vue.js +39 -39
- package/dist/plugins/Monetization/MonetizationSidebar.vue.js.map +1 -1
- package/dist/plugins/Monetization/RunStatus.vue.d.ts +1 -0
- package/dist/plugins/Monetization/RunStatus.vue2.js +17 -20
- package/dist/plugins/Monetization/RunStatus.vue2.js.map +1 -1
- package/dist/plugins/Monetization/RunStatus.vue3.js +15 -13
- package/dist/plugins/Monetization/RunStatus.vue3.js.map +1 -1
- package/dist/plugins/Monetization/UserCabinetCard.vue.d.ts +1 -0
- package/dist/plugins/Monetization/UserCabinetCard.vue2.js +42 -34
- package/dist/plugins/Monetization/UserCabinetCard.vue2.js.map +1 -1
- package/dist/plugins/Monetization/UserCabinetCard.vue3.js +17 -15
- package/dist/plugins/Monetization/UserCabinetCard.vue3.js.map +1 -1
- package/dist/plugins/Monetization/useInfo.js +5 -5
- package/dist/plugins/Monetization/useInfo.js.map +1 -1
- package/package.json +8 -8
- package/src/components/PlAnnotations/components/FilterSidebar.vue +0 -7
- package/src/plugins/Monetization/LimitCard.vue +94 -40
- package/src/plugins/Monetization/MonetizationSidebar.vue +3 -5
- package/src/plugins/Monetization/RunStatus.vue +11 -15
- package/src/plugins/Monetization/UserCabinetCard.vue +23 -1
- package/src/plugins/Monetization/useInfo.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/ui-vue",
|
|
3
|
-
"version": "1.42.
|
|
3
|
+
"version": "1.42.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"styles": "dist/index.js",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"@vueuse/integrations": "^13.3.0",
|
|
26
26
|
"d3-format": "^3.1.0",
|
|
27
27
|
"zod": "~3.23.8",
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@milaboratories/
|
|
28
|
+
"@platforma-sdk/model": "~1.42.25",
|
|
29
|
+
"@milaboratories/uikit": "2.4.5",
|
|
30
|
+
"@milaboratories/biowasm-tools": "^1.1.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"happy-dom": "^15.11.7",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"yarpm": "^1.2.0",
|
|
43
43
|
"fast-json-patch": "^3.1.1",
|
|
44
44
|
"@faker-js/faker": "^9.2.0",
|
|
45
|
-
"@milaboratories/build-configs": "1.0.8",
|
|
46
45
|
"@milaboratories/ts-configs": "1.0.6",
|
|
47
|
-
"@milaboratories/
|
|
48
|
-
"@milaboratories/
|
|
49
|
-
"@milaboratories/
|
|
46
|
+
"@milaboratories/build-configs": "1.0.8",
|
|
47
|
+
"@milaboratories/helpers": "^1.6.21",
|
|
48
|
+
"@milaboratories/ts-builder": "1.0.5",
|
|
49
|
+
"@milaboratories/eslint-config": "^1.0.4"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"test": "vitest run --passWithNoTests",
|
|
@@ -92,8 +92,6 @@ const getFilterValues = (filter: FilterUi) => {
|
|
|
92
92
|
</PlBtnSecondary>
|
|
93
93
|
</div>
|
|
94
94
|
|
|
95
|
-
<span :class="$style.tip">Lower annotations override the ones above. Rearrange them by dragging.</span>
|
|
96
|
-
|
|
97
95
|
<PlElementList
|
|
98
96
|
v-model:items="step.filter.filters"
|
|
99
97
|
:get-item-key="(item) => item.id!"
|
|
@@ -135,9 +133,4 @@ const getFilterValues = (filter: FilterUi) => {
|
|
|
135
133
|
flex-direction: row;
|
|
136
134
|
gap: 12px;
|
|
137
135
|
}
|
|
138
|
-
|
|
139
|
-
.tip {
|
|
140
|
-
margin-top: 12px;
|
|
141
|
-
color: var(--txt-03);
|
|
142
|
-
}
|
|
143
136
|
</style>
|
|
@@ -10,19 +10,42 @@ const props = defineProps<{
|
|
|
10
10
|
unit?: string;
|
|
11
11
|
}>();
|
|
12
12
|
|
|
13
|
+
const total = computed(() => {
|
|
14
|
+
if (props.available === null) return null;
|
|
15
|
+
return props.available + props.toSpend + props.used;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const exceeded = computed(() => {
|
|
19
|
+
if (props.available === null) return false;
|
|
20
|
+
return props.available < 0;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const availableNow = computed(() => {
|
|
24
|
+
if (props.available === null) return null;
|
|
25
|
+
return props.available + props.toSpend;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const clampPercentage = (n: number) => Math.max(0, Math.min(100, n));
|
|
29
|
+
|
|
13
30
|
const toSpendPercentage = computed(() => {
|
|
14
|
-
if (
|
|
15
|
-
|
|
31
|
+
if (total.value === null) return 0;
|
|
32
|
+
if (total.value === 0) return 0;
|
|
33
|
+
if (exceeded.value) return 0;
|
|
34
|
+
return clampPercentage((props.toSpend / total.value) * 100);
|
|
16
35
|
});
|
|
17
36
|
|
|
18
37
|
const usedPercentage = computed(() => {
|
|
19
|
-
if (
|
|
20
|
-
|
|
38
|
+
if (total.value === null) return 0;
|
|
39
|
+
if (total.value === 0) return 0;
|
|
40
|
+
return clampPercentage((props.used / total.value) * 100);
|
|
21
41
|
});
|
|
22
42
|
|
|
23
43
|
const availablePercentage = computed(() => {
|
|
24
44
|
if (props.available === null) return 100;
|
|
25
|
-
|
|
45
|
+
if (total.value === null) return 100;
|
|
46
|
+
if (total.value === 0) return 100;
|
|
47
|
+
if (exceeded.value) return 0;
|
|
48
|
+
return clampPercentage(props.available / total.value * 100);
|
|
26
49
|
});
|
|
27
50
|
|
|
28
51
|
const computedLabel = computed(() => {
|
|
@@ -39,6 +62,10 @@ const formatUnit = (v: number) => {
|
|
|
39
62
|
if (props.type === 'volume_limit') return toGB(v);
|
|
40
63
|
return v;
|
|
41
64
|
};
|
|
65
|
+
|
|
66
|
+
const showBar = (n: number) => {
|
|
67
|
+
return Number(n.toFixed(2)) > 0;
|
|
68
|
+
};
|
|
42
69
|
</script>
|
|
43
70
|
|
|
44
71
|
<template>
|
|
@@ -46,25 +73,33 @@ const formatUnit = (v: number) => {
|
|
|
46
73
|
<span :class="$style.label">{{ computedLabel }}</span>
|
|
47
74
|
<div :class="$style.content">
|
|
48
75
|
<div :class="$style.contentAvailable">
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
<div>
|
|
77
|
+
Available:
|
|
78
|
+
<div style="flex: 1" />
|
|
79
|
+
<span v-if="availableNow !== null"><strong>{{ formatUnit(availableNow) }}</strong> / {{ formatUnit(available! + toSpend + used) }}</span>
|
|
80
|
+
<span v-else>Unlimited</span>
|
|
81
|
+
</div>
|
|
82
|
+
<div :class="[$style.afterRun, { [$style.exceeded]: exceeded }]">
|
|
83
|
+
<span v-if="exceeded">Too many files selected</span>
|
|
84
|
+
<span style="flex: 1" />
|
|
85
|
+
<span>After run:</span>
|
|
86
|
+
<span v-if="available !== null">{{ formatUnit(available) }} / {{ formatUnit(available + toSpend + used) }}</span>
|
|
87
|
+
</div>
|
|
88
|
+
<div :class="[$style.progressBar, { [$style.exceeded]: exceeded }]">
|
|
89
|
+
<span v-if="showBar(availablePercentage)" :class="$style.progressBarAvailable" :style="{ width: `${availablePercentage.toFixed(2)}%` }" />
|
|
90
|
+
<span v-if="showBar(toSpendPercentage)" :class="$style.progressBarToSpend" :style="{ width: `${toSpendPercentage.toFixed(2)}%` }" />
|
|
91
|
+
<span v-if="showBar(usedPercentage)" :class="$style.progressBarUsed" :style="{ width: `${usedPercentage.toFixed(2)}%` }" />
|
|
92
|
+
</div>
|
|
58
93
|
</div>
|
|
59
94
|
<div :class="$style.legends">
|
|
60
|
-
<div :class="$style.usedLegend">
|
|
61
|
-
<span/>
|
|
62
|
-
Used: {{ formatUnit(used) }}
|
|
63
|
-
</div>
|
|
64
95
|
<div :class="$style.toSpendLegend">
|
|
65
96
|
<span/>
|
|
66
97
|
To spend: {{ formatUnit(toSpend) }}
|
|
67
98
|
</div>
|
|
99
|
+
<div :class="$style.usedLegend">
|
|
100
|
+
<span/>
|
|
101
|
+
Used: {{ formatUnit(used) }}
|
|
102
|
+
</div>
|
|
68
103
|
</div>
|
|
69
104
|
</div>
|
|
70
105
|
</div>
|
|
@@ -74,7 +109,6 @@ const formatUnit = (v: number) => {
|
|
|
74
109
|
.container {
|
|
75
110
|
display: flex;
|
|
76
111
|
flex-direction: column;
|
|
77
|
-
gap: 8px;
|
|
78
112
|
background-color: var(--bg-base-light);
|
|
79
113
|
border-radius: 6px;
|
|
80
114
|
padding: 10px 12px 16px 12px;
|
|
@@ -87,7 +121,8 @@ const formatUnit = (v: number) => {
|
|
|
87
121
|
|
|
88
122
|
.label {
|
|
89
123
|
display: block;
|
|
90
|
-
|
|
124
|
+
min-height: 36px;
|
|
125
|
+
margin-bottom: 8px;
|
|
91
126
|
color: var(--txt-01);
|
|
92
127
|
font-size: 14px;
|
|
93
128
|
font-weight: 600;
|
|
@@ -97,64 +132,83 @@ const formatUnit = (v: number) => {
|
|
|
97
132
|
.content {
|
|
98
133
|
display: flex;
|
|
99
134
|
flex-direction: column;
|
|
100
|
-
gap:
|
|
135
|
+
gap: 16px;
|
|
101
136
|
}
|
|
102
137
|
|
|
103
138
|
.contentAvailable {
|
|
104
139
|
display: flex;
|
|
105
|
-
|
|
106
|
-
gap:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
140
|
+
flex-direction: column;
|
|
141
|
+
gap: 6px;
|
|
142
|
+
> div {
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: flex-start;
|
|
145
|
+
}
|
|
146
|
+
>div:first-child {
|
|
147
|
+
gap: 8px;
|
|
148
|
+
strong {
|
|
149
|
+
font-size: 28px;
|
|
150
|
+
font-weight: 500;
|
|
151
|
+
line-height: 36px; /* 128.571% */
|
|
152
|
+
letter-spacing: -0.56px;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.afterRun {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
justify-content: flex-end;
|
|
161
|
+
gap: 4px;
|
|
162
|
+
font-size: 12px;
|
|
163
|
+
font-style: normal;
|
|
164
|
+
font-weight: 500;
|
|
165
|
+
line-height: 16px;
|
|
166
|
+
color: var(--txt-03);
|
|
167
|
+
&.exceeded {
|
|
168
|
+
color: var(--txt-error);
|
|
112
169
|
}
|
|
113
170
|
}
|
|
114
171
|
|
|
115
172
|
.progressBar {
|
|
116
173
|
width: 100%;
|
|
117
|
-
height:
|
|
174
|
+
height: 12px;
|
|
118
175
|
background-color: #E0E0E0;
|
|
119
|
-
border-radius: 4px;
|
|
120
176
|
display: flex;
|
|
121
177
|
align-items: center;
|
|
122
178
|
border: 1px solid var(--border-color-default);
|
|
123
179
|
> span {
|
|
124
180
|
display: block;
|
|
125
181
|
height: 100%;
|
|
182
|
+
outline: 1px solid var(--border-color-default);
|
|
183
|
+
}
|
|
184
|
+
&.exceeded {
|
|
185
|
+
opacity: 0.2;
|
|
126
186
|
}
|
|
127
187
|
}
|
|
128
188
|
|
|
129
189
|
.progressBarAvailable {
|
|
130
|
-
background
|
|
131
|
-
border-radius: 4px;
|
|
190
|
+
background: linear-gradient(270deg, #A1E59C 0%, #D0F5B0 98.81%);
|
|
132
191
|
}
|
|
133
192
|
|
|
134
193
|
.progressBarUsed {
|
|
135
194
|
background-color: #FFCECC;
|
|
136
|
-
border-radius: 4px;
|
|
137
195
|
}
|
|
138
196
|
|
|
139
197
|
.progressBarToSpend {
|
|
140
198
|
background-color: #FAF5AA;
|
|
141
|
-
border-radius: 4px;
|
|
142
199
|
}
|
|
143
200
|
|
|
144
201
|
.legends {
|
|
145
202
|
display: flex;
|
|
203
|
+
justify-content: space-between;
|
|
146
204
|
gap: 8px;
|
|
147
205
|
|
|
148
|
-
> div {
|
|
149
|
-
flex: 1;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
206
|
span {
|
|
153
207
|
display: block;
|
|
154
208
|
border-radius: 1px;
|
|
155
209
|
border: 1px solid var(--border-color-default);
|
|
156
|
-
width:
|
|
157
|
-
height:
|
|
210
|
+
width: 12px;
|
|
211
|
+
height: 12px;
|
|
158
212
|
}
|
|
159
213
|
}
|
|
160
214
|
|
|
@@ -62,10 +62,8 @@ const statusText = computed(() => {
|
|
|
62
62
|
return 'Select a subscription plan in the Scientist Cabinet.';
|
|
63
63
|
case 'inactive':
|
|
64
64
|
return 'Not found billing period.';
|
|
65
|
-
case 'awaiting':
|
|
66
|
-
return 'Waiting for monetization information';
|
|
67
65
|
default:
|
|
68
|
-
return '
|
|
66
|
+
return '';
|
|
69
67
|
}
|
|
70
68
|
});
|
|
71
69
|
|
|
@@ -83,7 +81,7 @@ const btnIcon = computed(() => {
|
|
|
83
81
|
</div>
|
|
84
82
|
</template>
|
|
85
83
|
<PlDropdown label="Product" readonly :model-value="productName" :options="options" />
|
|
86
|
-
<RunStatus :can-run="canRun" :status-text="statusText">
|
|
84
|
+
<RunStatus :can-run="canRun" :is-loading="isLoading" :status-text="statusText">
|
|
87
85
|
<PlBtnSecondary
|
|
88
86
|
title="Refresh status"
|
|
89
87
|
round
|
|
@@ -97,7 +95,7 @@ const btnIcon = computed(() => {
|
|
|
97
95
|
<PlAlert v-if="error" type="error">
|
|
98
96
|
{{ error }}
|
|
99
97
|
</PlAlert>
|
|
100
|
-
<UserCabinetCard v-if="userCabinetUrl" :user-cabinet-url="userCabinetUrl" />
|
|
98
|
+
<UserCabinetCard v-if="userCabinetUrl" :email="customerEmail" :user-cabinet-url="userCabinetUrl" />
|
|
101
99
|
<EndOfPeriod v-if="endOfBillingPeriod" :end-of-period="endOfBillingPeriod" />
|
|
102
100
|
<template v-if="limits">
|
|
103
101
|
<LimitCard
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue';
|
|
3
|
-
import { PlIcon24, PlTooltip } from '@milaboratories/uikit';
|
|
4
3
|
|
|
5
4
|
const props = defineProps<{
|
|
6
5
|
canRun: boolean | undefined;
|
|
7
6
|
statusText: string | undefined;
|
|
7
|
+
isLoading?: boolean;
|
|
8
8
|
}>();
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
if (props.
|
|
12
|
-
return '
|
|
10
|
+
const badgeText = computed(() => {
|
|
11
|
+
if (props.isLoading) {
|
|
12
|
+
return 'Updating...';
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
return 'Cannot run: check your monetization settings';
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const badgeText = computed(() => {
|
|
19
15
|
if (props.canRun) {
|
|
20
16
|
return 'Ready to run';
|
|
21
17
|
}
|
|
@@ -26,7 +22,7 @@ const badgeText = computed(() => {
|
|
|
26
22
|
|
|
27
23
|
<template>
|
|
28
24
|
<div>
|
|
29
|
-
<div :class="[{ [$style['can-run']]: canRun }, $style.container]">
|
|
25
|
+
<div :class="[{ [$style['can-run']]: canRun, [$style.loading]: isLoading }, $style.container]">
|
|
30
26
|
<div :class="$style.badge">
|
|
31
27
|
<i :class="$style.blob">
|
|
32
28
|
<span>
|
|
@@ -35,12 +31,6 @@ const badgeText = computed(() => {
|
|
|
35
31
|
</i>
|
|
36
32
|
<span>{{ badgeText }}</span>
|
|
37
33
|
</div>
|
|
38
|
-
<PlTooltip v-if="false">
|
|
39
|
-
<template #tooltip>
|
|
40
|
-
{{ tooltipText }}
|
|
41
|
-
</template>
|
|
42
|
-
<PlIcon24 name="info" />
|
|
43
|
-
</PlTooltip>
|
|
44
34
|
<slot />
|
|
45
35
|
</div>
|
|
46
36
|
<div v-if="statusText" :class="$style.statusText">{{ statusText }}</div>
|
|
@@ -54,10 +44,16 @@ const badgeText = computed(() => {
|
|
|
54
44
|
gap: 8px;
|
|
55
45
|
--blob-color: #FF5C5C;
|
|
56
46
|
--badge-background: rgba(255, 92, 92, 0.12);
|
|
47
|
+
|
|
57
48
|
&.can-run {
|
|
58
49
|
--blob-color: #49CC49;
|
|
59
50
|
--badge-background: rgba(99, 224, 36, 0.12);
|
|
60
51
|
}
|
|
52
|
+
|
|
53
|
+
&.loading {
|
|
54
|
+
--blob-color: #FFAD0A;
|
|
55
|
+
--badge-background: rgba(255, 173, 10, 0.12);
|
|
56
|
+
}
|
|
61
57
|
}
|
|
62
58
|
|
|
63
59
|
.statusText {
|
|
@@ -4,6 +4,7 @@ import { PlTooltip, PlMaskIcon24 } from '@milaboratories/uikit';
|
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
6
6
|
userCabinetUrl: string;
|
|
7
|
+
email?: string;
|
|
7
8
|
}>();
|
|
8
9
|
|
|
9
10
|
const copiedMessage = ref('');
|
|
@@ -41,6 +42,10 @@ const copyToClipboard = () => {
|
|
|
41
42
|
<template #tooltip>{{ copiedMessage ? copiedMessage : 'Copy' }}</template>
|
|
42
43
|
</PlTooltip>
|
|
43
44
|
</div>
|
|
45
|
+
<div v-if="email" :class="$style.email">
|
|
46
|
+
<span>License owner:</span>
|
|
47
|
+
<span>{{ email }}</span>
|
|
48
|
+
</div>
|
|
44
49
|
</div>
|
|
45
50
|
<div :class="$style.hint">
|
|
46
51
|
* Copy and paste the link into your browser
|
|
@@ -57,6 +62,22 @@ const copyToClipboard = () => {
|
|
|
57
62
|
line-height: 16px;
|
|
58
63
|
}
|
|
59
64
|
|
|
65
|
+
.email {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
font-size: 12px;
|
|
70
|
+
color: var(--txt-03);
|
|
71
|
+
|
|
72
|
+
> span:last-child {
|
|
73
|
+
max-width: 200px;
|
|
74
|
+
text-overflow: ellipsis;
|
|
75
|
+
display: block;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
60
81
|
.copyIcon {
|
|
61
82
|
cursor: pointer;
|
|
62
83
|
}
|
|
@@ -66,8 +87,9 @@ const copyToClipboard = () => {
|
|
|
66
87
|
flex-direction: column;
|
|
67
88
|
gap: 8px;
|
|
68
89
|
padding: 12px;
|
|
69
|
-
background-color: #
|
|
90
|
+
background-color: #F7F8FA;
|
|
70
91
|
border-radius: 6px;
|
|
92
|
+
border: 1px solid #E1E3EB;
|
|
71
93
|
}
|
|
72
94
|
|
|
73
95
|
.urlLabel {
|
|
@@ -38,7 +38,7 @@ export function useInfo() {
|
|
|
38
38
|
|
|
39
39
|
const canRun = computed(() => !!result.value?.canRun);
|
|
40
40
|
|
|
41
|
-
const status = computed(() => currentInfo.value ? result.value?.status : '
|
|
41
|
+
const status = computed(() => currentInfo.value ? result.value?.status : '');
|
|
42
42
|
|
|
43
43
|
const customerEmail = computed(() => result.value?.customerEmail);
|
|
44
44
|
|