@saasmakers/ui 0.1.66 → 0.1.67

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.
@@ -24,10 +24,10 @@ const props = withDefaults(defineProps<FieldSelect>(), {
24
24
  })
25
25
 
26
26
  const emit = defineEmits<{
27
- 'change': [event: MouseEvent, value?: number | string]
28
- 'click': [event: MouseEvent, value?: number | string]
29
- 'optionClick': [event: MouseEvent, value?: number | string]
30
- 'update:modelValue': [value?: number | string]
27
+ 'change': [event: MouseEvent, value: number | string]
28
+ 'click': [event: MouseEvent, value: number | string]
29
+ 'optionClick': [event: MouseEvent, value: number | string]
30
+ 'update:modelValue': [value: number | string]
31
31
  }>()
32
32
 
33
33
  const { getIcon } = useLayerIcons()
@@ -74,7 +74,7 @@ function reset() {
74
74
  opened.value = false
75
75
  }
76
76
 
77
- function selectOption(event: MouseEvent, value?: number | string) {
77
+ function selectOption(event: MouseEvent, value: number | string) {
78
78
  emit('change', event, value)
79
79
  emit('update:modelValue', value)
80
80
 
@@ -86,10 +86,10 @@ function onClose() {
86
86
  }
87
87
 
88
88
  function onContainerClick(event: MouseEvent) {
89
- if (!props.disabled) {
89
+ if (!props.disabled && selectedOption.value) {
90
90
  opened.value = !opened.value
91
91
 
92
- emit('click', event, selectedOption.value?.value)
92
+ emit('click', event, selectedOption.value.value)
93
93
  }
94
94
  }
95
95
 
@@ -31,7 +31,7 @@ export type LayerIconValue = typeof icons[LayerIconIcon]
31
31
  export default function useicons() {
32
32
  const iconsNames = Object.keys(icons)
33
33
 
34
- const getIcon = (attribute: keyof typeof icons) => {
34
+ const getIcon = (attribute: LayerIconIcon) => {
35
35
  return icons[attribute] || icons.default
36
36
  }
37
37
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
3
  "type": "module",
4
- "version": "0.1.66",
4
+ "version": "0.1.67",
5
5
  "private": false,
6
6
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
7
7
  "license": "MIT",