@dataloop-ai/components 0.19.163 → 0.19.165

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.163",
3
+ "version": "0.19.165",
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;
@@ -676,25 +676,20 @@ export default defineComponent({
676
676
  }
677
677
 
678
678
  const handleValueTrim = () => {
679
- nextTick(() => {
680
- const trimmed = String(modelValue.value).trim()
681
- if (trimmed !== String(modelValue.value)) {
682
- isInternalChange.value = true
679
+ const trimmed = String(modelValue.value).trim()
680
+ if (trimmed !== String(modelValue.value)) {
681
+ isInternalChange.value = true
683
682
 
684
- input.value.innerHTML = trimmed
685
- .toString()
686
- .replace(/ /g, '&nbsp;')
687
- updateSyntax()
688
- setCaretAtTheEnd(input.value)
683
+ input.value.innerHTML = trimmed
684
+ .toString()
685
+ .replace(/ /g, '&nbsp;')
686
+ updateSyntax()
687
+ setCaretAtTheEnd(input.value)
689
688
 
690
- const toEmit = trimmed.replace(
691
- new RegExp('&nbsp;', 'g'),
692
- ' '
693
- )
694
- emit('input', toEmit)
695
- emit('update:model-value', toEmit)
696
- }
697
- })
689
+ const toEmit = trimmed.replace(new RegExp('&nbsp;', 'g'), ' ')
690
+ emit('input', toEmit)
691
+ emit('update:model-value', toEmit)
692
+ }
698
693
  }
699
694
 
700
695
  const debouncedHandleValueTrim = computed<Function>(() => {
@@ -838,7 +833,7 @@ export default defineComponent({
838
833
  })
839
834
 
840
835
  const onModelValueChange = (val: string | number) => {
841
- if (!isInternalChange.value && val !== null && val !== undefined) {
836
+ if (val !== null && val !== undefined) {
842
837
  if (readonly.value || disabled.value) {
843
838
  return
844
839
  }
@@ -848,9 +843,8 @@ export default defineComponent({
848
843
  }
849
844
 
850
845
  input.value.innerHTML = val.toString().replace(/ /g, '&nbsp;')
851
- } else {
852
- isInternalChange.value = false
853
846
  }
847
+ isInternalChange.value = false
854
848
  }
855
849
 
856
850
  const debouncedOnModelValueChange = computed<Function>(() => {
@@ -869,6 +863,11 @@ export default defineComponent({
869
863
  watch(
870
864
  modelValue,
871
865
  (val: string | number) => {
866
+ if (isInternalChange.value) {
867
+ isInternalChange.value = false
868
+ return
869
+ }
870
+
872
871
  nextTick(() => {
873
872
  if (firstTime.value) {
874
873
  if (readonly.value || disabled.value) {
@@ -1170,6 +1169,10 @@ export default defineComponent({
1170
1169
  e.preventDefault()
1171
1170
  return
1172
1171
  }
1172
+ if (e.key === 'Enter' && !e.shiftKey) {
1173
+ e.preventDefault()
1174
+ return
1175
+ }
1173
1176
  }
1174
1177
  },
1175
1178
  onClick(e: Event, item: DlInputSuggestion) {