@dataloop-ai/components 0.16.26 → 0.16.27

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.16.26",
3
+ "version": "0.16.27",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -78,11 +78,10 @@ export default defineComponent({
78
78
  counterFontSize: {
79
79
  type: String,
80
80
  default: '1.88em',
81
- required: true
81
+ required: false
82
82
  },
83
83
  title: {
84
84
  type: String,
85
- default: '---',
86
85
  required: true
87
86
  },
88
87
  titleFontSize: {
@@ -130,7 +129,7 @@ export default defineComponent({
130
129
 
131
130
  const emptyString = '---'
132
131
 
133
- const isSingleWord = (text: string) => text.split(' ').length === 1
132
+ const isSingleWord = (text: string) => text?.split(' ').length === 1
134
133
 
135
134
  const cssVars = computed(() => {
136
135
  return {
@@ -227,7 +226,7 @@ export default defineComponent({
227
226
  box-sizing: border-box;
228
227
  justify-content: center;
229
228
  align-items: center;
230
- padding: 20px 6px;
229
+ padding: var(--dl-kpi-padding, 20px 6px);
231
230
  border-radius: 2px;
232
231
  overflow: hidden;
233
232
  border: var(--dl-kpi-border);
@@ -249,7 +248,7 @@ export default defineComponent({
249
248
  &__text {
250
249
  display: flex;
251
250
  flex-direction: row;
252
- max-width: var(--dl-kpi-title-max-width);
251
+ max-width: var(--dl-kpi-max-width, var(--dl-kpi-title-max-width));
253
252
  max-height: 40px;
254
253
  font-style: normal;
255
254
  font-weight: 400;
@@ -261,7 +260,10 @@ export default defineComponent({
261
260
  gap: 10px;
262
261
  }
263
262
  &__subtext {
264
- max-width: var(--dl-kpi-sub-title-max-width);
263
+ max-width: var(
264
+ --dl-kpi-max-width,
265
+ var(--dl-kpi-sub-title-max-width)
266
+ );
265
267
  max-height: 40px;
266
268
  font-style: normal;
267
269
  font-weight: 400;
@@ -13,11 +13,11 @@
13
13
  <div :class="computeClass('item-content')">
14
14
  <dl-kpi
15
15
  :counter="kpiValue(item.value)"
16
- counter-font-size="30px"
16
+ :counter-font-size="counterFontSize"
17
17
  :title="capitalize(item.text)"
18
- title-font-size="16px"
18
+ :title-font-size="titleFontSize"
19
19
  :subtitle="item.subtext && capitalize(item.subtext)"
20
- subtitle-font-size="12px"
20
+ :subtitle-font-size="subtitleFontSize"
21
21
  :info-message="null"
22
22
  :progress="null"
23
23
  :small="small"
@@ -51,16 +51,28 @@ export default defineComponent({
51
51
  type: Boolean,
52
52
  default: false
53
53
  },
54
- spacing: {
55
- type: String,
56
- default: '30px'
57
- },
58
54
  items: {
59
55
  type: Array as PropType<CounterItem[]>,
60
56
  default: (): CounterItem[] => [],
61
57
  validator(value: CounterItem[]): boolean {
62
58
  return value.length <= 8
63
59
  }
60
+ },
61
+ spacing: {
62
+ type: String,
63
+ default: '30px'
64
+ },
65
+ counterFontSize: {
66
+ type: String,
67
+ default: '30px'
68
+ },
69
+ titleFontSize: {
70
+ type: String,
71
+ default: '16px'
72
+ },
73
+ subtitleFontSize: {
74
+ type: String,
75
+ default: '12px'
64
76
  }
65
77
  },
66
78
  data() {
@@ -190,3 +202,9 @@ ul {
190
202
  }
191
203
  }
192
204
  </style>
205
+
206
+ <style lang="scss">
207
+ .dl-counters-container {
208
+ --dl-kpi-padding: '0px';
209
+ }
210
+ </style>