@dataloop-ai/components 0.18.138 → 0.18.140

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.18.138",
3
+ "version": "0.18.140",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -47,10 +47,12 @@
47
47
  </div>
48
48
  </button>
49
49
  <dl-tooltip
50
- v-if="tooltip"
50
+ v-if="tooltip || hasTooltipSlot"
51
51
  style="pointer-events: auto"
52
52
  >
53
- {{ tooltip }}
53
+ <slot name="tooltip">
54
+ {{ tooltip }}
55
+ </slot>
54
56
  </dl-tooltip>
55
57
  </div>
56
58
  </template>
@@ -273,6 +275,9 @@ export default defineComponent({
273
275
  hasContent(): boolean {
274
276
  return !!this.$slots.default || this.hasLabel
275
277
  },
278
+ hasTooltipSlot(): boolean {
279
+ return !!this.$slots.tooltip
280
+ },
276
281
  cssButtonVars(): Record<string, string> {
277
282
  let colors: Record<string, string> = {}
278
283
 
@@ -12,13 +12,13 @@
12
12
  >
13
13
  <div :class="computeClass('item-content')">
14
14
  <dl-kpi
15
- :counter="kpiValue(item.value)"
15
+ :counter="kpiValue(item)"
16
16
  :counter-font-size="counterFontSize"
17
17
  :title="capitalize(item.text)"
18
18
  :title-font-size="titleFontSize"
19
19
  :subtitle="item.subtext && capitalize(item.subtext)"
20
20
  :subtitle-font-size="subtitleFontSize"
21
- :info-message="null"
21
+ :info-message="kpiInfoMessage(item)"
22
22
  :progress="null"
23
23
  :small="small"
24
24
  />
@@ -89,11 +89,14 @@ export default defineComponent({
89
89
  computeClass(value: string): (string | boolean)[] {
90
90
  return [value, this.small && `${value}--small`]
91
91
  },
92
- kpiValue(value: string | number) {
92
+ kpiValue(item: DlCounterItem) {
93
93
  return {
94
- value: value ?? 0,
95
- format: DlKpiCounterFormat.long
94
+ value: item.value ?? 0,
95
+ format: item.format ?? DlKpiCounterFormat.long
96
96
  }
97
+ },
98
+ kpiInfoMessage(item: DlCounterItem) {
99
+ return item.infoMessage || null
97
100
  }
98
101
  }
99
102
  })
@@ -2,4 +2,6 @@ export interface DlCounterItem {
2
2
  value?: number
3
3
  text: string
4
4
  subtext?: string
5
+ infoMessage?: string
6
+ format?: string
5
7
  }
@@ -38,6 +38,33 @@
38
38
  }
39
39
  ]"
40
40
  />
41
+ <dl-counters
42
+ small
43
+ :items="[
44
+ {
45
+ value: 100000000,
46
+ text: 'lorem',
47
+ format: 'short',
48
+ infoMessage:
49
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'
50
+ },
51
+ {
52
+ value: '154h:35m:20s',
53
+ text: 'ipsum lorem',
54
+ subtext:
55
+ 'Cupidatat est labore et nisi do culpa veniam reprehenderit anim consectetur dolor mollit.',
56
+ format: 'hms',
57
+ infoMessage: '154h:35m:20s'
58
+ },
59
+ {
60
+ value: 6789,
61
+ text: 'lorem lorem ipsum',
62
+ subtext: 'Minim exercitation ipsum elit cillum magna.',
63
+ format: 'short',
64
+ infoMessage: '6789'
65
+ }
66
+ ]"
67
+ />
41
68
  </div>
42
69
  </template>
43
70