gi-component 0.0.40 → 0.0.42
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
|
@@ -51,10 +51,10 @@ const getCardClass = computed(() => {
|
|
|
51
51
|
if (props.bordered) {
|
|
52
52
|
arr.push(b('card--bordered'))
|
|
53
53
|
}
|
|
54
|
+
arr.push(b(`card--${props.size}`))
|
|
54
55
|
if (props.inner) {
|
|
55
56
|
arr.push(b('card--inner'))
|
|
56
57
|
}
|
|
57
|
-
arr.push(b(`card--${props.size}`))
|
|
58
58
|
return arr.join(' ')
|
|
59
59
|
})
|
|
60
60
|
|
|
@@ -132,24 +132,6 @@ const getHeaderClass = computed(() => {
|
|
|
132
132
|
box-sizing: border-box;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
.#{a.$prefix}-card--full {
|
|
136
|
-
.#{a.$prefix}-card-body {
|
|
137
|
-
flex: 1;
|
|
138
|
-
display: flex;
|
|
139
|
-
flex-direction: column;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.#{a.$prefix}-card--inner {
|
|
144
|
-
|
|
145
|
-
.#{a.$prefix}-card-header,
|
|
146
|
-
.#{a.$prefix}-card-body,
|
|
147
|
-
.#{a.$prefix}-card-footer {
|
|
148
|
-
padding-left: 0;
|
|
149
|
-
padding-right: 0;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
135
|
.#{a.$prefix}-card--small {
|
|
154
136
|
.#{a.$prefix}-card-header {
|
|
155
137
|
height: 36px;
|
|
@@ -168,4 +150,22 @@ const getHeaderClass = computed(() => {
|
|
|
168
150
|
padding: var(--card-padding-y-small) var(--card-padding-x-small);
|
|
169
151
|
}
|
|
170
152
|
}
|
|
153
|
+
|
|
154
|
+
.#{a.$prefix}-card--full {
|
|
155
|
+
.#{a.$prefix}-card-body {
|
|
156
|
+
flex: 1;
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.#{a.$prefix}-card--inner {
|
|
163
|
+
|
|
164
|
+
.#{a.$prefix}-card-header,
|
|
165
|
+
.#{a.$prefix}-card-body,
|
|
166
|
+
.#{a.$prefix}-card-footer {
|
|
167
|
+
padding-left: 0;
|
|
168
|
+
padding-right: 0;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
171
|
</style>
|
|
@@ -24,8 +24,8 @@ const classNames = computed(() => [b('flex')])
|
|
|
24
24
|
|
|
25
25
|
const gapMap: Record<string, string> = {
|
|
26
26
|
small: '8px',
|
|
27
|
-
middle: '
|
|
28
|
-
large: '
|
|
27
|
+
middle: '12px',
|
|
28
|
+
large: '16px'
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
const resolvedGap = computed(() => {
|
|
@@ -50,7 +50,7 @@ const resolvedWrap = computed(() => {
|
|
|
50
50
|
const style = computed<CSSProperties>(() => {
|
|
51
51
|
const obj: CSSProperties = {
|
|
52
52
|
display: 'flex',
|
|
53
|
-
flexDirection: props.vertical ? 'column' : 'row',
|
|
53
|
+
flexDirection: props.column || props.vertical ? 'column' : 'row',
|
|
54
54
|
flexWrap: resolvedWrap.value,
|
|
55
55
|
justifyContent: props.justify,
|
|
56
56
|
alignItems: props.align
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export interface FlexProps {
|
|
2
2
|
/** Flex 主轴的方向是否垂直,使用 flex-direction: column */
|
|
3
|
+
column?: boolean
|
|
4
|
+
/** 与 column 同义,保留用于兼容旧版 API */
|
|
3
5
|
vertical?: boolean
|
|
4
6
|
/** 设置元素单行显示还是多行显示,参考 flex-wrap;支持布尔值,true 为 wrap,false 为 nowrap */
|
|
5
7
|
wrap?: 'nowrap' | 'wrap' | 'wrap-reverse' | boolean | ''
|
|
@@ -26,8 +26,9 @@ import { useBemClass } from '../../../hooks'
|
|
|
26
26
|
|
|
27
27
|
const props = withDefaults(defineProps<TagProps>(), {
|
|
28
28
|
type: 'light',
|
|
29
|
-
color: '
|
|
29
|
+
color: 'info',
|
|
30
30
|
size: 'default',
|
|
31
|
+
round: false,
|
|
31
32
|
closable: false
|
|
32
33
|
})
|
|
33
34
|
|
|
@@ -96,8 +97,6 @@ function stylesForType(
|
|
|
96
97
|
rgb: { r: number, g: number, b: number }
|
|
97
98
|
): CSSProperties {
|
|
98
99
|
const { r, g, b } = rgb
|
|
99
|
-
const bgTint = `rgba(${r}, ${g}, ${b}, 0.1)`
|
|
100
|
-
const borderTint = `rgba(${r}, ${g}, ${b}, 0.2)`
|
|
101
100
|
/** 与主题色标签一致:悬停时白字 + 实心色底 */
|
|
102
101
|
const closeHoverVars = {
|
|
103
102
|
'--tag-close-hover-color': '#fff',
|
|
@@ -116,21 +115,21 @@ function stylesForType(
|
|
|
116
115
|
return {
|
|
117
116
|
color,
|
|
118
117
|
backgroundColor: 'transparent',
|
|
119
|
-
borderColor:
|
|
118
|
+
borderColor: `rgba(${r}, ${g}, ${b}, 0.6)`,
|
|
120
119
|
...closeHoverVars
|
|
121
120
|
}
|
|
122
121
|
case 'light-outline':
|
|
123
122
|
return {
|
|
124
123
|
color,
|
|
125
|
-
backgroundColor:
|
|
126
|
-
borderColor:
|
|
124
|
+
backgroundColor: `rgba(${r}, ${g}, ${b}, 0.1)`,
|
|
125
|
+
borderColor: `rgba(${r}, ${g}, ${b}, 0.2)`,
|
|
127
126
|
...closeHoverVars
|
|
128
127
|
}
|
|
129
128
|
case 'light':
|
|
130
129
|
default:
|
|
131
130
|
return {
|
|
132
131
|
color,
|
|
133
|
-
backgroundColor:
|
|
132
|
+
backgroundColor: `rgba(${r}, ${g}, ${b}, 0.1)`,
|
|
134
133
|
...closeHoverVars
|
|
135
134
|
}
|
|
136
135
|
}
|
|
@@ -142,6 +141,7 @@ const className = computed(() => {
|
|
|
142
141
|
b('tag'),
|
|
143
142
|
props.type && b(`tag__type--${props.type}`),
|
|
144
143
|
props.size && b(`tag__size--${props.size}`),
|
|
144
|
+
props.round && b('tag--round'),
|
|
145
145
|
c && isSemanticThemeColor(c) && b(`tag__color--${c}`)
|
|
146
146
|
].filter(Boolean).join(' ')
|
|
147
147
|
})
|
|
@@ -185,10 +185,13 @@ $tag-size-large-padding: 0 10px;
|
|
|
185
185
|
font-size: 12px;
|
|
186
186
|
line-height: 1;
|
|
187
187
|
white-space: nowrap;
|
|
188
|
-
cursor: pointer;
|
|
189
188
|
border-radius: 3px;
|
|
190
189
|
}
|
|
191
190
|
|
|
191
|
+
.#{a.$prefix}-tag--round {
|
|
192
|
+
border-radius: 9999px;
|
|
193
|
+
}
|
|
194
|
+
|
|
192
195
|
.#{a.$prefix}-tag__icon {
|
|
193
196
|
display: inline-flex;
|
|
194
197
|
flex-shrink: 0;
|
|
@@ -237,6 +240,7 @@ $tag-size-large-padding: 0 10px;
|
|
|
237
240
|
padding: $tag-size-small-padding;
|
|
238
241
|
|
|
239
242
|
.#{a.$prefix}-tag__icon {
|
|
243
|
+
|
|
240
244
|
:deep(.el-icon),
|
|
241
245
|
:deep(svg) {
|
|
242
246
|
width: 10px;
|
|
@@ -265,6 +269,7 @@ $tag-size-large-padding: 0 10px;
|
|
|
265
269
|
padding: $tag-size-large-padding;
|
|
266
270
|
|
|
267
271
|
.#{a.$prefix}-tag__icon {
|
|
272
|
+
|
|
268
273
|
:deep(.el-icon),
|
|
269
274
|
:deep(svg) {
|
|
270
275
|
width: 12px;
|
|
@@ -316,7 +321,7 @@ $tag-size-large-padding: 0 10px;
|
|
|
316
321
|
@each $s in $theme-colors {
|
|
317
322
|
&.#{a.$prefix}-tag__color--#{$s} {
|
|
318
323
|
color: var(--el-color-#{$s});
|
|
319
|
-
border-color: var(--el-color-#{$s});
|
|
324
|
+
border-color: var(--el-color-#{$s}-light-5);
|
|
320
325
|
|
|
321
326
|
--tag-close-hover-color: #fff;
|
|
322
327
|
--tag-close-hover-bg-color: var(--el-color-#{$s});
|
|
@@ -332,11 +337,19 @@ $tag-size-large-padding: 0 10px;
|
|
|
332
337
|
&.#{a.$prefix}-tag__color--#{$s} {
|
|
333
338
|
color: var(--el-color-#{$s});
|
|
334
339
|
background-color: var(--el-color-#{$s}-light-9);
|
|
335
|
-
border-color: var(--el-color-#{$s}-light-
|
|
340
|
+
border-color: var(--el-color-#{$s}-light-7);
|
|
336
341
|
|
|
337
342
|
--tag-close-hover-color: #fff;
|
|
338
343
|
--tag-close-hover-bg-color: var(--el-color-#{$s});
|
|
339
344
|
}
|
|
340
345
|
}
|
|
341
346
|
}
|
|
347
|
+
|
|
348
|
+
.#{a.$prefix}-tag__type--light,
|
|
349
|
+
.#{a.$prefix}-tag__type--outline,
|
|
350
|
+
.#{a.$prefix}-tag__type--light-outline {
|
|
351
|
+
&.#{a.$prefix}-tag__color--info {
|
|
352
|
+
color: var(--el-color-text-primary);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
342
355
|
</style>
|