@dataloop-ai/components 0.19.278 → 0.19.280

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.278",
3
+ "version": "0.19.280",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -7,6 +7,9 @@
7
7
  has-prepend
8
8
  padding-prop="0px 0px 0px 0px"
9
9
  :style="inputStyles"
10
+ @focus="onFocus"
11
+ @blur="onBlur"
12
+ @clear="onClear"
10
13
  >
11
14
  <template #prepend>
12
15
  <dl-icon
@@ -34,6 +37,7 @@
34
37
  :empty-state-props="emptyStateProps"
35
38
  :hide-bottom="hideBottom"
36
39
  :hide-no-data="hideNoData"
40
+ identifier-as-tooltip
37
41
  @row-click="handleRowClick"
38
42
  >
39
43
  <template #body-cell-displayLabel="item">
@@ -41,6 +45,7 @@
41
45
  :text="item.row.displayLabel"
42
46
  :indicator-color="item.row.color"
43
47
  class="dl-label-picker-item"
48
+ :data-label-picker-identifier="item.row.identifier"
44
49
  />
45
50
  </template>
46
51
  </dl-tree-table>
@@ -48,7 +53,15 @@
48
53
  </template>
49
54
 
50
55
  <script lang="ts">
51
- import { ref, PropType, defineComponent, computed, toRefs } from 'vue-demi'
56
+ import {
57
+ ref,
58
+ PropType,
59
+ defineComponent,
60
+ computed,
61
+ toRefs,
62
+ onMounted,
63
+ nextTick
64
+ } from 'vue-demi'
52
65
  import { DlLabel, DlIcon } from '../../essential'
53
66
  import { DlInput, DlTreeTable } from '../../compound'
54
67
  import { DlEmptyStateProps, DlTableColumn, DlTableRow } from '../../types'
@@ -94,7 +107,7 @@ export default defineComponent({
94
107
  default: false
95
108
  }
96
109
  },
97
- emits: ['selected-label', 'click'],
110
+ emits: ['selected-label', 'click', 'focus', 'blur', 'clear'],
98
111
  setup(props, { emit, slots }) {
99
112
  const { items } = toRefs(props)
100
113
 
@@ -188,6 +201,26 @@ export default defineComponent({
188
201
  }
189
202
  return false
190
203
  }
204
+
205
+ onMounted(() => {
206
+ nextTick(() => {
207
+ if (items.value?.[0]?.identifier) {
208
+ const target = table.value.$el.querySelector(
209
+ `[data-label-picker-identifier="${items.value[0].identifier}"]`
210
+ )
211
+ target?.closest('tr')?.classList.add('selected')
212
+ }
213
+ })
214
+ })
215
+ const onFocus = (event: InputEvent) => {
216
+ emit('focus', event)
217
+ }
218
+ const onBlur = (event: InputEvent) => {
219
+ emit('blur', event)
220
+ }
221
+ const onClear = (event: InputEvent) => {
222
+ emit('clear', event)
223
+ }
191
224
  return {
192
225
  handleRowClick,
193
226
  inputValue,
@@ -196,7 +229,10 @@ export default defineComponent({
196
229
  inputStyles,
197
230
  rows,
198
231
  table,
199
- isFilterString
232
+ isFilterString,
233
+ onClear,
234
+ onBlur,
235
+ onFocus
200
236
  }
201
237
  }
202
238
  })
@@ -1,6 +1,5 @@
1
1
  export * from './highlightSyntax'
2
2
 
3
- import { DateInterval } from '../../../DlDateTime/types'
4
3
  import { ColorSchema, SyntaxColorSchema, Filters } from '../types'
5
4
  import {
6
5
  operators,
@@ -165,6 +165,13 @@ export default defineComponent({
165
165
  type: Boolean,
166
166
  default: false
167
167
  },
168
+ /**
169
+ * identifier As Tooltip form row object
170
+ */
171
+ identifierAsTooltip: {
172
+ type: Boolean,
173
+ default: false
174
+ },
168
175
  /**
169
176
  * Function to generate the label visible when selecting rows
170
177
  */
@@ -530,6 +537,7 @@ export default defineComponent({
530
537
  computedCols: tableRootRef.value.computedCols,
531
538
  modelValue: isRowSelected(props.rowKey, getRowKey.value(row)),
532
539
  scopedSlots: currentSlots,
540
+ tooltip: props.identifierAsTooltip ? row.identifier : null,
533
541
  'onUpdate:modelValue': (adding: boolean, evt: Event) => {
534
542
  updateSelectionHierarchy(adding, evt, row)
535
543
  },
@@ -6,7 +6,10 @@
6
6
  :data-col-index="colIndex"
7
7
  >
8
8
  <slot name="icon" />
9
- <dl-tooltip v-if="hasEllipsis">
9
+ <dl-tooltip v-if="tooltip">
10
+ {{ tooltip }}
11
+ </dl-tooltip>
12
+ <dl-tooltip v-else-if="hasEllipsis">
10
13
  <slot />
11
14
  </dl-tooltip>
12
15
  <slot />
@@ -39,6 +42,10 @@ export default defineComponent({
39
42
  colIndex: {
40
43
  type: Number,
41
44
  default: null
45
+ },
46
+ tooltip: {
47
+ type: String,
48
+ default: null
42
49
  }
43
50
  },
44
51
  setup(props) {
@@ -53,6 +53,7 @@
53
53
  }px;`
54
54
  "
55
55
  :col-index="colIndex"
56
+ :tooltip="tooltip"
56
57
  >
57
58
  <template v-if="!hasSlotByName(`body-cell-${col.name}`)">
58
59
  {{ getCellValue(col, row) }}
@@ -149,6 +150,10 @@ export default defineComponent({
149
150
  modelValue: {
150
151
  type: [String, Boolean],
151
152
  default: null
153
+ },
154
+ tooltip: {
155
+ type: String,
156
+ default: null
152
157
  }
153
158
  },
154
159
  emits: [
@@ -26,17 +26,17 @@ const rows: DlLabelPickerItem[] = [
26
26
  color: '#ff0000',
27
27
  children: [
28
28
  {
29
- identifier: 'b',
29
+ identifier: 'a.a',
30
30
  displayLabel: 'hello',
31
31
  color: '#ffff00',
32
32
  children: [
33
33
  {
34
- identifier: 'c',
34
+ identifier: 'a.a.a',
35
35
  displayLabel: 'test 2',
36
36
  color: '#00ff00',
37
37
  children: [
38
38
  {
39
- identifier: 'd',
39
+ identifier: 'a.a.a.a',
40
40
  displayLabel: 'test 3',
41
41
  color: '#ff00aa',
42
42
  children: []
@@ -44,7 +44,7 @@ const rows: DlLabelPickerItem[] = [
44
44
  ]
45
45
  },
46
46
  {
47
- identifier: 'd',
47
+ identifier: 'a.a.b',
48
48
  displayLabel: 'test 4',
49
49
  color: '#ff00ff',
50
50
  children: []