@dataloop-ai/components 0.19.32 → 0.19.34
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
|
@@ -118,7 +118,8 @@ export default defineComponent({
|
|
|
118
118
|
type: Boolean,
|
|
119
119
|
default: false,
|
|
120
120
|
required: false
|
|
121
|
-
}
|
|
121
|
+
},
|
|
122
|
+
dense: Boolean
|
|
122
123
|
},
|
|
123
124
|
setup(props) {
|
|
124
125
|
const progressValue = (progress: DlKpiProgressType) => {
|
|
@@ -132,8 +133,8 @@ export default defineComponent({
|
|
|
132
133
|
|
|
133
134
|
const isSingleWord = (text: string) => text?.split(' ').length === 1
|
|
134
135
|
|
|
135
|
-
const cssVars = computed(() => {
|
|
136
|
-
|
|
136
|
+
const cssVars = computed<Record<string, string>>(() => {
|
|
137
|
+
const vars: Record<string, string> = {
|
|
137
138
|
'--dl-kpi-border': props.bordered
|
|
138
139
|
? '1px solid var(--dl-color-separator)'
|
|
139
140
|
: '',
|
|
@@ -144,6 +145,11 @@ export default defineComponent({
|
|
|
144
145
|
? '100%'
|
|
145
146
|
: '90%'
|
|
146
147
|
}
|
|
148
|
+
|
|
149
|
+
if (props.dense) {
|
|
150
|
+
vars['--dl-kpi-padding'] = '0'
|
|
151
|
+
}
|
|
152
|
+
return vars
|
|
147
153
|
})
|
|
148
154
|
|
|
149
155
|
const hasValue = computed(() => {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
:info-message="kpiInfoMessage(item)"
|
|
22
22
|
:progress="null"
|
|
23
23
|
:small="small"
|
|
24
|
+
:dense="dense"
|
|
24
25
|
/>
|
|
25
26
|
</div>
|
|
26
27
|
<div class="divider" />
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
import { v4 } from 'uuid'
|
|
34
35
|
import { defineComponent, PropType } from 'vue-demi'
|
|
35
36
|
import { DlKpi } from '../../basic'
|
|
36
|
-
import { DlKpiCounterFormat } from '../../types'
|
|
37
|
+
import { DlKpiCounterFormat, DlKpiCounterType } from '../../types'
|
|
37
38
|
import { DlCounterItem } from './types'
|
|
38
39
|
|
|
39
40
|
export default defineComponent({
|
|
@@ -68,7 +69,8 @@ export default defineComponent({
|
|
|
68
69
|
subtitleFontSize: {
|
|
69
70
|
type: String,
|
|
70
71
|
default: '12px'
|
|
71
|
-
}
|
|
72
|
+
},
|
|
73
|
+
dense: Boolean
|
|
72
74
|
},
|
|
73
75
|
data() {
|
|
74
76
|
return {
|
|
@@ -77,9 +79,15 @@ export default defineComponent({
|
|
|
77
79
|
},
|
|
78
80
|
computed: {
|
|
79
81
|
cssVars(): Record<string, string> {
|
|
80
|
-
|
|
82
|
+
const vars: Record<string, string> = {
|
|
81
83
|
'--dl-counter-spacing': this.spacing
|
|
82
84
|
}
|
|
85
|
+
|
|
86
|
+
if (this.dense) {
|
|
87
|
+
vars['--dl-counters-padding'] = '0'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return vars
|
|
83
91
|
}
|
|
84
92
|
},
|
|
85
93
|
methods: {
|
|
@@ -93,7 +101,7 @@ export default defineComponent({
|
|
|
93
101
|
return {
|
|
94
102
|
value: item.value ?? 0,
|
|
95
103
|
format: item.format ?? DlKpiCounterFormat.long
|
|
96
|
-
}
|
|
104
|
+
} as DlKpiCounterType
|
|
97
105
|
},
|
|
98
106
|
kpiInfoMessage(item: DlCounterItem) {
|
|
99
107
|
return item.infoMessage || null
|
|
@@ -104,7 +112,7 @@ export default defineComponent({
|
|
|
104
112
|
|
|
105
113
|
<style scoped lang="scss">
|
|
106
114
|
.dl-counters-container {
|
|
107
|
-
padding: 10px;
|
|
115
|
+
padding: var(--dl-counters-padding, 10px);
|
|
108
116
|
width: fit-content;
|
|
109
117
|
}
|
|
110
118
|
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
} from 'vanilla-jsoneditor'
|
|
27
27
|
import { debounce } from 'lodash'
|
|
28
28
|
import { stateManager } from '../../../StateManager'
|
|
29
|
+
import { nextTick } from 'process'
|
|
29
30
|
|
|
30
31
|
export default defineComponent({
|
|
31
32
|
model: {
|
|
@@ -150,6 +151,10 @@ export default defineComponent({
|
|
|
150
151
|
jsonEditor.value?.set({
|
|
151
152
|
text: modelValue.value
|
|
152
153
|
})
|
|
154
|
+
|
|
155
|
+
nextTick(() => {
|
|
156
|
+
jsonEditor.value?.refresh()
|
|
157
|
+
})
|
|
153
158
|
}
|
|
154
159
|
|
|
155
160
|
watch(readonly, (val) => {
|