@polymarbot/nuxt-layer-shadcn-ui 0.8.2 → 0.8.4
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/app/components/ui/DataTable/index.vue +5 -6
- package/app/components/ui/DataTable/types.ts +4 -0
- package/app/components/ui/Drawer/index.stories.ts +2 -0
- package/app/components/ui/Drawer/index.vue +2 -0
- package/app/components/ui/Drawer/types.ts +1 -0
- package/app/components/ui/Modal/index.stories.ts +2 -0
- package/app/components/ui/Modal/index.vue +2 -0
- package/app/components/ui/Modal/types.ts +1 -0
- package/package.json +2 -2
|
@@ -213,9 +213,12 @@ function buildColumnClass (column: DataTableColumn, headerIndex?: number): strin
|
|
|
213
213
|
const isHeader = headerIndex !== undefined
|
|
214
214
|
const hasDivider = isHeader && headerIndex < props.columns.length - 1
|
|
215
215
|
|
|
216
|
+
const isDateType = column.type === 'date' || column.type === 'unixDate'
|
|
217
|
+
|
|
216
218
|
return cn(
|
|
217
219
|
column.align === 'center' && 'text-center',
|
|
218
220
|
column.align === 'right' && 'text-right',
|
|
221
|
+
isDateType ? 'whitespace-pre' : !column.wrap && 'whitespace-nowrap',
|
|
219
222
|
// Header-specific
|
|
220
223
|
isHeader && column.sortable && `
|
|
221
224
|
hover:text-foreground
|
|
@@ -224,6 +227,8 @@ function buildColumnClass (column: DataTableColumn, headerIndex?: number): strin
|
|
|
224
227
|
hasDivider && headerDividerClass,
|
|
225
228
|
// Fixed column last — sticky overrides relative via tailwind-merge
|
|
226
229
|
column.fixed && 'sticky z-10',
|
|
230
|
+
// User-provided class (kept last so it can override defaults)
|
|
231
|
+
isHeader ? column.headerClass : column.class,
|
|
227
232
|
)
|
|
228
233
|
}
|
|
229
234
|
|
|
@@ -238,12 +243,6 @@ function buildColumnStyle (column: DataTableColumn): Record<string, string> {
|
|
|
238
243
|
if (column.width) style.width = column.width
|
|
239
244
|
if (column.minWidth) style.minWidth = column.minWidth
|
|
240
245
|
|
|
241
|
-
if (column.type === 'date' || column.type === 'unixDate') {
|
|
242
|
-
style.whiteSpace = 'pre'
|
|
243
|
-
} else if (!column.wrap) {
|
|
244
|
-
style.whiteSpace = 'nowrap'
|
|
245
|
-
}
|
|
246
|
-
|
|
247
246
|
// Frozen column offset
|
|
248
247
|
const offset = frozenOffsets.value.get(column.field)
|
|
249
248
|
if (offset !== undefined) {
|
|
@@ -24,6 +24,10 @@ export interface DataTableColumn {
|
|
|
24
24
|
sortable?: boolean
|
|
25
25
|
/** Currency code for 'currency' type (e.g., 'USD', 'JPY'). Default: 'USD' */
|
|
26
26
|
currency?: string
|
|
27
|
+
/** Custom class applied to the body cell (`<td>`) container */
|
|
28
|
+
class?: string
|
|
29
|
+
/** Custom class applied to the header cell (`<th>`) container */
|
|
30
|
+
headerClass?: string
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
export interface DataTableProps<T = Record<string, any>> {
|
|
@@ -18,6 +18,7 @@ const meta = {
|
|
|
18
18
|
loading: { control: 'boolean' },
|
|
19
19
|
disabled: { control: 'boolean' },
|
|
20
20
|
confirmDisabled: { control: 'boolean' },
|
|
21
|
+
modal: { control: 'boolean' },
|
|
21
22
|
showCancel: { control: 'boolean' },
|
|
22
23
|
showClose: { control: 'boolean' },
|
|
23
24
|
closeOnClickOutside: { control: 'boolean' },
|
|
@@ -37,6 +38,7 @@ const meta = {
|
|
|
37
38
|
loading: false,
|
|
38
39
|
disabled: false,
|
|
39
40
|
confirmDisabled: false,
|
|
41
|
+
modal: true,
|
|
40
42
|
showCancel: true,
|
|
41
43
|
showClose: true,
|
|
42
44
|
closeOnClickOutside: false,
|
|
@@ -14,6 +14,7 @@ import type { DrawerProps } from './types'
|
|
|
14
14
|
defineOptions({ inheritAttrs: false })
|
|
15
15
|
|
|
16
16
|
const props = withDefaults(defineProps<DrawerProps>(), {
|
|
17
|
+
modal: true,
|
|
17
18
|
showCancel: true,
|
|
18
19
|
showClose: true,
|
|
19
20
|
closeOnClickOutside: false,
|
|
@@ -85,6 +86,7 @@ const contentClass = computed(() =>
|
|
|
85
86
|
<template>
|
|
86
87
|
<Sheet
|
|
87
88
|
:open="sheetOpen"
|
|
89
|
+
:modal="modal"
|
|
88
90
|
@update:open="onOpenUpdate"
|
|
89
91
|
>
|
|
90
92
|
<SheetTrigger
|
|
@@ -16,6 +16,7 @@ const meta = {
|
|
|
16
16
|
loading: { control: 'boolean' },
|
|
17
17
|
disabled: { control: 'boolean' },
|
|
18
18
|
confirmDisabled: { control: 'boolean' },
|
|
19
|
+
modal: { control: 'boolean' },
|
|
19
20
|
showCancel: { control: 'boolean' },
|
|
20
21
|
showClose: { control: 'boolean' },
|
|
21
22
|
closeOnClickOutside: { control: 'boolean' },
|
|
@@ -33,6 +34,7 @@ const meta = {
|
|
|
33
34
|
loading: false,
|
|
34
35
|
disabled: false,
|
|
35
36
|
confirmDisabled: false,
|
|
37
|
+
modal: true,
|
|
36
38
|
showCancel: true,
|
|
37
39
|
showClose: true,
|
|
38
40
|
closeOnClickOutside: false,
|
|
@@ -14,6 +14,7 @@ import type { ModalProps } from './types'
|
|
|
14
14
|
defineOptions({ inheritAttrs: false })
|
|
15
15
|
|
|
16
16
|
const props = withDefaults(defineProps<ModalProps>(), {
|
|
17
|
+
modal: true,
|
|
17
18
|
showCancel: true,
|
|
18
19
|
showClose: true,
|
|
19
20
|
closeOnClickOutside: false,
|
|
@@ -90,6 +91,7 @@ const contentClass = computed(() =>
|
|
|
90
91
|
<template>
|
|
91
92
|
<Dialog
|
|
92
93
|
:open="dialogOpen"
|
|
94
|
+
:modal="modal"
|
|
93
95
|
@update:open="onOpenUpdate"
|
|
94
96
|
>
|
|
95
97
|
<DialogTrigger
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polymarbot/nuxt-layer-shadcn-ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"description": "Nuxt layer providing shadcn-vue based UI components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"vue-i18n": "^11",
|
|
43
43
|
"vue-router": "^4 || ^5"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "d561383c133bd4f981cc2c289fbc675bcdaec917"
|
|
46
46
|
}
|