@saasmakers/ui 0.1.108 → 0.1.109
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.
- package/app/components/bases/BaseAvatar.vue +5 -4
- package/app/components/bases/BaseEmoji.vue +5 -4
- package/app/components/bases/BaseIcon.vue +5 -4
- package/app/components/bases/BaseOverlay.vue +5 -4
- package/app/components/bases/BaseQuote.vue +5 -4
- package/app/components/bases/BaseSpinner.vue +5 -4
- package/app/components/bases/BaseTag.vue +5 -4
- package/app/components/bases/BaseToast.vue +4 -9
- package/app/components/fields/FieldLabel.vue +5 -8
- package/app/components/fields/FieldSelect.vue +5 -4
- package/app/components/fields/FieldTime.vue +5 -5
- package/package.json +1 -1
|
@@ -68,9 +68,9 @@ function onFocus() {
|
|
|
68
68
|
hovered.value = true
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
function
|
|
72
|
-
if (
|
|
73
|
-
|
|
71
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
72
|
+
if (isClickable.value) {
|
|
73
|
+
(event.currentTarget as HTMLElement).click()
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -109,7 +109,8 @@ function onMouseLeave() {
|
|
|
109
109
|
:aria-disabled="!isClickable"
|
|
110
110
|
tabindex="0"
|
|
111
111
|
@click="onClick"
|
|
112
|
-
@keydown.
|
|
112
|
+
@keydown.enter="onKeyDown"
|
|
113
|
+
@keydown.space.prevent="onKeyDown"
|
|
113
114
|
>
|
|
114
115
|
<img
|
|
115
116
|
class="h-full w-full object-cover drag-none"
|
|
@@ -22,9 +22,9 @@ function onClick(event: MouseEvent) {
|
|
|
22
22
|
emit('click', event, props.emoji)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function
|
|
26
|
-
if (
|
|
27
|
-
|
|
25
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
26
|
+
if (props.clickable) {
|
|
27
|
+
(event.currentTarget as HTMLElement).click()
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
</script>
|
|
@@ -52,7 +52,8 @@ function onKeydown(event: KeyboardEvent) {
|
|
|
52
52
|
role="button"
|
|
53
53
|
tabindex="0"
|
|
54
54
|
@click="onClick"
|
|
55
|
-
@keydown.
|
|
55
|
+
@keydown.enter="onKeyDown"
|
|
56
|
+
@keydown.space.prevent="onKeyDown"
|
|
56
57
|
>
|
|
57
58
|
<img
|
|
58
59
|
v-if="emoji"
|
|
@@ -99,9 +99,9 @@ function onClick(event: MouseEvent) {
|
|
|
99
99
|
emit('click', event)
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
function
|
|
103
|
-
if (
|
|
104
|
-
|
|
102
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
103
|
+
if (isClickable.value) {
|
|
104
|
+
(event.currentTarget as HTMLElement).click()
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
</script>
|
|
@@ -117,7 +117,8 @@ function onKeydown(event: KeyboardEvent) {
|
|
|
117
117
|
role="button"
|
|
118
118
|
tabindex="0"
|
|
119
119
|
@click="onClick"
|
|
120
|
-
@keydown.
|
|
120
|
+
@keydown.enter="onKeyDown"
|
|
121
|
+
@keydown.space.prevent="onKeyDown"
|
|
121
122
|
>
|
|
122
123
|
<component
|
|
123
124
|
:is="to ? NuxtLinkLocale : 'span'"
|
|
@@ -37,9 +37,9 @@ function onClose(event: KeyboardEvent | MouseEvent) {
|
|
|
37
37
|
emit('close', event)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
function
|
|
41
|
-
if (
|
|
42
|
-
|
|
40
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
41
|
+
if (isClickable.value) {
|
|
42
|
+
(event.currentTarget as HTMLElement).click()
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -59,7 +59,8 @@ onKeyStroke('Escape', (event) => {
|
|
|
59
59
|
role="button"
|
|
60
60
|
tabindex="0"
|
|
61
61
|
@click="onClick"
|
|
62
|
-
@keydown.
|
|
62
|
+
@keydown.enter="onKeyDown"
|
|
63
|
+
@keydown.space.prevent="onKeyDown"
|
|
63
64
|
>
|
|
64
65
|
<BaseIcon
|
|
65
66
|
v-if="hasClose"
|
|
@@ -52,9 +52,9 @@ function onBubbleClick(event: MouseEvent) {
|
|
|
52
52
|
emit('click', event)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
function
|
|
56
|
-
if (
|
|
57
|
-
|
|
55
|
+
function onBubbleKeyDown(event: KeyboardEvent) {
|
|
56
|
+
if (props.clickable) {
|
|
57
|
+
(event.currentTarget as HTMLElement).click()
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -111,7 +111,8 @@ function onClose(event: MouseEvent) {
|
|
|
111
111
|
:aria-disabled="!clickable"
|
|
112
112
|
tabindex="0"
|
|
113
113
|
@click="onBubbleClick"
|
|
114
|
-
@keydown.
|
|
114
|
+
@keydown.enter="onBubbleKeyDown"
|
|
115
|
+
@keydown.space.prevent="onBubbleKeyDown"
|
|
115
116
|
>
|
|
116
117
|
<div class="flex items-center">
|
|
117
118
|
<div
|
|
@@ -19,9 +19,9 @@ function onClick(event: MouseEvent) {
|
|
|
19
19
|
emit('click', event, props.id)
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
function
|
|
23
|
-
if (
|
|
24
|
-
|
|
22
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
23
|
+
if (props.clickable) {
|
|
24
|
+
(event.currentTarget as HTMLElement).click()
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
</script>
|
|
@@ -38,7 +38,8 @@ function onKeydown(event: KeyboardEvent) {
|
|
|
38
38
|
:aria-disabled="!clickable"
|
|
39
39
|
tabindex="0"
|
|
40
40
|
@click="onClick"
|
|
41
|
-
@keydown.
|
|
41
|
+
@keydown.enter="onKeyDown"
|
|
42
|
+
@keydown.space.prevent="onKeyDown"
|
|
42
43
|
>
|
|
43
44
|
<div
|
|
44
45
|
class="relative inline-block cursor-wait flex-initial"
|
|
@@ -74,9 +74,9 @@ function onInputSubmit(event: KeyboardEvent) {
|
|
|
74
74
|
emit('inputSubmit', event, form.name.trim(), props.id)
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
function
|
|
78
|
-
if (
|
|
79
|
-
|
|
77
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
78
|
+
if (props.clickable) {
|
|
79
|
+
(event.currentTarget as HTMLElement).click()
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -100,7 +100,8 @@ function onRemove(event: MouseEvent) {
|
|
|
100
100
|
:aria-disabled="!clickable"
|
|
101
101
|
tabindex="0"
|
|
102
102
|
@click.stop="onClick"
|
|
103
|
-
@keydown.
|
|
103
|
+
@keydown.enter.stop="onKeyDown"
|
|
104
|
+
@keydown.space.prevent.stop="onKeyDown"
|
|
104
105
|
@mouseenter="onMouseEnter"
|
|
105
106
|
@mouseleave="onMouseLeave"
|
|
106
107
|
@focusin="onFocus"
|
|
@@ -14,15 +14,9 @@ const emit = defineEmits<{
|
|
|
14
14
|
|
|
15
15
|
const { getIcon } = useLayerIcons()
|
|
16
16
|
|
|
17
|
-
function onClose(event: MouseEvent) {
|
|
17
|
+
function onClose(event: KeyboardEvent | MouseEvent) {
|
|
18
18
|
if (props.hasClose) {
|
|
19
|
-
emit('close', event, props)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function onKeydown(event: KeyboardEvent) {
|
|
24
|
-
if ((event.key === 'Enter' || event.key === ' ') && props.hasClose) {
|
|
25
|
-
onClose(event as unknown as MouseEvent)
|
|
19
|
+
emit('close', event as MouseEvent, props)
|
|
26
20
|
}
|
|
27
21
|
}
|
|
28
22
|
</script>
|
|
@@ -34,7 +28,8 @@ function onKeydown(event: KeyboardEvent) {
|
|
|
34
28
|
role="button"
|
|
35
29
|
tabindex="0"
|
|
36
30
|
@click="onClose"
|
|
37
|
-
@keydown.
|
|
31
|
+
@keydown.enter="onClose"
|
|
32
|
+
@keydown.space.prevent="onClose"
|
|
38
33
|
>
|
|
39
34
|
<BaseIcon
|
|
40
35
|
class="pointer-events-none flex-initial"
|
|
@@ -24,15 +24,11 @@ const isClickable = computed(() => {
|
|
|
24
24
|
})
|
|
25
25
|
|
|
26
26
|
function onClick(event: MouseEvent) {
|
|
27
|
-
|
|
28
|
-
emit('click', event)
|
|
29
|
-
}
|
|
27
|
+
emit('click', event)
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
onClick(event as unknown as MouseEvent)
|
|
35
|
-
}
|
|
30
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
31
|
+
(event.currentTarget as HTMLElement).click()
|
|
36
32
|
}
|
|
37
33
|
</script>
|
|
38
34
|
|
|
@@ -61,7 +57,8 @@ function onKeydown(event: KeyboardEvent) {
|
|
|
61
57
|
:tabindex="isClickable && !forField ? 0 : undefined"
|
|
62
58
|
:type="isClickable && !forField ? 'button' : undefined"
|
|
63
59
|
@click="isClickable ? onClick : undefined"
|
|
64
|
-
@keydown.
|
|
60
|
+
@keydown.enter="isClickable ? onKeyDown : undefined"
|
|
61
|
+
@keydown.space.prevent="isClickable ? onKeyDown : undefined"
|
|
65
62
|
>
|
|
66
63
|
<BaseIcon
|
|
67
64
|
:icon="icon"
|
|
@@ -134,9 +134,9 @@ function onOptionClick(event: MouseEvent, option: FieldSelectOption) {
|
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
function
|
|
138
|
-
if (
|
|
139
|
-
|
|
137
|
+
function onOptionKeyDown(event: KeyboardEvent) {
|
|
138
|
+
if (!props.disabled) {
|
|
139
|
+
(event.currentTarget as HTMLElement).click()
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -283,7 +283,8 @@ function selectOption(event: MouseEvent, value: string) {
|
|
|
283
283
|
role="button"
|
|
284
284
|
tabindex="0"
|
|
285
285
|
@click="onOptionClick($event, option)"
|
|
286
|
-
@keydown.prevent="
|
|
286
|
+
@keydown.enter.prevent="onOptionKeyDown"
|
|
287
|
+
@keydown.space.prevent="onOptionKeyDown"
|
|
287
288
|
>
|
|
288
289
|
<BaseIcon
|
|
289
290
|
v-if="option.text"
|
|
@@ -33,10 +33,9 @@ function onContainerClick() {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
function
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
inputRef.value.showPicker()
|
|
36
|
+
function onContainerKeyDown(event: KeyboardEvent) {
|
|
37
|
+
if (!props.disabled) {
|
|
38
|
+
(event.currentTarget as HTMLElement).click()
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
|
|
@@ -74,7 +73,8 @@ function onFieldBlur(event: FocusEvent) {
|
|
|
74
73
|
:aria-disabled="disabled"
|
|
75
74
|
tabindex="0"
|
|
76
75
|
@click="onContainerClick"
|
|
77
|
-
@keydown.
|
|
76
|
+
@keydown.enter="onContainerKeyDown"
|
|
77
|
+
@keydown.space.prevent="onContainerKeyDown"
|
|
78
78
|
>
|
|
79
79
|
<BaseIcon
|
|
80
80
|
:icon="getIcon('clock')"
|