@dataloop-ai/components 0.16.42 → 0.16.44
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
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
:id="uuid"
|
|
5
5
|
:tabindex="tabIndex"
|
|
6
6
|
class="dl-chip"
|
|
7
|
+
:class="chipClass"
|
|
7
8
|
:style="cssChipVars"
|
|
8
9
|
>
|
|
9
10
|
<slot name="prefix" />
|
|
@@ -67,13 +68,7 @@ const transformOptions: string[] = [
|
|
|
67
68
|
'capitalize',
|
|
68
69
|
'uppercase',
|
|
69
70
|
'lowercase',
|
|
70
|
-
'
|
|
71
|
-
'full-size-kana',
|
|
72
|
-
'inherit',
|
|
73
|
-
'initial',
|
|
74
|
-
'revert',
|
|
75
|
-
'revert-layer',
|
|
76
|
-
'unset'
|
|
71
|
+
'default'
|
|
77
72
|
]
|
|
78
73
|
|
|
79
74
|
export default defineComponent({
|
|
@@ -96,7 +91,7 @@ export default defineComponent({
|
|
|
96
91
|
tabIndex: { type: [String, Number], default: '' },
|
|
97
92
|
transform: {
|
|
98
93
|
type: String,
|
|
99
|
-
default: '
|
|
94
|
+
default: 'default',
|
|
100
95
|
validator: (value: string): boolean =>
|
|
101
96
|
transformOptions.includes(value)
|
|
102
97
|
},
|
|
@@ -141,6 +136,12 @@ export default defineComponent({
|
|
|
141
136
|
|
|
142
137
|
return this.iconColor
|
|
143
138
|
},
|
|
139
|
+
chipClass(): string {
|
|
140
|
+
if (this.transform === 'default') {
|
|
141
|
+
return 'first-letter-capitalized'
|
|
142
|
+
}
|
|
143
|
+
return null
|
|
144
|
+
},
|
|
144
145
|
cssChipVars(): Record<string, string | number> {
|
|
145
146
|
return {
|
|
146
147
|
'--dl-chip-max-width': this.fit
|
|
@@ -180,7 +181,9 @@ export default defineComponent({
|
|
|
180
181
|
'--dl-chip-left-icon-cursor': this.disabled
|
|
181
182
|
? 'not-allowed'
|
|
182
183
|
: 'pointer',
|
|
183
|
-
'--dl-chip-text-transform': this.
|
|
184
|
+
'--dl-chip-text-transform': this.chipClass
|
|
185
|
+
? null
|
|
186
|
+
: this.transform
|
|
184
187
|
}
|
|
185
188
|
}
|
|
186
189
|
},
|
|
@@ -213,10 +216,6 @@ export default defineComponent({
|
|
|
213
216
|
color: var(--dl-chip-text-color);
|
|
214
217
|
background-color: var(--dl-chip-bg-color);
|
|
215
218
|
border: var(--dl-chip-border);
|
|
216
|
-
&::first-letter,
|
|
217
|
-
& > *::first-letter {
|
|
218
|
-
text-transform: capitalize;
|
|
219
|
-
}
|
|
220
219
|
|
|
221
220
|
&--content {
|
|
222
221
|
cursor: default;
|
|
@@ -231,6 +230,14 @@ export default defineComponent({
|
|
|
231
230
|
overflow: hidden;
|
|
232
231
|
}
|
|
233
232
|
}
|
|
233
|
+
|
|
234
|
+
.dl-chip.first-letter-capitalized {
|
|
235
|
+
&::first-letter,
|
|
236
|
+
& > *::first-letter {
|
|
237
|
+
text-transform: capitalize;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
234
241
|
.dl-chip-remove-icon-container {
|
|
235
242
|
cursor: var(--dl-chip-left-icon-cursor);
|
|
236
243
|
position: absolute;
|
package/src/demo/DlChipDemo.vue
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<DlChip
|
|
67
67
|
removable
|
|
68
68
|
icon="icon-dl-search"
|
|
69
|
-
label="
|
|
69
|
+
label="chip filled"
|
|
70
70
|
@remove="log('test')"
|
|
71
71
|
/>
|
|
72
72
|
<DlChip
|
|
@@ -78,19 +78,19 @@
|
|
|
78
78
|
removable
|
|
79
79
|
icon="icon-dl-search"
|
|
80
80
|
outlined
|
|
81
|
-
label="
|
|
81
|
+
label="chip outlined"
|
|
82
82
|
@remove="log('test')"
|
|
83
83
|
/>
|
|
84
84
|
<DlChip
|
|
85
85
|
removable
|
|
86
86
|
icon="icon-dl-search"
|
|
87
87
|
disabled
|
|
88
|
-
label="
|
|
88
|
+
label="chip disabled"
|
|
89
89
|
@remove="log('test')"
|
|
90
90
|
/>
|
|
91
91
|
<DlChip
|
|
92
92
|
removable
|
|
93
|
-
label="
|
|
93
|
+
label="ellipsed Chip with a multiple words"
|
|
94
94
|
icon="icon-dl-search"
|
|
95
95
|
@remove="log('test')"
|
|
96
96
|
/>
|
|
@@ -130,7 +130,17 @@
|
|
|
130
130
|
<DlChip
|
|
131
131
|
ref="removableChip"
|
|
132
132
|
removable
|
|
133
|
-
label="
|
|
133
|
+
label="ellipsed Chip with a multiple words"
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
<h4>Chips with no text transform</h4>
|
|
137
|
+
<div
|
|
138
|
+
class="col"
|
|
139
|
+
style="margin-bottom: 30px"
|
|
140
|
+
>
|
|
141
|
+
<DlChip
|
|
142
|
+
label="ellipsed Chip with a multiple words"
|
|
143
|
+
transform="none"
|
|
134
144
|
/>
|
|
135
145
|
</div>
|
|
136
146
|
<div class="col">
|