@dataloop-ai/components 0.20.123 → 0.20.124

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.123",
3
+ "version": "0.20.124",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -238,6 +238,7 @@
238
238
  :readonly="isReadonlyOption(item)"
239
239
  :indentation="indentation"
240
240
  :is-expanded="item.expanded"
241
+ :tooltip="getOptionTooltip(item)"
241
242
  @update:model-value="handleModelValueUpdate"
242
243
  @click="selectOption(item)"
243
244
  @selected="handleSelected"
@@ -288,6 +289,7 @@
288
289
  :readonly="isReadonlyOption(option)"
289
290
  :indentation="indentation"
290
291
  :is-expanded="isExpandedOption(option)"
292
+ :tooltip="getOptionTooltip(option)"
291
293
  @update:model-value="handleModelValueUpdate"
292
294
  @click="selectOption(option)"
293
295
  @selected="handleSelected"
@@ -984,6 +986,12 @@ export default defineComponent({
984
986
  getOptionCount(option: any) {
985
987
  return option?.count ?? null
986
988
  },
989
+ getOptionTooltip(option: DlSelectOptionType): string | null {
990
+ if (typeof option === 'object' && option?.tooltip) {
991
+ return option.tooltip
992
+ }
993
+ return null
994
+ },
987
995
  getKeyForOption(
988
996
  option:
989
997
  | string
@@ -5,6 +5,9 @@
5
5
  :class="[{ 'readonly-option': true }, { capitalized }]"
6
6
  :style="`padding-left: ${10 + depth * indentation}px;`"
7
7
  >
8
+ <dl-tooltip v-if="tooltip">
9
+ {{ tooltip }}
10
+ </dl-tooltip>
8
11
  <slot>
9
12
  {{ label ? (capitalized ? label.toLowerCase() : label) : null }}
10
13
  </slot>
@@ -43,6 +46,9 @@
43
46
  @checked="handleSingleSelect"
44
47
  @unchecked="handleSingleDeselect"
45
48
  >
49
+ <dl-tooltip v-if="tooltip">
50
+ {{ tooltip }}
51
+ </dl-tooltip>
46
52
  <slot>
47
53
  {{
48
54
  capitalized
@@ -54,6 +60,9 @@
54
60
  <span v-if="count" class="counter"> ({{ count }}) </span>
55
61
  </span>
56
62
  <div v-else :class="{ capitalized }">
63
+ <dl-tooltip v-if="tooltip">
64
+ {{ tooltip }}
65
+ </dl-tooltip>
57
66
  <slot>
58
67
  {{
59
68
  capitalized
@@ -88,6 +97,7 @@
88
97
  :is-expanded="isExpanded"
89
98
  :filter-term="filterTerm"
90
99
  :fit-content="fitContent"
100
+ :tooltip="tooltip"
91
101
  @update:model-value="handleCheckboxUpdate"
92
102
  @selected="handleSingleSelect($event, true)"
93
103
  @deselected="handleSingleDeselect"
@@ -119,7 +129,7 @@
119
129
  import { defineComponent, PropType } from 'vue-demi'
120
130
  import { DlListItem } from '../../../basic'
121
131
  import { DlIcon, DlCheckbox, DlEllipsis } from '../../../essential'
122
- import { DlItemSection } from '../../../shared'
132
+ import { DlItemSection, DlTooltip } from '../../../shared'
123
133
  import { v4 } from 'uuid'
124
134
  import { debounce } from 'lodash'
125
135
  import { stateManager } from '../../../../StateManager'
@@ -139,7 +149,8 @@ export default defineComponent({
139
149
  DlItemSection,
140
150
  DlCheckbox,
141
151
  DlIcon,
142
- DlEllipsis
152
+ DlEllipsis,
153
+ DlTooltip
143
154
  },
144
155
  model: {
145
156
  prop: 'modelValue',
@@ -182,7 +193,8 @@ export default defineComponent({
182
193
  selectChildren: {
183
194
  type: Boolean,
184
195
  default: true
185
- }
196
+ },
197
+ tooltip: { type: String, default: null }
186
198
  },
187
199
  emits: [
188
200
  'update:model-value',
@@ -5,6 +5,7 @@ export interface DlSelectOption {
5
5
  expanded?: boolean
6
6
  children?: DlSelectOption[]
7
7
  readonly?: boolean
8
+ tooltip?: string
8
9
  }
9
10
 
10
11
  export type DlSelectOptionType = string | number | DlSelectOption