@polymarbot/nuxt-layer-shadcn-ui 0.3.6 → 0.3.7

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.
@@ -15,6 +15,7 @@ const meta = {
15
15
  confirmDisabled: { control: 'boolean' },
16
16
  showCancel: { control: 'boolean' },
17
17
  showClose: { control: 'boolean' },
18
+ closeOnClickOutside: { control: 'boolean' },
18
19
  hideHeader: { control: 'boolean' },
19
20
  hideFooter: { control: 'boolean' },
20
21
  side: { control: 'select', options: sides },
@@ -29,6 +30,7 @@ const meta = {
29
30
  confirmDisabled: false,
30
31
  showCancel: true,
31
32
  showClose: true,
33
+ closeOnClickOutside: false,
32
34
  hideHeader: false,
33
35
  hideFooter: false,
34
36
  side: 'right',
@@ -12,6 +12,7 @@ import type { DrawerProps } from './types'
12
12
 
13
13
  const props = withDefaults(defineProps<DrawerProps>(), {
14
14
  showClose: true,
15
+ closeOnClickOutside: false,
15
16
  side: 'right',
16
17
  title: undefined,
17
18
  description: undefined,
@@ -64,6 +65,10 @@ function onCancel () {
64
65
  emit('update:visible', false)
65
66
  }
66
67
 
68
+ function onPointerDownOutside (event: Event) {
69
+ if (!props.closeOnClickOutside) event.preventDefault()
70
+ }
71
+
67
72
  const contentClass = computed(() =>
68
73
  cn('bg-popover gap-0 p-0 flex flex-col', props.class),
69
74
  )
@@ -74,7 +79,7 @@ const contentClass = computed(() =>
74
79
  <SheetContent
75
80
  :side="side"
76
81
  :class="contentClass"
77
- @pointerDownOutside.prevent
82
+ @pointerDownOutside="onPointerDownOutside"
78
83
  @closeAutoFocus="emit('closed')"
79
84
  >
80
85
  <!-- Header -->
@@ -9,6 +9,7 @@ export interface DrawerProps {
9
9
  confirmDisabled?: boolean
10
10
  showCancel?: boolean
11
11
  showClose?: boolean
12
+ closeOnClickOutside?: boolean
12
13
  hideHeader?: boolean
13
14
  hideFooter?: boolean
14
15
  side?: DrawerSide
@@ -15,6 +15,7 @@ const meta = {
15
15
  confirmDisabled: { control: 'boolean' },
16
16
  showCancel: { control: 'boolean' },
17
17
  showClose: { control: 'boolean' },
18
+ closeOnClickOutside: { control: 'boolean' },
18
19
  hideHeader: { control: 'boolean' },
19
20
  hideFooter: { control: 'boolean' },
20
21
  alignCenter: { control: 'boolean' },
@@ -30,6 +31,7 @@ const meta = {
30
31
  confirmDisabled: false,
31
32
  showCancel: true,
32
33
  showClose: true,
34
+ closeOnClickOutside: false,
33
35
  hideHeader: false,
34
36
  hideFooter: false,
35
37
  alignCenter: false,
@@ -12,6 +12,7 @@ import type { ModalProps } from './types'
12
12
 
13
13
  const props = withDefaults(defineProps<ModalProps>(), {
14
14
  showClose: true,
15
+ closeOnClickOutside: false,
15
16
  title: undefined,
16
17
  description: undefined,
17
18
  confirmText: undefined,
@@ -65,6 +66,10 @@ function onCancel () {
65
66
  emit('update:visible', false)
66
67
  }
67
68
 
69
+ function onPointerDownOutside (event: Event) {
70
+ if (!props.closeOnClickOutside) event.preventDefault()
71
+ }
72
+
68
73
  const contentClass = computed(() =>
69
74
  cn(
70
75
  'bg-popover gap-0 py-0',
@@ -79,7 +84,7 @@ const contentClass = computed(() =>
79
84
  <DialogContent
80
85
  :class="contentClass"
81
86
  :showCloseButton="false"
82
- @pointerDownOutside.prevent
87
+ @pointerDownOutside="onPointerDownOutside"
83
88
  @closeAutoFocus="emit('closed')"
84
89
  >
85
90
  <!-- Header -->
@@ -8,6 +8,7 @@ export interface ModalProps {
8
8
  confirmDisabled?: boolean
9
9
  showCancel?: boolean
10
10
  showClose?: boolean
11
+ closeOnClickOutside?: boolean
11
12
  hideHeader?: boolean
12
13
  hideFooter?: boolean
13
14
  alignCenter?: boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarbot/nuxt-layer-shadcn-ui",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
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": "1cab3200649169317e33b3677a1ad906b6ba4683"
45
+ "gitHead": "bad2455b71daf4612a416d92f6875e93b20f3ce6"
46
46
  }