@dataloop-ai/components 0.17.40 → 0.17.42

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": "@dataloop-ai/components",
3
- "version": "0.17.40",
3
+ "version": "0.17.42",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -109,3 +109,10 @@
109
109
  opacity: 1;
110
110
  }
111
111
  }
112
+
113
+ .spinner-text {
114
+ font-size: 1em;
115
+ margin-top: 15px;
116
+ display: flex;
117
+ justify-content: center;
118
+ }
@@ -4,31 +4,61 @@
4
4
  class="dl-text-holder"
5
5
  >
6
6
  <span v-if="prefix">{{ prefixPreview }}</span>
7
- <span class="dl-text-holder--value">
8
- <slot> {{ textPreview }} </slot>
9
- </span>
7
+ <dl-ellipsis
8
+ :text="textPreview"
9
+ :split="split"
10
+ :split-position="splitPosition"
11
+ />
10
12
  <span v-if="suffix"> {{ suffixPreview }}</span>
11
13
  </span>
12
14
  </template>
13
15
 
14
16
  <script lang="ts">
15
17
  import { v4 } from 'uuid'
18
+ import { DlEllipsis } from '../../basic/DlEllipsis'
16
19
  import { defineComponent } from 'vue-demi'
17
20
 
18
21
  export default defineComponent({
19
22
  name: 'DlTextHolder',
23
+ components: { DlEllipsis },
20
24
  props: {
25
+ /**
26
+ * Prefix to be displayed
27
+ */
21
28
  prefix: {
22
29
  type: String,
23
30
  default: null
24
31
  },
32
+ /**
33
+ * Suffix to be displayed
34
+ */
25
35
  suffix: {
26
36
  type: String,
27
37
  default: null
28
38
  },
39
+ /**
40
+ * Text to be displayed
41
+ */
29
42
  text: {
30
43
  type: String,
31
- required: true
44
+ default: ''
45
+ },
46
+ /**
47
+ * Allows to split the text in two parts
48
+ */
49
+ split: {
50
+ type: Boolean,
51
+ default: false,
52
+ required: false
53
+ },
54
+ /**
55
+ * Position of the split in the text, % of the text length
56
+ */
57
+ splitPosition: {
58
+ type: Number,
59
+ required: false,
60
+ default: 0.5,
61
+ validator: (value: number) => value >= 0 && value <= 1
32
62
  }
33
63
  },
34
64
  data() {
@@ -44,7 +74,7 @@ export default defineComponent({
44
74
  return this.suffix?.trim() ?? ''
45
75
  },
46
76
  textPreview(): string {
47
- return this.text
77
+ return this.text || ''
48
78
  }
49
79
  }
50
80
  })
@@ -55,11 +85,6 @@ export default defineComponent({
55
85
  display: flex;
56
86
  flex-wrap: nowrap;
57
87
  width: 100%;
58
-
59
- &--value {
60
- white-space: nowrap;
61
- overflow: hidden;
62
- text-overflow: ellipsis;
63
- }
88
+ white-space: nowrap;
64
89
  }
65
90
  </style>
@@ -6,8 +6,6 @@
6
6
  type="default"
7
7
  text="Loading..."
8
8
  :text-styles="{
9
- fontSize: '1em',
10
- marginTop: '15px',
11
9
  marginLeft: '10px'
12
10
  }"
13
11
  />
@@ -10,9 +10,17 @@
10
10
  <dl-text-holder
11
11
  prefix="home/Desktop/"
12
12
  suffix=".mp3"
13
- >
14
- very-loooooooooooong-named-song2
15
- </dl-text-holder>
13
+ text="very-loooooooooooong-named-song"
14
+ split
15
+ />
16
+
17
+ <dl-text-holder
18
+ prefix="home/Desktop/"
19
+ suffix=".mp3"
20
+ text="very-loooooooooooong-named-song"
21
+ split
22
+ :split-position="0.7"
23
+ />
16
24
  </div>
17
25
  </div>
18
26
  </template>