@dataloop-ai/components 0.20.232 → 0.20.233

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.20.232",
3
+ "version": "0.20.233",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -23,7 +23,7 @@
23
23
  "check-only": "if grep -E -H -r --exclude-dir=.git --exclude-dir=node_modules --exclude=*.json --exclude=*.yml '^(describe|it).only' .; then echo 'Found only in test files' && exit 1; fi"
24
24
  },
25
25
  "dependencies": {
26
- "@dataloop-ai/icons": "^3.1.63",
26
+ "@dataloop-ai/icons": "^3.1.65",
27
27
  "@monaco-editor/loader": "^1.4.0",
28
28
  "@types/flat": "^5.0.2",
29
29
  "@types/lodash": "^4.14.184",
@@ -37,6 +37,10 @@
37
37
  :hide-bottom="hideBottom"
38
38
  :hide-no-data="hideNoData"
39
39
  identifier-as-tooltip
40
+ :class="{
41
+ 'dl-label-picker-tree-table': true,
42
+ 'has-not-children': hasNotChildren
43
+ }"
40
44
  @row-click="handleRowClick"
41
45
  >
42
46
  <template #body-cell-displayLabel="item">
@@ -65,6 +69,7 @@ import { DlLabel, DlIcon } from '../../essential'
65
69
  import { DlInput, DlTreeTable } from '../../compound'
66
70
  import { DlEmptyStateProps, DlTableColumn, DlTableRow } from '../../types'
67
71
  import { DlLabelPickerItem } from './types'
72
+ import { v4 } from 'uuid'
68
73
 
69
74
  export default defineComponent({
70
75
  name: 'DlLabelPicker',
@@ -142,6 +147,9 @@ export default defineComponent({
142
147
  emit('click', item)
143
148
  }
144
149
 
150
+ const hasNotChildren = computed(() => {
151
+ return !items.value?.some((item) => item.children?.length > 0)
152
+ })
145
153
  const placeHolderText = computed(() => {
146
154
  if (!currentSelectedLabel.value) {
147
155
  return 'Search a label'
@@ -183,7 +191,8 @@ export default defineComponent({
183
191
  mapObjects(item, (obj: DlLabelPickerItem) => {
184
192
  return {
185
193
  ...obj,
186
- name: obj.displayLabel
194
+ name: obj.displayLabel,
195
+ id: obj.id || v4()
187
196
  }
188
197
  })
189
198
  )
@@ -260,6 +269,7 @@ export default defineComponent({
260
269
  return {
261
270
  handleRowClick,
262
271
  inputValue,
272
+ hasNotChildren,
263
273
  columns,
264
274
  placeHolderText,
265
275
  inputStyles,
@@ -292,6 +302,15 @@ export default defineComponent({
292
302
  .dl-label-picker .dl-table tbody tr.selected td {
293
303
  background-color: var(--dl-color-fill);
294
304
  }
305
+ .dl-label-picker > div.dl-label-picker-tree-table td.dl-draggable-container {
306
+ width: 0;
307
+ padding: 0;
308
+ }
309
+ .dl-label-picker
310
+ > div.dl-label-picker-tree-table.has-not-children
311
+ td.chevron-icon-container {
312
+ width: 10px;
313
+ }
295
314
  </style>
296
315
 
297
316
  <style>
@@ -3,4 +3,5 @@ export type DlLabelPickerItem = {
3
3
  identifier: string
4
4
  displayLabel: string
5
5
  children?: DlLabelPickerItem[]
6
+ id?: string
6
7
  }
@@ -1068,7 +1068,7 @@ export default defineComponent({
1068
1068
  const parentMap = buildParentMap(props.rows)
1069
1069
  let level = 1
1070
1070
  let currentId = row.id
1071
- while (parentMap.has(currentId)) {
1071
+ while (parentMap.has(currentId) && currentId) {
1072
1072
  level++
1073
1073
  currentId = parentMap.get(currentId)!
1074
1074
  }
@@ -11,9 +11,10 @@
11
11
  @mouseleave="onRowHoverEnd($event, row, rowIndex)"
12
12
  >
13
13
  <td
14
- :style="`width: 25px; opacity: ${
14
+ :style="`opacity: ${
15
15
  isDragIconVisible || isRowHighlighted ? '1' : '0'
16
16
  }`"
17
+ class="dl-draggable-container"
17
18
  >
18
19
  <dl-icon
19
20
  v-if="hasDraggableRows && !row.disableDraggable"
@@ -452,4 +453,7 @@ export default defineComponent({
452
453
  cursor: default;
453
454
  }
454
455
  }
456
+ .dl-draggable-container {
457
+ width: 25px;
458
+ }
455
459
  </style>