@dataloop-ai/components 0.18.57 → 0.18.58

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.18.57",
3
+ "version": "0.18.58",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -327,4 +327,14 @@ html {
327
327
  flex-direction: row;
328
328
  }
329
329
 
330
+ // maybe add later
331
+ // .disabled,
332
+ // .disabled *,
333
+ [disabled],
334
+ [disabled] * {
335
+ opacity: 0.6 !important;
336
+ outline: 0 !important;
337
+ cursor: not-allowed !important;
338
+ }
339
+
330
340
  @import 'grid';
@@ -24,7 +24,7 @@
24
24
  >
25
25
  <dl-icon
26
26
  :icon="startIconData.icon"
27
- :color="startIconData.color"
27
+ :color="getIconColor(startIconData.color)"
28
28
  :size="startIconData.size"
29
29
  />
30
30
  </dl-item-section>
@@ -171,6 +171,9 @@ export default defineComponent({
171
171
  if (this.isClickable) {
172
172
  this.$emit('click', e)
173
173
  }
174
+ },
175
+ getIconColor(color: string) {
176
+ return this.disabled ? 'dl-color-disabled' : color
174
177
  }
175
178
  }
176
179
  })
@@ -29,10 +29,14 @@
29
29
  <slot name="default" />
30
30
  </dl-ellipsis>
31
31
  <span
32
- v-if="suffix"
33
- :class="fluid ? 'dl-label__fluid' : ''"
32
+ v-if="suffix || hasSuffixSlot"
33
+ class="dl-label__suffix-content"
34
+ :class="{ 'dl-label__fluid': fluid }"
34
35
  >
35
- {{ suffixPreview }}</span>
36
+ <slot name="suffix">
37
+ <dl-ellipsis :text="suffixPreview" />
38
+ </slot>
39
+ </span>
36
40
  <div class="dl-label__suffix">
37
41
  <div class="dl-label__suffix-slot">
38
42
  <slot
@@ -131,6 +135,9 @@ export default defineComponent({
131
135
  return !!slots['actions']
132
136
  })
133
137
 
138
+ const hasSuffixSlot = computed(() => {
139
+ return !!slots['suffix']
140
+ })
134
141
  const prefixPreview = computed(() => {
135
142
  return prefix.value?.trim() ?? ''
136
143
  })
@@ -143,6 +150,7 @@ export default defineComponent({
143
150
  mouseOver,
144
151
  styles,
145
152
  hasActions,
153
+ hasSuffixSlot,
146
154
  prefixPreview,
147
155
  suffixPreview
148
156
  }
@@ -172,6 +180,13 @@ export default defineComponent({
172
180
  &-icon {
173
181
  cursor: pointer;
174
182
  }
183
+ &-content {
184
+ max-width: 100%;
185
+ overflow: hidden;
186
+ text-overflow: ellipsis;
187
+ white-space: nowrap;
188
+ flex: 1 4 auto;
189
+ }
175
190
  }
176
191
  &__content {
177
192
  color: var(--dl-label-text-color);
@@ -58,7 +58,7 @@
58
58
  <dl-label
59
59
  label-color="dl-color-secondary"
60
60
  hint="tooltip"
61
- text="dl-labelaaaaaaaaaaaaaa"
61
+ text="dl-labelaaaaaaaaaaaaaadjsfskdlfjdslkfjskfljslkadjakldjdkljdkladjakldajdlkadsjakldaj"
62
62
  prefix="%"
63
63
  >
64
64
  <template #actions>
@@ -137,7 +137,7 @@
137
137
  label-color="dl-color-secondary"
138
138
  hint="tooltip"
139
139
  text="dl-labelaaaaaaaaaaaaaa"
140
- suffix=".mp3"
140
+ suffix=".mp3asdasdsfjksdhfjkdsfhkajshdsakjdhasjkdhaskjdhaskjdhaskjdhaskjfhdskjahrjkasdhjksadhasjkashjfg"
141
141
  fluid
142
142
  >
143
143
  <template #actions>
@@ -157,27 +157,34 @@
157
157
  </dl-label>
158
158
  </div>
159
159
  <div class="dl-text-holder-demo">
160
- Label with suffix and fluid
160
+ Label with a big suffix
161
161
  <dl-label
162
162
  label-color="dl-color-secondary"
163
163
  hint="tooltip"
164
164
  text="dl-labelaaaaaaaaaaaaaa"
165
- suffix=".mp3"
166
- fluid
165
+ suffix=".askdjhask jshadk jsah dajk dhsa djksahd ksaj dhajkd ah dkajsd haskd shds asd asd sadas "
166
+ />
167
+ </div>
168
+ <div class="dl-text-holder-demo">
169
+ Label with suffix and separator
170
+ <dl-label
171
+ id="show-both-ends"
172
+ text="I am a package name"
167
173
  >
168
- <template #actions>
169
- <div
174
+ <template #suffix>
175
+ <span
170
176
  style="
171
- display: flex;
172
- gap: 5px;
173
- align-items: center;
174
- height: 100%;
175
- margin-right: 5px;
177
+ width: 100%;
178
+ display: inline-flex;
179
+ gap: 2px;
180
+ margin-left: 2px;
176
181
  "
177
182
  >
178
- <dl-icon icon="icon-dl-add" />
179
- <dl-icon icon="icon-dl-delete" />
180
- </div>
183
+ <span style="color: var(--dl-color-lighter)">|</span>
184
+ <dl-ellipsis
185
+ text="I am a very long model name I am a very long model name"
186
+ />
187
+ </span>
181
188
  </template>
182
189
  </dl-label>
183
190
  </div>
@@ -186,12 +193,13 @@
186
193
 
187
194
  <script lang="ts">
188
195
  import { defineComponent } from 'vue-demi'
189
- import { DlLabel, DlIcon } from '../components'
196
+ import { DlLabel, DlIcon, DlEllipsis } from '../components'
190
197
 
191
198
  export default defineComponent({
192
199
  components: {
193
200
  DlLabel,
194
- DlIcon
201
+ DlIcon,
202
+ DlEllipsis
195
203
  }
196
204
  })
197
205
  </script>
@@ -201,8 +209,15 @@ export default defineComponent({
201
209
  display: flex;
202
210
  gap: 10px;
203
211
  flex-wrap: wrap;
204
- width: 200px;
212
+ width: 300px;
205
213
  padding: 5px;
206
214
  word-wrap: break-word;
207
215
  }
208
216
  </style>
217
+ <style lang="scss">
218
+ #show-both-ends {
219
+ .dl-label__suffix-content {
220
+ flex: 1 2 auto;
221
+ }
222
+ }
223
+ </style>