Skip to content

Commit be7bde1

Browse files
committed
fix(typescript): use vue-tsc in build step / fix typescript errors in src #41
1 parent efa9792 commit be7bde1

14 files changed

+60
-38
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ coverage
2424
*.sln
2525
*.sw?
2626
*.iml
27+
*.tsbuildinfo
2728

2829
.gitconfig
2930

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"dist"
6969
],
7070
"scripts": {
71-
"build": "unbuild",
71+
"build": "vue-tsc --build --force && unbuild",
7272
"dev": "vite serve dev",
7373
"dev:build": "vite build dev",
7474
"dev:preview": "vite preview dev",
@@ -103,6 +103,7 @@
103103
"@formkit/core": "^1.6.7",
104104
"@primevue/themes": "^4.1.1",
105105
"@types/node": "^22.7.9",
106+
"@types/uuid": "^10.0.0",
106107
"@unocss/preset-icons": "^0.63.6",
107108
"@unocss/preset-uno": "^0.63.6",
108109
"@vitejs/plugin-vue": "^5.1.4",

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/FormKitDataEdit.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang='ts'>
2+
import type { FormKitSchemaDefinition } from '@formkit/core'
3+
import type { PropType } from 'vue'
24
import { FormKit, FormKitMessages, FormKitSchema } from '@formkit/vue'
35
import { ref } from 'vue'
46
import FormKitDebug from './FormKitDebug.vue'
@@ -13,7 +15,7 @@ const props = defineProps({
1315
default: null,
1416
},
1517
schema: {
16-
type: Object,
18+
type: Object as PropType<FormKitSchemaDefinition>,
1719
default: null,
1820
},
1921
debugData: {
@@ -82,7 +84,7 @@ function handleSave() {
8284
</template>
8385
</FormKit>
8486
<FormKitDebug v-if="debugData" :data="formData" header="Data" />
85-
<FormKitDebug v-if="debugSchema" :data="formSchema" header="Schema" />
87+
<FormKitDebug v-if="debugSchema" :data="formSchema as object" header="Schema" />
8688
</div>
8789
</template>
8890

src/components/FormKitDataView.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang='ts'>
2+
import type { FormKitSchemaDefinition } from '@formkit/core'
3+
import type { PropType } from 'vue'
24
import { FormKit, FormKitSchema } from '@formkit/vue'
35
import { ref } from 'vue'
46
import FormKitDebug from './FormKitDebug.vue'
@@ -9,7 +11,7 @@ const props = defineProps({
911
default: null,
1012
},
1113
schema: {
12-
type: Object,
14+
type: Object as PropType<FormKitSchemaDefinition>,
1315
default: null,
1416
},
1517
formClass: {
@@ -42,7 +44,7 @@ const formData = ref(props.data)
4244
<slot />
4345
</FormKit>
4446
<FormKitDebug v-if="debugData" :data="formData" header="Data" />
45-
<FormKitDebug v-if="debugSchema" :data="formSchema" header="Schema" />
47+
<FormKitDebug v-if="debugSchema" :data="formSchema as object" header="Schema" />
4648
</div>
4749
</template>
4850

src/components/PrimeAutoComplete.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ const props = defineProps({
2525
2626
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
2727
28-
const suggestions = ref([])
28+
const suggestions = ref(['', {}])
29+
suggestions.value = []
2930
3031
function search(event: AutoCompleteCompleteEvent) {
3132
if (props.context?.options && props.context?.optionLabel) {

src/components/PrimeCheckbox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const generatedId = generateId()
4747
:tabindex="context?.attrs.tabindex"
4848
:aria-label="context?.attrs.ariaLabel"
4949
:aria-labelledby="context?.attrs.ariaLabelledby"
50-
:indeterminate="context.indeterminate ?? null"
50+
:indeterminate="context.indeterminate ?? undefined"
5151
:binary="context.binary ?? true"
5252
:variant="context.variant ?? 'outlined'"
5353
:true-value="context.trueValue ?? undefined"

src/components/PrimeDatePicker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const props = defineProps({
6262
const { validSlotNames, unstyled, isInvalid, handleInput } = useFormKitInput(props.context)
6363
6464
function handleBlur(e: DatePickerBlurEvent) {
65-
props.context?.handlers.blur(e.originalEvent)
65+
props.context?.handlers.blur(e.originalEvent as FocusEvent)
6666
}
6767
6868
function handleClearClick() {

src/components/PrimeEditor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const { unstyled, isInvalid, handleInput } = useFormKitInput(props.context)
2626
2727
function handleSelection(e: EditorSelectionChangeEvent) {
2828
if (e.range === null)
29-
props.context?.handlers.blur(e.htmlValue)
29+
props.context?.node.input(props.context?._value)
3030
}
3131
</script>
3232

src/components/PrimeInputNumber.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const props = defineProps({
3737
const { validSlotNames, unstyled, isInvalid } = useFormKitInput(props.context)
3838
3939
function handleBlur(e: InputNumberBlurEvent) {
40-
props.context?.handlers.blur(e.originalEvent)
40+
props.context?.handlers.blur(e.originalEvent as FocusEvent)
4141
}
4242
4343
function handleInput(_: any) {

0 commit comments

Comments
 (0)