gi-component 0.0.40 → 0.0.41

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,7 +1,7 @@
1
1
  {
2
2
  "name": "gi-component",
3
3
  "type": "module",
4
- "version": "0.0.40",
4
+ "version": "0.0.41",
5
5
  "description": "Vue3中基于Element Plus二次封装基础组件库",
6
6
  "author": "lin",
7
7
  "license": "MIT",
@@ -26,8 +26,9 @@ import { useBemClass } from '../../../hooks'
26
26
 
27
27
  const props = withDefaults(defineProps<TagProps>(), {
28
28
  type: 'light',
29
- color: 'primary',
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: color,
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: bgTint,
126
- borderColor: borderTint,
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: bgTint,
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-5);
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>
@@ -31,6 +31,8 @@ export interface TagProps {
31
31
  * 左侧图标组件(如 `@element-plus/icons-vue` 图标);与 `#icon` 插槽同时存在时以插槽为准
32
32
  */
33
33
  icon?: Component
34
+ /** 是否为胶囊圆角(大圆角) */
35
+ round?: boolean
34
36
  /** 是否可关闭 */
35
37
  closable?: boolean
36
38
  }