@milaboratories/uikit 2.2.39 → 2.2.40

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.39",
3
+ "version": "2.2.40",
4
4
  "type": "module",
5
5
  "main": "dist/pl-uikit.umd.js",
6
6
  "module": "dist/pl-uikit.js",
@@ -0,0 +1,42 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue';
3
+ import './pl-progress-cell.scss';
4
+ import PlMaskIcon24 from '../PlMaskIcon24/PlMaskIcon24.vue';
5
+ import type { PlProgressCellProps } from './types';
6
+
7
+ const props = withDefaults(defineProps<PlProgressCellProps>(), {
8
+ stage: 'not_started',
9
+ step: '',
10
+ progressString: '',
11
+ progress: undefined,
12
+ error: '',
13
+ });
14
+
15
+ const canShowWhiteBg = computed(() => props.stage !== 'not_started');
16
+
17
+ const currentProgress = computed(() => props.stage === 'done' ? 100 : Math.min(100, props.progress || 0));
18
+
19
+ const canShowInfinityLoader = computed(() => props.progress === undefined && props.stage !== 'done' && props.stage !== 'not_started' && !props.error);
20
+
21
+ console.log(props);
22
+ </script>
23
+
24
+ <template>
25
+ <div :class="{'progress-cell':true, 'progress-cell__white-bg': canShowWhiteBg, error, 'not-started': props.stage === 'not_started' }">
26
+ <div v-if="canShowInfinityLoader" class="progress-cell__infinity-loader">
27
+ <div class="progress-cell__infinity-gradient"/>
28
+ </div>
29
+ <div v-if="!canShowInfinityLoader && !error" class="progress-cell__indicator" :style="{ width: currentProgress + '%' }"/>
30
+ <div class="progress-cell__body">
31
+ <div class="progress-cell__stage text-s">
32
+ {{ error ? error : step }}
33
+ </div>
34
+ <div class="progress-cell__percentage text-s d-flex align-center justify-end">
35
+ <PlMaskIcon24 v-if="error" name="error" />
36
+ <template v-if="!error">
37
+ {{ progressString }}
38
+ </template>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </template>
@@ -0,0 +1,2 @@
1
+ export { default as PlProgressCell } from './PlProgressCell.vue';
2
+ export * from './types';
@@ -0,0 +1,88 @@
1
+ .progress-cell {
2
+ background-color: transparent;
3
+ height: 100%;
4
+ position: relative;
5
+ width: 100%;
6
+ overflow: hidden;
7
+ border-radius: 2px;
8
+
9
+ .mask-error {
10
+ background: var(--txt-error);
11
+ }
12
+
13
+ &.error {
14
+ * {
15
+ color: var(--txt-error) !important;
16
+ }
17
+ }
18
+
19
+ &.not-started {
20
+ * {
21
+ color: var(--txt-03) !important;
22
+ }
23
+ }
24
+
25
+ &__white-bg {
26
+ background-color: #fff;
27
+ }
28
+
29
+ &__indicator {
30
+ position: absolute;
31
+ height: 100%;
32
+ transition: width 0.4s ease-in-out;
33
+ background: linear-gradient(90deg, #fff 0%, #d8fac8 100%);
34
+ transition: width .2s ease-in-out;
35
+ }
36
+
37
+ &__body {
38
+ padding: 0 15px;
39
+ display: flex;
40
+ gap: 12px;
41
+ align-items: center;
42
+ height: 100%;
43
+ width: 100%;
44
+ position: absolute;
45
+ z-index: 1;
46
+ }
47
+
48
+ &__stage {
49
+ overflow: hidden;
50
+ text-overflow: ellipsis;
51
+ flex-shrink: 1;
52
+ text-wrap: nowrap;
53
+ }
54
+
55
+ &__percentage {
56
+ flex-grow: 1;
57
+ flex-shrink: 0;
58
+ text-align: right;
59
+ }
60
+
61
+ &__stage--queued {
62
+ color: var(--txt-03);
63
+ }
64
+
65
+ &__infinity-loader {
66
+ position: absolute;
67
+ inset: 0;
68
+ width: 100%;
69
+ height: 100%;
70
+ animation: move-gradient 2s linear infinite;
71
+ }
72
+
73
+ &__infinity-gradient {
74
+ width: 50%;
75
+ height: 100%;
76
+ background: linear-gradient(90deg, #FFF 0%, #D8FAC8 50%, #FFF 100%);
77
+ }
78
+ }
79
+
80
+ @keyframes move-gradient {
81
+ 0% {
82
+ transform: translateX(-50%);
83
+ }
84
+
85
+ 100% {
86
+ transform: translateX(100%);
87
+ }
88
+ }
@@ -0,0 +1,7 @@
1
+ export type PlProgressCellProps = {
2
+ stage: 'not_started' | 'running' | 'done';
3
+ step: string; // "Alignment" / "Queued"
4
+ progressString: string; // "20%" or "2 / 4"
5
+ progress?: number; // i.e. 0.2 for 20%; 'undefined' for unknown progress = animated progressbar
6
+ error?: string;
7
+ };
package/src/index.ts CHANGED
@@ -50,6 +50,7 @@ export * from './components/PlSectionSeparator';
50
50
  export * from './components/PlAccordion';
51
51
  export * from './components/PlStatusTag';
52
52
  export * from './components/PlLoaderCircular';
53
+ export * from './components/PlProgressCell';
53
54
 
54
55
  export * from './components/PlFileDialog';
55
56
  export * from './components/PlFileInput';