@polymarbot/nuxt-layer-shadcn-ui 0.1.0 → 0.1.2

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.
@@ -93,6 +93,7 @@ export const BatchActions: Story = {
93
93
  {
94
94
  label: 'Delete',
95
95
  icon: 'trash-2',
96
+ color: 'danger',
96
97
  action: items => console.debug(`Delete ${items.length} items`),
97
98
  },
98
99
  {
@@ -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(action => ({
82
- label: action.label,
83
- icon: action.icon,
84
- class: action.class,
85
- disabled: action.disabled || batchActionsDisabled.value,
86
- command: () => action.action(props.selection ?? []),
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 interface AsyncDataTableBatchAction<T = Record<string, any>> {
5
- /** Button/menu item label */
6
- label: string
7
- /** Icon name or component */
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') ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarbot/nuxt-layer-shadcn-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Nuxt layer providing shadcn-vue based UI components",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -41,6 +41,6 @@
41
41
  "nuxt": "^4",
42
42
  "vue": "^3",
43
43
  "vue-i18n": "^11",
44
- "vue-router": "^4"
44
+ "vue-router": "^4 || ^5"
45
45
  }
46
46
  }