@dataloop-ai/components 0.19.162 → 0.19.164

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.19.162",
3
+ "version": "0.19.164",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -4,18 +4,9 @@
4
4
  :style="`max-width: ${maxWidth}`"
5
5
  class="confusion-matrix-container"
6
6
  >
7
- <dl-empty-state
8
- v-if="isEmpty"
9
- v-bind="emptyStateProps"
10
- >
11
- <template
12
- v-for="(_, slot) in $slots"
13
- #[slot]="props"
14
- >
15
- <slot
16
- :name="slot"
17
- v-bind="props"
18
- />
7
+ <dl-empty-state v-if="isEmpty" v-bind="emptyStateProps">
8
+ <template v-for="(_, slot) in $slots" #[slot]="props">
9
+ <slot :name="slot" v-bind="props" />
19
10
  </template>
20
11
  </dl-empty-state>
21
12
  <div
@@ -24,21 +15,11 @@
24
15
  :style="matrixStyles"
25
16
  class="wrapper"
26
17
  >
27
- <span
28
- ref="labelY"
29
- class="label-tag y"
30
- >
18
+ <span ref="labelY" class="label-tag y">
31
19
  {{ leftLabel }}
32
20
  </span>
33
- <div
34
- ref="yAxisOuter"
35
- class="y-axis-outer"
36
- >
37
- <div
38
- ref="yAxis"
39
- class="y-axis"
40
- style="min-height: 100%"
41
- >
21
+ <div ref="yAxisOuter" class="y-axis-outer">
22
+ <div ref="yAxis" class="y-axis" style="min-height: 100%">
42
23
  <div
43
24
  v-for="(label, index) in labels"
44
25
  :key="index"
@@ -54,11 +35,8 @@
54
35
  v-if="labelImages[0]"
55
36
  class="legend-avatar"
56
37
  :src="labelImages[index]"
57
- >
58
- <span
59
- v-else
60
- class="label"
61
- >
38
+ />
39
+ <span v-else class="label label-y">
62
40
  {{ label }}
63
41
  </span>
64
42
  <dl-tooltip :offset="[0, 0]">
@@ -67,19 +45,13 @@
67
45
  </div>
68
46
  </div>
69
47
  </div>
70
- <div
71
- ref="verticalWrapper"
72
- class="vertical_wrapper"
73
- >
48
+ <div ref="verticalWrapper" class="vertical_wrapper">
74
49
  <div
75
50
  ref="matrixWrapper"
76
51
  class="matrix-wrapper"
77
52
  @scroll="handleMatrixScroll"
78
53
  >
79
- <div
80
- ref="matrix"
81
- class="matrix"
82
- >
54
+ <div ref="matrix" class="matrix">
83
55
  <div
84
56
  v-for="cell in flattenedMatrix"
85
57
  :key="`${cell.x}-${cell.y}`"
@@ -157,11 +129,8 @@
157
129
  v-if="labelImages[0]"
158
130
  class="legend-avatar"
159
131
  :src="labelImages[index]"
160
- >
161
- <span
162
- v-else
163
- class="label"
164
- >
132
+ />
133
+ <span v-else class="label label-x">
165
134
  {{ label }}
166
135
  </span>
167
136
  </span>
@@ -189,10 +158,7 @@
189
158
  />
190
159
  <span class="label-tag x"> {{ bottomLabel }} </span>
191
160
  </div>
192
- <div
193
- ref="colorSpectrum"
194
- class="color-spectrum"
195
- >
161
+ <div ref="colorSpectrum" class="color-spectrum">
196
162
  <div class="color-spectrum__gradient" />
197
163
  <div class="color-spectrum__gradation">
198
164
  <div
@@ -200,16 +166,15 @@
200
166
  :key="value"
201
167
  class="color-spectrum__gradation--element"
202
168
  >
203
- <span class="color-spectrum__gradation--element-line">-</span>
169
+ <span class="color-spectrum__gradation--element-line"
170
+ >-</span
171
+ >
204
172
  {{ value !== gradationValues[0] ? value : null }}
205
173
  </div>
206
174
  </div>
207
175
  </div>
208
176
  </div>
209
- <div
210
- v-else
211
- class="invalid"
212
- >
177
+ <div v-else class="invalid">
213
178
  The given props cannot create a valid matrix.
214
179
  </div>
215
180
  </div>
@@ -543,14 +508,19 @@ export default defineComponent({
543
508
  }
544
509
 
545
510
  .label {
546
- transform: translateX(40%);
547
511
  display: block;
548
- text-align: start;
549
512
  width: 60px;
550
513
  white-space: nowrap;
551
514
  overflow: hidden;
552
515
  text-overflow: ellipsis;
553
516
  }
517
+ .label-x {
518
+ transform: translateX(40%);
519
+ text-align: start;
520
+ }
521
+ .label-y {
522
+ text-align: right;
523
+ }
554
524
 
555
525
  .label-tag {
556
526
  font-size: 0.8em;
@@ -283,19 +283,25 @@ export const useSuggestions = (
283
283
  }
284
284
 
285
285
  if (Array.isArray(dataType)) {
286
- localSuggestions = dataType
287
- .filter(
288
- (type) =>
289
- !knownDataTypes.includes(type as string) &&
290
- typeof type !== 'object'
291
- )
292
- .map((type) =>
293
- typeof type === 'string' ? `'${type}'` : type
294
- ) as string[]
286
+ const filteredTypes = dataType.filter(
287
+ (type) => !knownDataTypes.includes(type as string)
288
+ )
289
+ const mappedTypes: string[] = []
290
+ for (const type of filteredTypes) {
291
+ if (typeof type === 'string') {
292
+ mappedTypes.push(`'${type}'`)
293
+ } else if (typeof type === 'object') {
294
+ mappedTypes.push(
295
+ ...Object.keys(type).map((key) => `'${key}'`)
296
+ )
297
+ } else {
298
+ mappedTypes.push(type)
299
+ }
300
+ }
295
301
 
296
302
  if (!value) continue
297
303
 
298
- localSuggestions = getMatches(localSuggestions, value)
304
+ localSuggestions = getMatches(mappedTypes, value)
299
305
  } else if (
300
306
  dataType === 'datetime' ||
301
307
  dataType === 'date' ||
@@ -637,10 +643,12 @@ const getValueMatch = (
637
643
  }
638
644
  return null
639
645
  }
640
- const getMatches = (strArr: string[], str: string | number | boolean) =>
641
- strArr.filter((val) =>
646
+ const getMatches = (strArr: string[], str: string | number | boolean) => {
647
+ const filtered = strArr.filter((val) =>
642
648
  insensitive(val.toString()).includes(insensitive(str.toString()))
643
649
  )
650
+ return filtered
651
+ }
644
652
 
645
653
  const isNextCharSpace = (input: string, str: string) => {
646
654
  const insensitiveInput = insensitive(input)