@polymarbot/nuxt-layer-shadcn-ui 0.1.0 → 0.1.1
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.
|
@@ -78,13 +78,17 @@ const shouldShowTopToolbar = computed(() => {
|
|
|
78
78
|
const shouldShowBottomToolbar = computed(() => props.showBottomToolbar)
|
|
79
79
|
|
|
80
80
|
const batchMenuItems = computed<DropdownItem[]>(() =>
|
|
81
|
-
props.batchActions.map(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
props.batchActions.map(item => {
|
|
82
|
+
if (item.type === 'separator' || item.type === 'label') {
|
|
83
|
+
return item
|
|
84
|
+
}
|
|
85
|
+
const { action, disabled, ...rest } = item
|
|
86
|
+
return {
|
|
87
|
+
...rest,
|
|
88
|
+
disabled: disabled || batchActionsDisabled.value,
|
|
89
|
+
command: () => action?.(props.selection ?? []),
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
88
92
|
)
|
|
89
93
|
|
|
90
94
|
// -- Data fetching --
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import type { Component } from 'vue'
|
|
2
1
|
import type { DataTableColumn } from '../DataTable/types'
|
|
2
|
+
import type { DropdownActionItem, DropdownLabelItem, DropdownSeparatorItem } from '../Dropdown/types'
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
icon?: string | Component
|
|
9
|
-
/** Custom CSS class */
|
|
10
|
-
class?: ClassValue
|
|
11
|
-
/** Whether the action is disabled */
|
|
12
|
-
disabled?: boolean
|
|
13
|
-
/** Callback with selected items */
|
|
14
|
-
action: (selectedItems: T[]) => void
|
|
15
|
-
}
|
|
4
|
+
export type AsyncDataTableBatchAction<T = Record<string, any>>
|
|
5
|
+
= | (Omit<DropdownActionItem, 'command'> & { action?: (selectedItems: T[]) => void })
|
|
6
|
+
| DropdownSeparatorItem
|
|
7
|
+
| DropdownLabelItem
|
|
16
8
|
|
|
17
9
|
export interface AsyncDataTableFetchParams {
|
|
18
10
|
offset: number
|
package/nuxt.config.ts
CHANGED
|
@@ -13,9 +13,15 @@ export default defineNuxtConfig({
|
|
|
13
13
|
},
|
|
14
14
|
|
|
15
15
|
// Package is declared as peerDependency so consumers own the version.
|
|
16
|
-
// `i18n.config.ts` at this layer's root is auto-discovered by @nuxtjs/i18n.
|
|
17
16
|
modules: [ '@nuxtjs/i18n' ],
|
|
18
17
|
|
|
18
|
+
// Explicit absolute path so the layer's messages load regardless of the
|
|
19
|
+
// consumer's vueI18n setting (each layer's vueI18n is resolved per-layer
|
|
20
|
+
// and merged by @nuxtjs/i18n).
|
|
21
|
+
i18n: {
|
|
22
|
+
vueI18n: join(currentDir, 'i18n.config.ts'),
|
|
23
|
+
},
|
|
24
|
+
|
|
19
25
|
// Register the layer's global stylesheet. Consumers extending this layer
|
|
20
26
|
// automatically inherit it via Nuxt's css array merging.
|
|
21
27
|
css: [ join(currentDir, 'app/assets/styles/globals.css') ],
|