@una-ui/nuxt 0.50.4 → 0.51.0
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/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/data/table/Table.vue +19 -5
- package/dist/runtime/components/data/table/TableBody.vue +10 -4
- package/dist/runtime/components/data/table/TableCaption.vue +10 -4
- package/dist/runtime/components/data/table/TableCell.vue +10 -4
- package/dist/runtime/components/data/table/TableFooter.vue +10 -3
- package/dist/runtime/components/data/table/TableHead.vue +10 -4
- package/dist/runtime/components/data/table/TableHeader.vue +10 -4
- package/dist/runtime/components/data/table/TableRow.vue +10 -4
- package/dist/runtime/components/slots/FormFieldDefault.d.ts +2 -2
- package/dist/runtime/plugins/theme.client.d.ts +1 -1
- package/dist/runtime/plugins/theme.server.d.ts +1 -1
- package/dist/runtime/types/button.d.ts +12 -0
- package/dist/runtime/types/table.d.ts +8 -7
- package/package.json +3 -3
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -7,8 +7,10 @@ import type {
|
|
|
7
7
|
GroupingState,
|
|
8
8
|
Header,
|
|
9
9
|
PaginationState,
|
|
10
|
+
Row,
|
|
10
11
|
RowSelectionState,
|
|
11
12
|
SortingState,
|
|
13
|
+
Table,
|
|
12
14
|
VisibilityState,
|
|
13
15
|
} from '@tanstack/vue-table'
|
|
14
16
|
import type { NTableProps } from '../../../types'
|
|
@@ -44,7 +46,12 @@ const props = withDefaults(defineProps <NTableProps<TData, TValue>>(), {
|
|
|
44
46
|
enableSortingRemoval: true,
|
|
45
47
|
})
|
|
46
48
|
|
|
47
|
-
const emit = defineEmits
|
|
49
|
+
const emit = defineEmits<{
|
|
50
|
+
select: [row: TData]
|
|
51
|
+
selectAll: [rows: TData[]]
|
|
52
|
+
expand: [row: TData]
|
|
53
|
+
row: [event: Event, row: TData]
|
|
54
|
+
}>()
|
|
48
55
|
|
|
49
56
|
const slots = defineSlots()
|
|
50
57
|
|
|
@@ -73,22 +80,28 @@ const columnsWithMisc = computed(() => {
|
|
|
73
80
|
{
|
|
74
81
|
accessorKey: 'selection',
|
|
75
82
|
header: props.enableMultiRowSelection
|
|
76
|
-
? ({ table }:
|
|
83
|
+
? ({ table }: { table: Table<TData> }) => h(Checkbox, {
|
|
77
84
|
'modelValue': table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && 'indeterminate'),
|
|
78
85
|
'onUpdate:modelValue': (value: boolean | 'indeterminate' | null) => {
|
|
79
86
|
table.toggleAllPageRowsSelected(!!value)
|
|
80
|
-
emit('selectAll', table.getRowModel().rows)
|
|
87
|
+
emit('selectAll', table.getRowModel().rows.map(row => row.original))
|
|
81
88
|
},
|
|
82
89
|
'areaLabel': 'Select all rows',
|
|
90
|
+
'onClick': (event: Event) => {
|
|
91
|
+
event.stopPropagation()
|
|
92
|
+
},
|
|
83
93
|
})
|
|
84
94
|
: '',
|
|
85
|
-
cell: ({ row }:
|
|
95
|
+
cell: ({ row }: { row: Row<TData> }) => h(Checkbox, {
|
|
86
96
|
'modelValue': row.getIsSelected() ?? false,
|
|
87
97
|
'onUpdate:modelValue': (value: boolean | 'indeterminate' | null) => {
|
|
88
98
|
row.toggleSelected(!!value)
|
|
89
|
-
emit('select', row)
|
|
99
|
+
emit('select', row.original)
|
|
90
100
|
},
|
|
91
101
|
'areaLabel': 'Select row',
|
|
102
|
+
'onClick': (event: Event) => {
|
|
103
|
+
event.stopPropagation()
|
|
104
|
+
},
|
|
92
105
|
}),
|
|
93
106
|
enableSorting: false,
|
|
94
107
|
},
|
|
@@ -340,6 +353,7 @@ defineExpose({
|
|
|
340
353
|
:data-state="row.getIsSelected() && 'selected'"
|
|
341
354
|
:una
|
|
342
355
|
v-bind="props._tableRow"
|
|
356
|
+
@click="emit('row', $event, row.original)"
|
|
343
357
|
>
|
|
344
358
|
<slot
|
|
345
359
|
name="row"
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { NTableBodyProps } from '../../../types'
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
4
|
+
import { Primitive } from 'reka-ui'
|
|
3
5
|
import { cn } from '../../../utils'
|
|
4
6
|
|
|
5
|
-
const props = defineProps<NTableBodyProps>()
|
|
7
|
+
const props = withDefaults(defineProps<NTableBodyProps>(), {
|
|
8
|
+
as: 'tbody',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const rootProps = reactiveOmit(props, ['una', 'class'])
|
|
6
12
|
</script>
|
|
7
13
|
|
|
8
14
|
<template>
|
|
9
|
-
<
|
|
15
|
+
<Primitive
|
|
10
16
|
:class="cn(
|
|
11
17
|
'table-body',
|
|
12
18
|
props?.una?.tableBody,
|
|
13
19
|
props.class,
|
|
14
20
|
)"
|
|
15
|
-
v-bind="
|
|
21
|
+
v-bind="{ ...rootProps, ...$attrs }"
|
|
16
22
|
>
|
|
17
23
|
<slot />
|
|
18
|
-
</
|
|
24
|
+
</Primitive>
|
|
19
25
|
</template>
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { NTableCaptionProps } from '../../../types'
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
4
|
+
import { Primitive } from 'reka-ui'
|
|
3
5
|
import { cn } from '../../../utils'
|
|
4
6
|
|
|
5
|
-
const props = defineProps<NTableCaptionProps>()
|
|
7
|
+
const props = withDefaults(defineProps<NTableCaptionProps>(), {
|
|
8
|
+
as: 'caption',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const rootProps = reactiveOmit(props, ['una', 'class'])
|
|
6
12
|
</script>
|
|
7
13
|
|
|
8
14
|
<template>
|
|
9
|
-
<
|
|
15
|
+
<Primitive
|
|
10
16
|
:class="cn(
|
|
11
17
|
'table-caption',
|
|
12
18
|
props?.una?.tableCaption,
|
|
13
19
|
props.class,
|
|
14
20
|
)"
|
|
15
|
-
v-bind="
|
|
21
|
+
v-bind="{ ...rootProps, ...$attrs } "
|
|
16
22
|
>
|
|
17
23
|
<slot />
|
|
18
|
-
</
|
|
24
|
+
</Primitive>
|
|
19
25
|
</template>
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { NTableCellProps } from '../../../types'
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
4
|
+
import { Primitive } from 'reka-ui'
|
|
3
5
|
import { cn } from '../../../utils'
|
|
4
6
|
|
|
5
|
-
const props = defineProps<NTableCellProps>()
|
|
7
|
+
const props = withDefaults(defineProps<NTableCellProps>(), {
|
|
8
|
+
as: 'td',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const rootProps = reactiveOmit(props, ['una', 'class'])
|
|
6
12
|
</script>
|
|
7
13
|
|
|
8
14
|
<template>
|
|
9
|
-
<
|
|
15
|
+
<Primitive
|
|
10
16
|
:class="
|
|
11
17
|
cn(
|
|
12
18
|
'table-cell',
|
|
@@ -16,8 +22,8 @@ const props = defineProps<NTableCellProps>()
|
|
|
16
22
|
dataPinned === 'left' ? 'table-cell-pinned-left' : 'table-cell-pinned-right',
|
|
17
23
|
)
|
|
18
24
|
"
|
|
19
|
-
v-bind="
|
|
25
|
+
v-bind="{ ...rootProps, ...$attrs }"
|
|
20
26
|
>
|
|
21
27
|
<slot />
|
|
22
|
-
</
|
|
28
|
+
</Primitive>
|
|
23
29
|
</template>
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { NTableFooterProps } from '../../../types'
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
4
|
+
import { Primitive } from 'reka-ui'
|
|
3
5
|
import { cn } from '../../../utils'
|
|
4
6
|
|
|
5
|
-
const props = defineProps<NTableFooterProps>()
|
|
7
|
+
const props = withDefaults(defineProps<NTableFooterProps>(), {
|
|
8
|
+
as: 'tfoot',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const rootProps = reactiveOmit(props, ['una', 'class'])
|
|
6
12
|
</script>
|
|
7
13
|
|
|
8
14
|
<template>
|
|
9
|
-
<
|
|
15
|
+
<Primitive
|
|
10
16
|
:class="cn(
|
|
11
17
|
'table-footer',
|
|
12
18
|
props.una?.tableFooter,
|
|
13
19
|
props.class,
|
|
14
20
|
)"
|
|
21
|
+
v-bind="{ ...rootProps, ...$attrs }"
|
|
15
22
|
>
|
|
16
23
|
<slot />
|
|
17
|
-
</
|
|
24
|
+
</Primitive>
|
|
18
25
|
</template>
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { NTableHeadProps } from '../../../types'
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
4
|
+
import { Primitive } from 'reka-ui'
|
|
3
5
|
import { cn } from '../../../utils'
|
|
4
6
|
|
|
5
|
-
const props = defineProps<NTableHeadProps>()
|
|
7
|
+
const props = withDefaults(defineProps<NTableHeadProps>(), {
|
|
8
|
+
as: 'th',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const rootProps = reactiveOmit(props, ['una', 'class'])
|
|
6
12
|
</script>
|
|
7
13
|
|
|
8
14
|
<template>
|
|
9
|
-
<
|
|
15
|
+
<Primitive
|
|
10
16
|
:class="cn(
|
|
11
17
|
'table-head',
|
|
12
18
|
props.una?.tableHead,
|
|
@@ -14,8 +20,8 @@ const props = defineProps<NTableHeadProps>()
|
|
|
14
20
|
{ 'table-head-pinned': props.dataPinned },
|
|
15
21
|
props.dataPinned === 'left' ? 'table-head-pinned-left' : 'table-head-pinned-right',
|
|
16
22
|
)"
|
|
17
|
-
v-bind="
|
|
23
|
+
v-bind="{ ...rootProps, ...$attrs }"
|
|
18
24
|
>
|
|
19
25
|
<slot />
|
|
20
|
-
</
|
|
26
|
+
</Primitive>
|
|
21
27
|
</template>
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { NTableHeaderProps } from '../../../types'
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
4
|
+
import { Primitive } from 'reka-ui'
|
|
3
5
|
import { cn } from '../../../utils'
|
|
4
6
|
|
|
5
|
-
const props = defineProps<NTableHeaderProps>()
|
|
7
|
+
const props = withDefaults(defineProps<NTableHeaderProps>(), {
|
|
8
|
+
as: 'thead',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const rootProps = reactiveOmit(props, ['una', 'class'])
|
|
6
12
|
</script>
|
|
7
13
|
|
|
8
14
|
<template>
|
|
9
|
-
<
|
|
15
|
+
<Primitive
|
|
10
16
|
:class="cn(
|
|
11
17
|
'table-header',
|
|
12
18
|
props?.una?.tableHeader,
|
|
13
19
|
props.class,
|
|
14
20
|
)"
|
|
15
|
-
v-bind="
|
|
21
|
+
v-bind="{ ...rootProps, ...$attrs }"
|
|
16
22
|
>
|
|
17
23
|
<slot />
|
|
18
|
-
</
|
|
24
|
+
</Primitive>
|
|
19
25
|
</template>
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { NTableRowProps } from '../../../types'
|
|
3
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
4
|
+
import { Primitive } from 'reka-ui'
|
|
3
5
|
import { cn } from '../../../utils'
|
|
4
6
|
|
|
5
|
-
const props = defineProps<NTableRowProps>()
|
|
7
|
+
const props = withDefaults(defineProps<NTableRowProps>(), {
|
|
8
|
+
as: 'tr',
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const rootProps = reactiveOmit(props, ['una', 'class'])
|
|
6
12
|
</script>
|
|
7
13
|
|
|
8
14
|
<template>
|
|
9
|
-
<
|
|
15
|
+
<Primitive
|
|
10
16
|
:class="cn(
|
|
11
17
|
'table-row',
|
|
12
18
|
props.una?.tableRow,
|
|
13
19
|
props.class,
|
|
14
20
|
)"
|
|
15
|
-
v-bind="
|
|
21
|
+
v-bind="{ ...rootProps, ...$attrs }"
|
|
16
22
|
>
|
|
17
23
|
<slot />
|
|
18
|
-
</
|
|
24
|
+
</Primitive>
|
|
19
25
|
</template>
|
|
@@ -10,7 +10,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
10
10
|
required: false;
|
|
11
11
|
};
|
|
12
12
|
modelValue: {
|
|
13
|
-
type: (NumberConstructor |
|
|
13
|
+
type: (NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
14
14
|
required: false;
|
|
15
15
|
};
|
|
16
16
|
id: {
|
|
@@ -38,7 +38,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
38
38
|
required: false;
|
|
39
39
|
};
|
|
40
40
|
modelValue: {
|
|
41
|
-
type: (NumberConstructor |
|
|
41
|
+
type: (NumberConstructor | BooleanConstructor | StringConstructor)[];
|
|
42
42
|
required: false;
|
|
43
43
|
};
|
|
44
44
|
id: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
|
@@ -125,5 +125,17 @@ export interface NButtonProps extends BaseExtensionProps {
|
|
|
125
125
|
btnLeading?: string;
|
|
126
126
|
btnLoadingIcon?: string;
|
|
127
127
|
};
|
|
128
|
+
/**
|
|
129
|
+
* Support for `@click` event handler.
|
|
130
|
+
*
|
|
131
|
+
* This property is explicitly defined to provide proper TypeScript support when:
|
|
132
|
+
* 1. Using the component with dynamic properties (e.g., v-bind="props")
|
|
133
|
+
* 2. Passing event handlers via object syntax in parent components
|
|
134
|
+
* 3. Using camelCase event handlers in JSX/TSX contexts
|
|
135
|
+
*
|
|
136
|
+
* Without this definition, TypeScript would raise type errors when trying to pass
|
|
137
|
+
* an onClick handler to the component through object properties.
|
|
138
|
+
*/
|
|
139
|
+
onClick?: (e: Event) => void;
|
|
128
140
|
}
|
|
129
141
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ColumnDef, CoreOptions, GroupColumnDef } from '@tanstack/vue-table';
|
|
2
|
+
import type { PrimitiveProps } from 'reka-ui';
|
|
2
3
|
import type { HTMLAttributes } from 'vue';
|
|
3
4
|
import type { NProgressProps } from './progress.js';
|
|
4
5
|
import type { NScrollAreaProps, NScrollAreaUnaProps } from './scroll-area.js';
|
|
@@ -122,28 +123,28 @@ export interface NTableProps<TData, TValue> extends Omit<CoreOptions<TData>, 'da
|
|
|
122
123
|
*/
|
|
123
124
|
una?: NTableUnaProps & NScrollAreaUnaProps;
|
|
124
125
|
}
|
|
125
|
-
export interface NTableBodyProps {
|
|
126
|
+
export interface NTableBodyProps extends PrimitiveProps {
|
|
126
127
|
class?: HTMLAttributes['class'];
|
|
127
128
|
una?: Pick<NTableUnaProps, 'tableBody'>;
|
|
128
129
|
}
|
|
129
|
-
export interface NTableHeadProps {
|
|
130
|
+
export interface NTableHeadProps extends PrimitiveProps {
|
|
130
131
|
class?: HTMLAttributes['class'];
|
|
131
132
|
dataPinned?: 'left' | 'right' | false;
|
|
132
133
|
una?: Pick<NTableUnaProps, 'tableHead'>;
|
|
133
134
|
}
|
|
134
|
-
export interface NTableHeaderProps {
|
|
135
|
+
export interface NTableHeaderProps extends PrimitiveProps {
|
|
135
136
|
class?: HTMLAttributes['class'];
|
|
136
137
|
una?: Pick<NTableUnaProps, 'tableHeader'>;
|
|
137
138
|
}
|
|
138
|
-
export interface NTableFooterProps {
|
|
139
|
+
export interface NTableFooterProps extends PrimitiveProps {
|
|
139
140
|
class?: HTMLAttributes['class'];
|
|
140
141
|
una?: Pick<NTableUnaProps, 'tableFooter'>;
|
|
141
142
|
}
|
|
142
|
-
export interface NTableRowProps {
|
|
143
|
+
export interface NTableRowProps extends PrimitiveProps {
|
|
143
144
|
class?: HTMLAttributes['class'];
|
|
144
145
|
una?: Pick<NTableUnaProps, 'tableRow'>;
|
|
145
146
|
}
|
|
146
|
-
export interface NTableCellProps {
|
|
147
|
+
export interface NTableCellProps extends PrimitiveProps {
|
|
147
148
|
class?: HTMLAttributes['class'];
|
|
148
149
|
dataPinned?: 'left' | 'right' | false;
|
|
149
150
|
una?: Pick<NTableUnaProps, 'tableCell'>;
|
|
@@ -165,7 +166,7 @@ export interface NTableLoadingProps {
|
|
|
165
166
|
_tableProgress?: NProgressProps;
|
|
166
167
|
una?: Pick<NTableUnaProps, 'tableLoading' | 'tableLoadingCell' | 'tableLoadingRow'>;
|
|
167
168
|
}
|
|
168
|
-
export interface NTableCaptionProps {
|
|
169
|
+
export interface NTableCaptionProps extends PrimitiveProps {
|
|
169
170
|
class?: HTMLAttributes['class'];
|
|
170
171
|
una?: Pick<NTableUnaProps, 'tableCaption'>;
|
|
171
172
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@una-ui/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.51.0",
|
|
5
5
|
"description": "Nuxt module for @una-ui",
|
|
6
6
|
"author": "Phojie Rengel <phojrengel@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"typescript": "5.6.3",
|
|
60
60
|
"unocss": "^66.0.0",
|
|
61
61
|
"unocss-preset-animations": "^1.1.1",
|
|
62
|
-
"@una-ui/extractor-vue-script": "^0.
|
|
63
|
-
"@una-ui/preset": "^0.
|
|
62
|
+
"@una-ui/extractor-vue-script": "^0.51.0",
|
|
63
|
+
"@una-ui/preset": "^0.51.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@iconify-json/lucide": "^1.2.34",
|