@dataloop-ai/components 0.18.55 → 0.18.56
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 +1 -1
- package/src/assets/globals.scss +6 -0
- package/src/components/basic/DlButton/DlButton.vue +15 -21
- package/src/components/basic/DlChip/DlChip.vue +2 -16
- package/src/components/basic/DlMarkupTable/DlMarkupTable.vue +20 -8
- package/src/components/compound/DlDropdownButton/DlDropdownButton.vue +1 -1
- package/src/components/essential/DlLink/DlLink.vue +11 -1
- package/src/demos/DlButtonDemo.vue +1 -1
package/package.json
CHANGED
package/src/assets/globals.scss
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
:id="uuid"
|
|
4
|
-
class="
|
|
4
|
+
:class="containerClasses"
|
|
5
5
|
style="pointer-events: none"
|
|
6
|
-
:style="[cssButtonVars, containerStyles
|
|
6
|
+
:style="[cssButtonVars, containerStyles]"
|
|
7
7
|
>
|
|
8
8
|
<button
|
|
9
9
|
v-if="hasContent || hasIcon"
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
setMaxHeight
|
|
74
74
|
} from './utils'
|
|
75
75
|
import type { ButtonSizes } from './utils'
|
|
76
|
-
import { computed, defineComponent, PropType, ref } from 'vue-demi'
|
|
76
|
+
import { computed, defineComponent, PropType, ref, toRefs } from 'vue-demi'
|
|
77
77
|
import { colorNames } from '../../../utils/css-color-names'
|
|
78
78
|
import { useSizeObserver } from '../../../hooks/use-size-observer'
|
|
79
79
|
import { v4 } from 'uuid'
|
|
@@ -179,11 +179,16 @@ export default defineComponent({
|
|
|
179
179
|
},
|
|
180
180
|
emits: ['click', 'mousedown', 'dblclick'],
|
|
181
181
|
setup(props) {
|
|
182
|
+
const { active } = toRefs(props)
|
|
182
183
|
const buttonLabelRef = ref(null)
|
|
183
184
|
const { hasEllipsis } = useSizeObserver(buttonLabelRef)
|
|
184
185
|
|
|
185
186
|
const buttonClass = computed(() => {
|
|
186
|
-
|
|
187
|
+
const classes = ['dl-button']
|
|
188
|
+
if (active.value) {
|
|
189
|
+
classes.push('active-class')
|
|
190
|
+
}
|
|
191
|
+
return classes
|
|
187
192
|
})
|
|
188
193
|
|
|
189
194
|
return {
|
|
@@ -194,6 +199,12 @@ export default defineComponent({
|
|
|
194
199
|
}
|
|
195
200
|
},
|
|
196
201
|
computed: {
|
|
202
|
+
containerClasses(): string[] {
|
|
203
|
+
return [
|
|
204
|
+
'dl-button-container',
|
|
205
|
+
`dl-text-transform--${this.transform}`
|
|
206
|
+
]
|
|
207
|
+
},
|
|
197
208
|
getIconColor(): string {
|
|
198
209
|
if (this.iconColor) {
|
|
199
210
|
return this.iconColor
|
|
@@ -203,12 +214,6 @@ export default defineComponent({
|
|
|
203
214
|
return this.textColor
|
|
204
215
|
}
|
|
205
216
|
|
|
206
|
-
return 'dl-color-secondary'
|
|
207
|
-
},
|
|
208
|
-
capitalizeFirst(): string {
|
|
209
|
-
if (this.transform === 'default') {
|
|
210
|
-
return 'first-letter-capitalized'
|
|
211
|
-
}
|
|
212
217
|
return null
|
|
213
218
|
},
|
|
214
219
|
computedStyles(): Record<string, string> {
|
|
@@ -356,9 +361,6 @@ export default defineComponent({
|
|
|
356
361
|
: setPadding(this.size),
|
|
357
362
|
'--dl-button-margin': this.margin,
|
|
358
363
|
'--dl-button-font-size': setFontSize(this.size),
|
|
359
|
-
'--dl-button-text-transform': this.capitalizeFirst
|
|
360
|
-
? null
|
|
361
|
-
: this.transform,
|
|
362
364
|
'--dl-button-cursor': this.isActionable
|
|
363
365
|
? 'pointer'
|
|
364
366
|
: 'not-allowed',
|
|
@@ -424,7 +426,6 @@ export default defineComponent({
|
|
|
424
426
|
padding: var(--dl-button-padding);
|
|
425
427
|
margin: var(--dl-button-margin);
|
|
426
428
|
border-radius: var(--dl-button-border-radius);
|
|
427
|
-
text-transform: var(--dl-button-text-transform);
|
|
428
429
|
font-family: 'Roboto', sans-serif;
|
|
429
430
|
font-size: var(--dl-button-font-size);
|
|
430
431
|
cursor: var(--dl-button-cursor);
|
|
@@ -484,13 +485,6 @@ export default defineComponent({
|
|
|
484
485
|
transition: var(--dl-button-text-transition-duration);
|
|
485
486
|
}
|
|
486
487
|
|
|
487
|
-
.dl-button-container.first-letter-capitalized {
|
|
488
|
-
&::first-letter,
|
|
489
|
-
& > *::first-letter {
|
|
490
|
-
text-transform: capitalize;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
|
|
494
488
|
.dl-button-container {
|
|
495
489
|
display: inline-block;
|
|
496
490
|
width: var(--dl-button-container-width);
|
|
@@ -127,10 +127,7 @@ export default defineComponent({
|
|
|
127
127
|
return this.iconColor
|
|
128
128
|
},
|
|
129
129
|
chipClass(): string {
|
|
130
|
-
|
|
131
|
-
return 'first-letter-capitalized'
|
|
132
|
-
}
|
|
133
|
-
return null
|
|
130
|
+
return `dl-text-transform--${this.transform}`
|
|
134
131
|
},
|
|
135
132
|
cssChipVars(): Record<string, string | number> {
|
|
136
133
|
return {
|
|
@@ -170,10 +167,7 @@ export default defineComponent({
|
|
|
170
167
|
'--dl-chip-left-icon-hover-opacity': this.disabled ? 1 : 0.8,
|
|
171
168
|
'--dl-chip-left-icon-cursor': this.disabled
|
|
172
169
|
? 'not-allowed'
|
|
173
|
-
: 'pointer'
|
|
174
|
-
'--dl-chip-text-transform': this.chipClass
|
|
175
|
-
? null
|
|
176
|
-
: this.transform
|
|
170
|
+
: 'pointer'
|
|
177
171
|
}
|
|
178
172
|
}
|
|
179
173
|
},
|
|
@@ -193,7 +187,6 @@ export default defineComponent({
|
|
|
193
187
|
position: relative;
|
|
194
188
|
display: flex;
|
|
195
189
|
vertical-align: middle;
|
|
196
|
-
text-transform: var(--dl-chip-text-transform);
|
|
197
190
|
font-size: var(--dl-font-size-body);
|
|
198
191
|
line-height: 12px;
|
|
199
192
|
border-radius: 2px;
|
|
@@ -220,13 +213,6 @@ export default defineComponent({
|
|
|
220
213
|
}
|
|
221
214
|
}
|
|
222
215
|
|
|
223
|
-
.dl-chip.first-letter-capitalized {
|
|
224
|
-
&::first-letter,
|
|
225
|
-
& > *::first-letter {
|
|
226
|
-
text-transform: capitalize;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
216
|
.dl-chip-remove-icon-container {
|
|
231
217
|
cursor: var(--dl-chip-left-icon-cursor);
|
|
232
218
|
position: absolute;
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
<script lang="ts">
|
|
13
13
|
import { v4 } from 'uuid'
|
|
14
|
-
import { defineComponent, computed, ref } from 'vue-demi'
|
|
14
|
+
import { defineComponent, computed, ref, PropType, toRefs } from 'vue-demi'
|
|
15
|
+
import { DlTextTransformOptions } from '../../shared/types'
|
|
15
16
|
|
|
16
17
|
const separatorValues = ['horizontal', 'vertical', 'cell', 'none']
|
|
17
18
|
|
|
@@ -22,7 +23,14 @@ export default defineComponent({
|
|
|
22
23
|
flat: Boolean,
|
|
23
24
|
bordered: Boolean,
|
|
24
25
|
square: Boolean,
|
|
25
|
-
|
|
26
|
+
/** wraps the cells */
|
|
27
|
+
wrap: Boolean,
|
|
28
|
+
transform: {
|
|
29
|
+
type: String as PropType<DlTextTransformOptions>,
|
|
30
|
+
default: 'default',
|
|
31
|
+
validator: (value: DlTextTransformOptions): boolean =>
|
|
32
|
+
Object.values(DlTextTransformOptions).includes(value)
|
|
33
|
+
},
|
|
26
34
|
|
|
27
35
|
separator: {
|
|
28
36
|
type: String,
|
|
@@ -32,17 +40,21 @@ export default defineComponent({
|
|
|
32
40
|
}
|
|
33
41
|
},
|
|
34
42
|
setup(props) {
|
|
43
|
+
const { transform, dense, separator, flat, bordered, square, wrap } =
|
|
44
|
+
toRefs(props)
|
|
45
|
+
|
|
35
46
|
const uuid = ref(`dl-markup-table-${v4()}`)
|
|
36
47
|
|
|
37
48
|
const classes = computed(
|
|
38
49
|
() =>
|
|
39
50
|
'dl-markup-table dl-table__container dl-table__card' +
|
|
40
|
-
` dl-table--${
|
|
41
|
-
(
|
|
42
|
-
(
|
|
43
|
-
(
|
|
44
|
-
(
|
|
45
|
-
(
|
|
51
|
+
` dl-table--${separator.value}-separator` +
|
|
52
|
+
(dense.value === true ? ' dl-table--dense' : '') +
|
|
53
|
+
(flat.value === true ? ' dl-table--flat' : '') +
|
|
54
|
+
(bordered.value === true ? ' dl-table--bordered' : '') +
|
|
55
|
+
(square.value === true ? ' dl-table--square' : '') +
|
|
56
|
+
(wrap.value === false ? ' dl-table--no-wrap' : '') +
|
|
57
|
+
` dl-text-transform--${transform.value}`
|
|
46
58
|
)
|
|
47
59
|
|
|
48
60
|
return {
|
|
@@ -24,7 +24,7 @@ import { getLinkTarget, getLinkRel } from './utils'
|
|
|
24
24
|
export default defineComponent({
|
|
25
25
|
name: 'DlLink',
|
|
26
26
|
props: {
|
|
27
|
-
href: { required:
|
|
27
|
+
href: { required: false, type: String, default: null },
|
|
28
28
|
newtab: { required: false, default: false, type: Boolean },
|
|
29
29
|
external: { required: false, default: false, type: Boolean },
|
|
30
30
|
disabled: { required: false, default: false, type: Boolean },
|
|
@@ -37,6 +37,9 @@ export default defineComponent({
|
|
|
37
37
|
},
|
|
38
38
|
computed: {
|
|
39
39
|
link(): string {
|
|
40
|
+
if (!this.href) {
|
|
41
|
+
return null
|
|
42
|
+
}
|
|
40
43
|
return this.external
|
|
41
44
|
? `${this.href}`
|
|
42
45
|
: `${window.origin}/${this.href}`
|
|
@@ -45,9 +48,15 @@ export default defineComponent({
|
|
|
45
48
|
return this.color ?? 'dl-color-studio-secondary'
|
|
46
49
|
},
|
|
47
50
|
target(): string | null {
|
|
51
|
+
if (!this.href) {
|
|
52
|
+
return null
|
|
53
|
+
}
|
|
48
54
|
return getLinkTarget(this.newtab)
|
|
49
55
|
},
|
|
50
56
|
rel(): string | null {
|
|
57
|
+
if (!this.href) {
|
|
58
|
+
return null
|
|
59
|
+
}
|
|
51
60
|
return getLinkRel(this.external)
|
|
52
61
|
}
|
|
53
62
|
},
|
|
@@ -63,6 +72,7 @@ a {
|
|
|
63
72
|
|
|
64
73
|
a:hover {
|
|
65
74
|
text-decoration: underline;
|
|
75
|
+
cursor: pointer;
|
|
66
76
|
}
|
|
67
77
|
|
|
68
78
|
.disabled {
|