@saasmakers/ui 1.4.33 → 1.4.35
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.
|
@@ -31,6 +31,7 @@ const props = withDefaults(defineProps<Omit<FieldInput, 'modelValue'>>(), {
|
|
|
31
31
|
const emit = defineEmits<{
|
|
32
32
|
blur: [event: FocusEvent]
|
|
33
33
|
focus: [event: FocusEvent]
|
|
34
|
+
keydown: [event: KeyboardEvent, value: string]
|
|
34
35
|
keyup: [event: KeyboardEvent, value: string ]
|
|
35
36
|
submit: [event: KeyboardEvent, value: string ]
|
|
36
37
|
}>()
|
|
@@ -126,6 +127,12 @@ function onFieldKeyDown(event: KeyboardEvent) {
|
|
|
126
127
|
return event.preventDefault()
|
|
127
128
|
}
|
|
128
129
|
|
|
130
|
+
emit('keydown', event, value)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function onFieldKeyUp(event: KeyboardEvent) {
|
|
134
|
+
const value = (event.target as HTMLInputElement).value
|
|
135
|
+
|
|
129
136
|
emit('keyup', event, value)
|
|
130
137
|
}
|
|
131
138
|
|
|
@@ -202,6 +209,7 @@ defineExpose({ focus })
|
|
|
202
209
|
@focus="onFieldFocus"
|
|
203
210
|
@input="onFieldInput"
|
|
204
211
|
@keydown="onFieldKeyDown"
|
|
212
|
+
@keyup="onFieldKeyUp"
|
|
205
213
|
>
|
|
206
214
|
|
|
207
215
|
<BaseSpinner
|
|
@@ -92,8 +92,10 @@ const filteredColumns = computed(() => {
|
|
|
92
92
|
.filter(column => column.options.length > 0)
|
|
93
93
|
})
|
|
94
94
|
|
|
95
|
-
const
|
|
96
|
-
|
|
95
|
+
const firstFilteredOption = computed(() => {
|
|
96
|
+
const column = filteredColumns.value.find(column => column.options.length > 0)
|
|
97
|
+
|
|
98
|
+
return column?.options[0]
|
|
97
99
|
})
|
|
98
100
|
|
|
99
101
|
const selectedOption = computed(() => {
|
|
@@ -102,10 +104,6 @@ const selectedOption = computed(() => {
|
|
|
102
104
|
})
|
|
103
105
|
})
|
|
104
106
|
|
|
105
|
-
const showNoResults = computed(() => {
|
|
106
|
-
return props.searchable && !!searchQueryCleaned.value && !hasFilteredResults.value
|
|
107
|
-
})
|
|
108
|
-
|
|
109
107
|
watch(opened, (isOpened) => {
|
|
110
108
|
if (isOpened && props.searchable) {
|
|
111
109
|
nextTick(() => {
|
|
@@ -172,10 +170,14 @@ function onOptionKeyDown(event: KeyboardEvent) {
|
|
|
172
170
|
}
|
|
173
171
|
}
|
|
174
172
|
|
|
175
|
-
function
|
|
173
|
+
function onSearchKeydown(event: KeyboardEvent) {
|
|
176
174
|
if (event.key === 'Escape') {
|
|
177
175
|
reset()
|
|
178
176
|
}
|
|
177
|
+
else if (event.key === 'Enter' && !props.disabled && firstFilteredOption.value) {
|
|
178
|
+
event.preventDefault()
|
|
179
|
+
onOptionClick(event as unknown as MouseEvent, firstFilteredOption.value)
|
|
180
|
+
}
|
|
179
181
|
}
|
|
180
182
|
|
|
181
183
|
function reset() {
|
|
@@ -312,12 +314,12 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
312
314
|
class="px-3"
|
|
313
315
|
:placeholder="searchPlaceholder || t('search')"
|
|
314
316
|
:size="size"
|
|
315
|
-
@
|
|
317
|
+
@keydown="onSearchKeydown"
|
|
316
318
|
/>
|
|
317
319
|
</div>
|
|
318
320
|
|
|
319
321
|
<div
|
|
320
|
-
v-if="
|
|
322
|
+
v-if="searchable && searchQueryCleaned && !firstFilteredOption"
|
|
321
323
|
class="flex justify-center border-b border-gray-200 p-3 dark:border-gray-800"
|
|
322
324
|
>
|
|
323
325
|
<BaseIcon
|
package/app/types/global.d.ts
CHANGED
|
@@ -1,102 +1,99 @@
|
|
|
1
1
|
import type { Directive } from 'vue'
|
|
2
|
-
import type { LayerIconIcon as LayerIconIconType, LayerIconValue as LayerIconValueType } from '../composables/useLayerIcons'
|
|
3
|
-
import type * as Bases from './bases'
|
|
4
|
-
import type * as Fields from './fields'
|
|
5
2
|
|
|
6
3
|
declare global {
|
|
7
4
|
// Bases
|
|
8
|
-
type BaseAlert =
|
|
9
|
-
type BaseAlignment =
|
|
10
|
-
|
|
11
|
-
type
|
|
12
|
-
type
|
|
13
|
-
type
|
|
14
|
-
type
|
|
15
|
-
type
|
|
16
|
-
type
|
|
17
|
-
type
|
|
18
|
-
type
|
|
19
|
-
type
|
|
20
|
-
type
|
|
21
|
-
type
|
|
22
|
-
type
|
|
23
|
-
type
|
|
24
|
-
type
|
|
25
|
-
type
|
|
26
|
-
type
|
|
27
|
-
type
|
|
28
|
-
type
|
|
29
|
-
type
|
|
30
|
-
type
|
|
31
|
-
type
|
|
32
|
-
type
|
|
33
|
-
type
|
|
34
|
-
type
|
|
35
|
-
type
|
|
36
|
-
type
|
|
37
|
-
type
|
|
38
|
-
type
|
|
39
|
-
type
|
|
40
|
-
type
|
|
41
|
-
type
|
|
42
|
-
type
|
|
43
|
-
type
|
|
44
|
-
type
|
|
45
|
-
type
|
|
46
|
-
type
|
|
47
|
-
type
|
|
48
|
-
type
|
|
49
|
-
type
|
|
50
|
-
type
|
|
51
|
-
type
|
|
52
|
-
type
|
|
53
|
-
type
|
|
54
|
-
type
|
|
55
|
-
type
|
|
56
|
-
type
|
|
57
|
-
type
|
|
58
|
-
type
|
|
59
|
-
type
|
|
60
|
-
type
|
|
61
|
-
type BaseToastAction = Bases.BaseToastAction
|
|
5
|
+
type BaseAlert = import('./bases').BaseAlert
|
|
6
|
+
type BaseAlignment = import('./bases').BaseAlignment
|
|
7
|
+
type BaseAvatar = import('./bases').BaseAvatar
|
|
8
|
+
type BaseBackground = import('./bases').BaseBackground
|
|
9
|
+
type BaseBordered = import('./bases').BaseBordered
|
|
10
|
+
type BaseBorderedColor = import('./bases').BaseBorderedColor
|
|
11
|
+
type BaseButton = import('./bases').BaseButton
|
|
12
|
+
type BaseButtonRounded = import('./bases').BaseButtonRounded
|
|
13
|
+
type BaseButtonSize = import('./bases').BaseButtonSize
|
|
14
|
+
type BaseButtonType = import('./bases').BaseButtonType
|
|
15
|
+
type BaseCharacter = import('./bases').BaseCharacter
|
|
16
|
+
type BaseCharacterCharacter = import('./bases').BaseCharacterCharacter
|
|
17
|
+
type BaseCharacterSize = import('./bases').BaseCharacterSize
|
|
18
|
+
type BaseChart = import('./bases').BaseChart
|
|
19
|
+
type BaseChartType = import('./bases').BaseChartType
|
|
20
|
+
type BaseColor = import('./bases').BaseColor
|
|
21
|
+
type BaseDivider = import('./bases').BaseDivider
|
|
22
|
+
type BaseDividerBorderStyle = import('./bases').BaseDividerBorderStyle
|
|
23
|
+
type BaseDividerNavigateDirection = import('./bases').BaseDividerNavigateDirection
|
|
24
|
+
type BaseDividerSize = import('./bases').BaseDividerSize
|
|
25
|
+
type BaseEmoji = import('./bases').BaseEmoji
|
|
26
|
+
type BaseHeading = import('./bases').BaseHeading
|
|
27
|
+
type BaseHeadingAlignment = import('./bases').BaseHeadingAlignment
|
|
28
|
+
type BaseHeadingSize = import('./bases').BaseHeadingSize
|
|
29
|
+
type BaseHeadingTag = import('./bases').BaseHeadingTag
|
|
30
|
+
type BaseIcon = import('./bases').BaseIcon
|
|
31
|
+
type BaseMessage = import('./bases').BaseMessage
|
|
32
|
+
type BaseMetric = import('./bases').BaseMetric
|
|
33
|
+
type BaseMetricAlignment = import('./bases').BaseMetricAlignment
|
|
34
|
+
type BaseMetricPerformance = import('./bases').BaseMetricPerformance
|
|
35
|
+
type BaseMetricSize = import('./bases').BaseMetricSize
|
|
36
|
+
type BaseOverlay = import('./bases').BaseOverlay
|
|
37
|
+
type BaseOverlayOpacity = import('./bases').BaseOverlayOpacity
|
|
38
|
+
type BaseOverlayPosition = import('./bases').BaseOverlayPosition
|
|
39
|
+
type BaseParagraph = import('./bases').BaseParagraph
|
|
40
|
+
type BaseParagraphAlignment = import('./bases').BaseParagraphAlignment
|
|
41
|
+
type BaseParagraphSize = import('./bases').BaseParagraphSize
|
|
42
|
+
type BasePower = import('./bases').BasePower
|
|
43
|
+
type BasePowerPower = import('./bases').BasePowerPower
|
|
44
|
+
type BasePowerSize = import('./bases').BasePowerSize
|
|
45
|
+
type BaseQuote = import('./bases').BaseQuote
|
|
46
|
+
type BaseQuoteBackground = import('./bases').BaseQuoteBackground
|
|
47
|
+
type BaseQuoteSize = import('./bases').BaseQuoteSize
|
|
48
|
+
type BaseSize = import('./bases').BaseSize
|
|
49
|
+
type BaseSpinner = import('./bases').BaseSpinner
|
|
50
|
+
type BaseStatus = import('./bases').BaseStatus
|
|
51
|
+
type BaseTag = import('./bases').BaseTag
|
|
52
|
+
type BaseTags = import('./bases').BaseTags
|
|
53
|
+
type BaseTagSize = import('./bases').BaseTagSize
|
|
54
|
+
type BaseText = import('./bases').BaseText
|
|
55
|
+
type BaseTextText = import('./bases').BaseTextText
|
|
56
|
+
type BaseToast = import('./bases').BaseToast
|
|
57
|
+
type BaseToastAction = import('./bases').BaseToastAction
|
|
62
58
|
|
|
63
59
|
// Libraries
|
|
64
60
|
type ChartistBarChartData = import('chartist').BarChartData
|
|
65
61
|
type ChartistLineChartData = import('chartist').LineChartData
|
|
66
|
-
|
|
67
62
|
type ChartistOptions = import('chartist').Options
|
|
68
63
|
type ChartistPieChartData = import('chartist').PieChartData
|
|
64
|
+
|
|
69
65
|
// Fields
|
|
70
|
-
type FieldAvatar =
|
|
71
|
-
type FieldBackground =
|
|
72
|
-
type FieldCheckbox =
|
|
73
|
-
type FieldDays =
|
|
74
|
-
type FieldEmojis =
|
|
75
|
-
type FieldInput =
|
|
76
|
-
type FieldInputAlignment =
|
|
77
|
-
type FieldInputBorder =
|
|
78
|
-
type FieldInputType =
|
|
79
|
-
type FieldLabel =
|
|
80
|
-
type FieldMessage =
|
|
81
|
-
type FieldSelect =
|
|
82
|
-
type FieldSelectBorder =
|
|
83
|
-
type FieldSelectColumn =
|
|
84
|
-
type FieldSelectDirection =
|
|
85
|
-
type FieldSelectMaxHeight =
|
|
86
|
-
type FieldSelectOption =
|
|
87
|
-
type FieldSize =
|
|
88
|
-
type FieldStatus =
|
|
89
|
-
type FieldTabs =
|
|
90
|
-
type FieldTabsAction =
|
|
91
|
-
type FieldTabsTab =
|
|
92
|
-
type FieldTabsTheme =
|
|
66
|
+
type FieldAvatar = import('./fields').FieldAvatar
|
|
67
|
+
type FieldBackground = import('./fields').FieldBackground
|
|
68
|
+
type FieldCheckbox = import('./fields').FieldCheckbox
|
|
69
|
+
type FieldDays = import('./fields').FieldDays
|
|
70
|
+
type FieldEmojis = import('./fields').FieldEmojis
|
|
71
|
+
type FieldInput = import('./fields').FieldInput
|
|
72
|
+
type FieldInputAlignment = import('./fields').FieldInputAlignment
|
|
73
|
+
type FieldInputBorder = import('./fields').FieldInputBorder
|
|
74
|
+
type FieldInputType = import('./fields').FieldInputType
|
|
75
|
+
type FieldLabel = import('./fields').FieldLabel
|
|
76
|
+
type FieldMessage = import('./fields').FieldMessage
|
|
77
|
+
type FieldSelect = import('./fields').FieldSelect
|
|
78
|
+
type FieldSelectBorder = import('./fields').FieldSelectBorder
|
|
79
|
+
type FieldSelectColumn = import('./fields').FieldSelectColumn
|
|
80
|
+
type FieldSelectDirection = import('./fields').FieldSelectDirection
|
|
81
|
+
type FieldSelectMaxHeight = import('./fields').FieldSelectMaxHeight
|
|
82
|
+
type FieldSelectOption = import('./fields').FieldSelectOption
|
|
83
|
+
type FieldSize = import('./fields').FieldSize
|
|
84
|
+
type FieldStatus = import('./fields').FieldStatus
|
|
85
|
+
type FieldTabs = import('./fields').FieldTabs
|
|
86
|
+
type FieldTabsAction = import('./fields').FieldTabsAction
|
|
87
|
+
type FieldTabsTab = import('./fields').FieldTabsTab
|
|
88
|
+
type FieldTabsTheme = import('./fields').FieldTabsTheme
|
|
89
|
+
type FieldTextarea = import('./fields').FieldTextarea
|
|
90
|
+
type FieldTime = import('./fields').FieldTime
|
|
93
91
|
|
|
94
|
-
type FieldTextarea = Fields.FieldTextarea
|
|
95
|
-
type FieldTime = Fields.FieldTime
|
|
96
92
|
// Project
|
|
97
|
-
type LayerIconIcon =
|
|
98
|
-
type LayerIconValue =
|
|
93
|
+
type LayerIconIcon = import('../composables/useLayerIcons').LayerIconIcon
|
|
94
|
+
type LayerIconValue = import('../composables/useLayerIcons').LayerIconValue
|
|
99
95
|
type Meta<T> = import('@nuxtjs/storybook').Meta<T>
|
|
96
|
+
|
|
100
97
|
// Navigator
|
|
101
98
|
interface Navigator {
|
|
102
99
|
userAgentData?: {
|
|
@@ -108,9 +105,9 @@ declare global {
|
|
|
108
105
|
platform?: string
|
|
109
106
|
}
|
|
110
107
|
}
|
|
108
|
+
|
|
111
109
|
type RouteLocationNamedI18n = import('vue-router').RouteLocationNamedI18n
|
|
112
110
|
type StoryObj<T> = import('@nuxtjs/storybook').StoryObj<T>
|
|
113
|
-
|
|
114
111
|
type VuelidateValidation = import('@vuelidate/core').BaseValidation
|
|
115
112
|
}
|
|
116
113
|
|