@saasmakers/ui 0.1.66 → 0.1.68
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
|
|
28
|
-
'click': [event: MouseEvent, value
|
|
29
|
-
'optionClick': [event: MouseEvent, value
|
|
30
|
-
'update:modelValue': [value
|
|
27
|
+
'change': [event: MouseEvent, value: string]
|
|
28
|
+
'click': [event: MouseEvent, value: string]
|
|
29
|
+
'optionClick': [event: MouseEvent, value: string]
|
|
30
|
+
'update:modelValue': [value: 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
|
|
77
|
+
function selectOption(event: MouseEvent, value: 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
|
|
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:
|
|
34
|
+
const getIcon = (attribute: LayerIconIcon) => {
|
|
35
35
|
return icons[attribute] || icons.default
|
|
36
36
|
}
|
|
37
37
|
|
package/app/types/fields.d.ts
CHANGED
|
@@ -93,7 +93,7 @@ export interface FieldSelect {
|
|
|
93
93
|
label?: BaseTextText
|
|
94
94
|
labelIcon?: string
|
|
95
95
|
maxHeight?: FieldSelectMaxHeight
|
|
96
|
-
modelValue?:
|
|
96
|
+
modelValue?: string
|
|
97
97
|
openOnHover?: boolean
|
|
98
98
|
options?: FieldSelectOption[]
|
|
99
99
|
padding?: boolean
|
|
@@ -111,7 +111,7 @@ export interface FieldSelectColumn {
|
|
|
111
111
|
export interface FieldSelectOption {
|
|
112
112
|
icon?: string
|
|
113
113
|
text: string
|
|
114
|
-
value:
|
|
114
|
+
value: string
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
export type FieldSelectBorder = 'bottom' | 'full' | 'none'
|