diff --git a/.prettierrc.yaml b/.prettierrc.yaml
new file mode 100644
index 00000000..38d9aa9a
--- /dev/null
+++ b/.prettierrc.yaml
@@ -0,0 +1,4 @@
+semi: false
+singleQuote: true
+printWidth: 80
+trailingComma: none
diff --git a/lib/components/STableCell.vue b/lib/components/STableCell.vue
index 74af2144..fbff8c99 100644
--- a/lib/components/STableCell.vue
+++ b/lib/components/STableCell.vue
@@ -1,6 +1,7 @@
+
+
+
+
+
+
+
+
diff --git a/lib/components/STableHeader.vue b/lib/components/STableHeader.vue
index c96398a3..e12d2d9d 100644
--- a/lib/components/STableHeader.vue
+++ b/lib/components/STableHeader.vue
@@ -1,6 +1,6 @@
diff --git a/lib/composables/Table.ts b/lib/composables/Table.ts
index de9b763c..1be44bb6 100644
--- a/lib/composables/Table.ts
+++ b/lib/composables/Table.ts
@@ -10,7 +10,7 @@ export interface Table<
orders: MaybeRef
columns: MaybeRef>
menu?: MaybeRef
- actions?: MaybeRef
+ actions?: MaybeRef
records?: MaybeRef
header?: MaybeRef
footer?: MaybeRef
@@ -64,6 +64,7 @@ export type TableCell =
| TableCellCustom
| TableCellEmpty
| TableCellComponent
+ | TableCellActions
export type TableCellType =
| 'text'
@@ -77,6 +78,9 @@ export type TableCellType =
| 'custom'
| 'empty'
| 'component'
+ | 'actions'
+
+export type ColorModes = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
export interface TableCellBase {
type: TableCellType
@@ -105,14 +109,7 @@ export interface TableCellNumber extends TableCellBase {
onClick?(value: any, record: any): void
}
-export type TableCellValueColor =
- | 'neutral'
- | 'soft'
- | 'mute'
- | 'info'
- | 'success'
- | 'warning'
- | 'danger'
+export type TableCellValueColor = ColorModes | 'soft'
export interface TableCellDay extends TableCellBase {
type: 'day'
@@ -128,7 +125,7 @@ export interface TableCellPill extends TableCellBase {
color?: TableCellPillColor | ((value: any, record: any) => TableCellPillColor)
}
-export type TableCellPillColor = 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
+export type TableCellPillColor = ColorModes
export interface TableCellPills extends TableCellBase {
type: 'pills'
@@ -177,7 +174,21 @@ export interface TableCellComponent extends TableCellBase {
export interface TableCellState extends TableCellBase {
type: 'state'
label: string
- mode?: 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
+ mode?: ColorModes
+}
+
+export interface TableCellActions extends TableCellBase {
+ type: 'actions'
+ actions: TableCellAction[]
+}
+
+export interface TableCellAction {
+ mode?: ColorModes
+ icon?: any
+ iconMode?: ColorModes
+ label?: string
+ labelMode?: ColorModes
+ onClick(value: any, record: any): void
}
export interface TableMenu {
@@ -186,11 +197,11 @@ export interface TableMenu {
dropdown: DropdownSection[]
}
-export interface TableAction {
+export interface TableHeaderAction {
show?: boolean
- mode?: 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
+ mode?: ColorModes
label: string
- labelMode?: 'neutral' | 'mute' | 'info' | 'success' | 'warning' | 'danger'
+ labelMode?: ColorModes
onClick(): void
}
diff --git a/stories/components/STable.01_Playground.story.vue b/stories/components/STable.01_Playground.story.vue
index 61267a6d..f09054c5 100644
--- a/stories/components/STable.01_Playground.story.vue
+++ b/stories/components/STable.01_Playground.story.vue
@@ -1,5 +1,8 @@