@konoma-development/vue-components 0.1.11 → 0.1.13
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/components/form/KonomaForm.vue +7 -1
- package/components/form/KonomaFormField.vue +7 -1
- package/components/form/KonomaInput.vue +2 -2
- package/components/form/KonomaSelect.vue +1 -1
- package/components/ui/KonomaIcon.vue +9 -6
- package/package.json +6 -5
- package/tsconfig.json +1 -1
- package/types/form.ts +1 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<form @submit="submit">
|
|
2
|
+
<form ref="formRef" @submit="submit">
|
|
3
3
|
<slot />
|
|
4
4
|
</form>
|
|
5
5
|
</template>
|
|
@@ -17,9 +17,15 @@ const emit = defineEmits<{
|
|
|
17
17
|
(e: 'onSubmit'): void | Promise<void>
|
|
18
18
|
}>()
|
|
19
19
|
|
|
20
|
+
const formRef = useTemplateRef<HTMLFormElement>('formRef')
|
|
21
|
+
|
|
20
22
|
const errors = ref<Partial<Record<keyof DataType, string[]>>>({})
|
|
21
23
|
const submitAttempted = ref(false)
|
|
22
24
|
|
|
25
|
+
defineExpose({
|
|
26
|
+
formRef,
|
|
27
|
+
})
|
|
28
|
+
|
|
23
29
|
function validate() {
|
|
24
30
|
let invalid = false;
|
|
25
31
|
const newErrors: Record<keyof DataType, string[]> = {} as Record<keyof DataType, string[]>;
|
|
@@ -4,8 +4,14 @@
|
|
|
4
4
|
:is="resolvedComponent"
|
|
5
5
|
v-bind="props"
|
|
6
6
|
:error="errors && props.name ? errors[props.name as keyof typeof errors] : undefined"
|
|
7
|
-
v-on="emit"
|
|
8
7
|
@change="emit('change', $event)"
|
|
8
|
+
@icon-left-click="emit('iconLeftClick', $event)"
|
|
9
|
+
@icon-right-click="emit('iconRightClick', $event)"
|
|
10
|
+
@blur="emit('blur', $event)"
|
|
11
|
+
@focus="emit('focus', $event)"
|
|
12
|
+
@key-down="emit('keyDown', $event)"
|
|
13
|
+
@input="emit('input', $event)"
|
|
14
|
+
@click="emit('click', $event)"
|
|
9
15
|
>
|
|
10
16
|
<template #label>
|
|
11
17
|
<slot name="label" />
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
:class="combinedClasses"
|
|
13
13
|
:placeholder="placeholder"
|
|
14
14
|
:type="type"
|
|
15
|
-
:data-
|
|
15
|
+
:data-test-id="dataTestId"
|
|
16
16
|
:value="value"
|
|
17
17
|
:step="step"
|
|
18
18
|
:name="name?.toString()"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
:name="iconLeftName"
|
|
33
33
|
:path="iconLeftPath"
|
|
34
34
|
:class="iconLeftClasses"
|
|
35
|
-
@click="$emit('iconLeftClick')"
|
|
35
|
+
@click="$emit('iconLeftClick', $event)"
|
|
36
36
|
/>
|
|
37
37
|
<div v-if="iconRightPath || iconRightName || textRight" :class="wrapperRightClasses">
|
|
38
38
|
<span v-if="textRight">{{ textRight }}</span>
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<div class="flex flex-row items-center justify-center" @click="emit('click', $event)">
|
|
3
|
+
<svg v-if="path" :class="props.class">
|
|
4
|
+
<use :href="path" />
|
|
5
|
+
</svg>
|
|
6
|
+
<Icon v-else-if="name" :name="name" :class="props.class" />
|
|
7
|
+
</div>
|
|
6
8
|
</template>
|
|
7
9
|
|
|
8
10
|
<script lang="ts" setup>
|
|
9
|
-
defineProps<{
|
|
11
|
+
const props = defineProps<{
|
|
10
12
|
name?: string
|
|
11
13
|
path?: string
|
|
14
|
+
class?: string
|
|
12
15
|
}>()
|
|
13
16
|
|
|
14
|
-
defineEmits<{
|
|
17
|
+
const emit = defineEmits<{
|
|
15
18
|
(e: 'click', event: MouseEvent): void
|
|
16
19
|
}>()
|
|
17
20
|
</script>
|
package/package.json
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.13",
|
|
8
8
|
"packageManager": "yarn@4.14.1",
|
|
9
9
|
"main": "./nuxt.config.ts",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "nuxi dev .playground",
|
|
12
|
+
"prepare": "nuxi prepare",
|
|
12
13
|
"build": "nuxt build .playground",
|
|
13
14
|
"generate": "nuxt generate .playground",
|
|
14
15
|
"audit": "yarn npm audit --all --recursive --severity high",
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
"@iconify-json/carbon": "1.2.20",
|
|
29
30
|
"@nuxt/devtools": "3.2.4",
|
|
30
31
|
"@nuxt/eslint": "1.15.2",
|
|
31
|
-
"@nuxt/icon": "2.2.
|
|
32
|
+
"@nuxt/icon": "2.2.2",
|
|
32
33
|
"@nuxt/schema": "4.4.4",
|
|
33
34
|
"@nuxt/test-utils": "4.0.3",
|
|
34
35
|
"@pinia/nuxt": "0.11.3",
|
|
@@ -38,10 +39,10 @@
|
|
|
38
39
|
"@unocss/nuxt": "66.6.8",
|
|
39
40
|
"@unocss/reset": "66.6.8",
|
|
40
41
|
"@vitejs/plugin-vue": "6.0.6",
|
|
41
|
-
"@vueuse/nuxt": "14.
|
|
42
|
+
"@vueuse/nuxt": "14.3.0",
|
|
42
43
|
"babel-preset-vue": "2.0.2",
|
|
43
44
|
"changelogen": "0.6.2",
|
|
44
|
-
"eslint": "10.
|
|
45
|
+
"eslint": "10.3.0",
|
|
45
46
|
"floating-vue": "5.2.2",
|
|
46
47
|
"nuxt": "4.4.4",
|
|
47
48
|
"nuxt-headlessui": "1.2.2",
|
|
@@ -51,7 +52,7 @@
|
|
|
51
52
|
"unocss": "66.6.8",
|
|
52
53
|
"unocss-preset-scrollbar": "3.2.0",
|
|
53
54
|
"vite": "8.0.10",
|
|
54
|
-
"vue-tsc": "3.2.
|
|
55
|
+
"vue-tsc": "3.2.8",
|
|
55
56
|
"vue3-select-component": "0.16.2"
|
|
56
57
|
}
|
|
57
58
|
}
|
package/tsconfig.json
CHANGED
package/types/form.ts
CHANGED
|
@@ -74,14 +74,13 @@ export interface Classes {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
export interface FormFieldEmits {
|
|
77
|
-
(e: 'forgotPWAction', event: MouseEvent): void
|
|
78
77
|
(e: 'blur', event: FocusEvent): void
|
|
79
78
|
(e: 'focus', event: FocusEvent): void
|
|
80
79
|
(e: 'change', value: FormValue | FormValue[], event?: Event): void
|
|
81
80
|
(e: 'input', value: FormValue, event?: InputEvent): void
|
|
82
81
|
(e: 'click', event: MouseEvent): void
|
|
83
82
|
(e: 'iconRightClick', event: MouseEvent): void
|
|
84
|
-
(e: 'iconLeftClick'): void
|
|
83
|
+
(e: 'iconLeftClick', event: MouseEvent): void
|
|
85
84
|
(e: 'keyDown', event: KeyboardEvent): void
|
|
86
85
|
}
|
|
87
86
|
|