@saasmakers/ui 0.1.64 → 0.1.65
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/BaseAlert.vue +1 -0
- package/app/components/bases/BaseButton.vue +0 -1
- package/app/components/bases/BaseTag.vue +0 -1
- package/app/components/bases/BaseTags.vue +8 -8
- package/app/components/bases/BaseText.vue +2 -2
- package/app/components/fields/FieldInput.vue +5 -5
- package/app/components/fields/FieldTextarea.vue +1 -1
- package/app/types/fields.d.ts +1 -1
- package/app/types/global.d.ts +7 -0
- package/package.json +1 -1
|
@@ -23,10 +23,10 @@ const emit = defineEmits<{
|
|
|
23
23
|
'attach': [event: MouseEvent, tagId?: number | string]
|
|
24
24
|
'back': [event: MouseEvent]
|
|
25
25
|
'click': [event: MouseEvent]
|
|
26
|
-
'create': [event:
|
|
26
|
+
'create': [event: FocusEvent | KeyboardEvent, name: string]
|
|
27
27
|
'detach': [event: MouseEvent, tagId?: number | string]
|
|
28
28
|
'remove': [event: MouseEvent, tagId?: number | string]
|
|
29
|
-
'update': [event:
|
|
29
|
+
'update': [event: FocusEvent | KeyboardEvent, name: string, tagId?: number | string]
|
|
30
30
|
'update:modelValue': [value: (number | string)[]]
|
|
31
31
|
}>()
|
|
32
32
|
|
|
@@ -61,7 +61,7 @@ const sortedTags = computed({
|
|
|
61
61
|
},
|
|
62
62
|
})
|
|
63
63
|
|
|
64
|
-
function onCreateTag(event:
|
|
64
|
+
function onCreateTag(event: FocusEvent | KeyboardEvent, name: string) {
|
|
65
65
|
showingTagCreationField.value = false
|
|
66
66
|
keyForTagCreation.value = Date.now()
|
|
67
67
|
|
|
@@ -110,7 +110,7 @@ function onTagClick(event: MouseEvent, tagId?: number | string) {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
function onUpdateTag(event:
|
|
113
|
+
function onUpdateTag(event: FocusEvent | KeyboardEvent, name: string, tagId?: number | string) {
|
|
114
114
|
if (name) {
|
|
115
115
|
emit('update', event, name, tagId)
|
|
116
116
|
}
|
|
@@ -166,8 +166,8 @@ function onRemoveTag(event: MouseEvent, tagId?: number | string) {
|
|
|
166
166
|
:size="size"
|
|
167
167
|
:text="showingTagCreationField ? '' : t('newTag')"
|
|
168
168
|
@click="onShowTagField"
|
|
169
|
-
@input
|
|
170
|
-
@input
|
|
169
|
+
@input-blur="onCreateTag"
|
|
170
|
+
@input-submit="onCreateTag"
|
|
171
171
|
/>
|
|
172
172
|
|
|
173
173
|
<div class="flex items-center">
|
|
@@ -199,8 +199,8 @@ function onRemoveTag(event: MouseEvent, tagId?: number | string) {
|
|
|
199
199
|
:text="tag.text"
|
|
200
200
|
:to="tag.to"
|
|
201
201
|
@click="onTagClick"
|
|
202
|
-
@input
|
|
203
|
-
@input
|
|
202
|
+
@input-blur="onUpdateTag"
|
|
203
|
+
@input-submit="onUpdateTag"
|
|
204
204
|
@remove="onRemoveTag"
|
|
205
205
|
/>
|
|
206
206
|
</template>
|
|
@@ -74,7 +74,7 @@ function onShowMore() {
|
|
|
74
74
|
</script>
|
|
75
75
|
|
|
76
76
|
<template>
|
|
77
|
-
<
|
|
77
|
+
<component
|
|
78
78
|
:is="to ? NuxtLinkLocale : 'div'"
|
|
79
79
|
:class="{
|
|
80
80
|
'font-bold': bold,
|
|
@@ -156,7 +156,7 @@ function onShowMore() {
|
|
|
156
156
|
/>
|
|
157
157
|
|
|
158
158
|
<slot />
|
|
159
|
-
</
|
|
159
|
+
</component>
|
|
160
160
|
</template>
|
|
161
161
|
|
|
162
162
|
<i18n lang="json">
|
|
@@ -30,9 +30,9 @@ const props = withDefaults(defineProps<FieldInput>(), {
|
|
|
30
30
|
const emit = defineEmits<{
|
|
31
31
|
'blur': [event: FocusEvent]
|
|
32
32
|
'focus': [event: FocusEvent]
|
|
33
|
-
'keyup': [event: KeyboardEvent, value:
|
|
34
|
-
'submit': [event: KeyboardEvent, value:
|
|
35
|
-
'update:modelValue': [value:
|
|
33
|
+
'keyup': [event: KeyboardEvent, value: string ]
|
|
34
|
+
'submit': [event: KeyboardEvent, value: string ]
|
|
35
|
+
'update:modelValue': [value: string ]
|
|
36
36
|
}>()
|
|
37
37
|
|
|
38
38
|
defineSlots<{
|
|
@@ -82,10 +82,10 @@ function onFieldFocus(event: FocusEvent) {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
function onFieldInput(event: Event) {
|
|
85
|
-
let value
|
|
85
|
+
let value = (event.target as HTMLInputElement).value
|
|
86
86
|
|
|
87
87
|
if (props.type === 'number' && props.max && Number.parseInt(value) > props.max) {
|
|
88
|
-
value = props.max
|
|
88
|
+
value = props.max.toString()
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
if (props.lowercaseOnly) {
|
|
@@ -87,6 +87,7 @@ function onFieldInput() {
|
|
|
87
87
|
:id="uuid"
|
|
88
88
|
ref="textarea"
|
|
89
89
|
v-model="value"
|
|
90
|
+
v-bind="{ 'data-enable-grammarly': 'false' }"
|
|
90
91
|
class="w-full flex-1 appearance-none rounded-lg text-gray-900 font-medium tracking-tight uppercase outline-none dark:text-gray-100 placeholder-gray-600 dark:placeholder-gray-400 focus:placeholder-gray-900 hover:placeholder-gray-900 dark:focus:placeholder-gray-100 dark:hover:placeholder-gray-100"
|
|
91
92
|
:class="{
|
|
92
93
|
'p-2.5': padding,
|
|
@@ -104,7 +105,6 @@ function onFieldInput() {
|
|
|
104
105
|
'text-base': size === 'base',
|
|
105
106
|
'text-lg': size === 'lg',
|
|
106
107
|
}"
|
|
107
|
-
data-enable-grammarly="false"
|
|
108
108
|
:placeholder="placeholder"
|
|
109
109
|
:rows="rows"
|
|
110
110
|
spellcheck="false"
|
package/app/types/fields.d.ts
CHANGED
package/app/types/global.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type * as Bases from './bases'
|
|
2
2
|
import type * as Fields from './fields'
|
|
3
3
|
|
|
4
|
+
declare module '@vue/runtime-core' {
|
|
5
|
+
interface ComponentCustomProperties {
|
|
6
|
+
vHotkey?: Record<string, (event?: KeyboardEvent | MouseEvent) => void>
|
|
7
|
+
vTooltip?: Record<string, any> | string
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
4
11
|
declare global {
|
|
5
12
|
// Libraries
|
|
6
13
|
type ChartistBarChartData = import('chartist').BarChartData
|