Skip to content

Commit

Permalink
feat(table): support default color in pill and state cells (#392) (#399)
Browse files Browse the repository at this point in the history
close #392
  • Loading branch information
brc-dd committed Nov 21, 2023
1 parent 38a1586 commit bc4d843
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion docs/components/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,9 @@ interface TableCellActions {
}

type ColorModes =
| 'neutral'
| 'default'
| 'mute'
| 'neutral'
| 'info'
| 'success'
| 'warning'
Expand Down
6 changes: 2 additions & 4 deletions lib/components/STableCellPill.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<script setup lang="ts">
import { computed } from 'vue'
import SPill from './SPill.vue'
export type Color = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
import SPill, { type Mode } from './SPill.vue'
const props = defineProps<{
value?: any
record: any
getter?: string | ((value: any, record: any) => string)
color?: Color | ((value: any, record: any) => Color)
color?: Mode | ((value: any, record: any) => Mode)
}>()
const _value = computed(() => {
Expand Down
4 changes: 2 additions & 2 deletions lib/composables/Table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export type TableCellType =
| 'component'
| 'actions'

export type ColorModes = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
export type ColorModes = 'default' | 'mute' | 'neutral' | 'info' | 'success' | 'warning' | 'danger'

export interface TableCellBase {
type: TableCellType
Expand Down Expand Up @@ -135,7 +135,7 @@ export interface TableCellPills extends TableCellBase {

export interface TableCellPillItem {
label: string
color: TableCellPillColor
color?: TableCellPillColor
}

export interface TableCellAvatar extends TableCellBase {
Expand Down

0 comments on commit bc4d843

Please sign in to comment.