diff --git a/packages/buefy-next/rollup.config.mjs b/packages/buefy-next/rollup.config.mjs index c3b18891e..fe2f2459e 100644 --- a/packages/buefy-next/rollup.config.mjs +++ b/packages/buefy-next/rollup.config.mjs @@ -40,7 +40,6 @@ const JS_COMPONENTS = [ 'numberinput', 'table', 'timepicker', - 'upload', ] const entries = { diff --git a/packages/buefy-next/src/components/upload/Upload.spec.js b/packages/buefy-next/src/components/upload/Upload.spec.ts similarity index 90% rename from packages/buefy-next/src/components/upload/Upload.spec.js rename to packages/buefy-next/src/components/upload/Upload.spec.ts index e778bdec3..1343a259b 100644 --- a/packages/buefy-next/src/components/upload/Upload.spec.js +++ b/packages/buefy-next/src/components/upload/Upload.spec.ts @@ -1,7 +1,9 @@ import { shallowMount } from '@vue/test-utils' -import BUpload from '@components/upload/Upload' +import type { VueWrapper } from '@vue/test-utils' +import { beforeEach, describe, expect, it } from 'vitest' +import BUpload from '@components/upload/Upload.vue' -let wrapper +let wrapper: VueWrapper> describe('BUpload', () => { beforeEach(() => { diff --git a/packages/buefy-next/src/components/upload/Upload.vue b/packages/buefy-next/src/components/upload/Upload.vue index 9d339ffea..e21fc9028 100644 --- a/packages/buefy-next/src/components/upload/Upload.vue +++ b/packages/buefy-next/src/components/upload/Upload.vue @@ -37,17 +37,20 @@ - diff --git a/packages/buefy-next/src/components/upload/__snapshots__/Upload.spec.js.snap b/packages/buefy-next/src/components/upload/__snapshots__/Upload.spec.js.snap deleted file mode 100644 index 96a27f0b2..000000000 --- a/packages/buefy-next/src/components/upload/__snapshots__/Upload.spec.js.snap +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`BUpload render correctly 1`] = ``; diff --git a/packages/buefy-next/src/components/upload/__snapshots__/Upload.spec.ts.snap b/packages/buefy-next/src/components/upload/__snapshots__/Upload.spec.ts.snap new file mode 100644 index 000000000..8d3235b68 --- /dev/null +++ b/packages/buefy-next/src/components/upload/__snapshots__/Upload.spec.ts.snap @@ -0,0 +1,3 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`BUpload > render correctly 1`] = `""`; diff --git a/packages/buefy-next/src/components/upload/index.js b/packages/buefy-next/src/components/upload/index.ts similarity index 79% rename from packages/buefy-next/src/components/upload/index.js rename to packages/buefy-next/src/components/upload/index.ts index e057fe57d..f2a0ed55b 100644 --- a/packages/buefy-next/src/components/upload/index.js +++ b/packages/buefy-next/src/components/upload/index.ts @@ -1,9 +1,9 @@ +import type { App } from 'vue' import Upload from './Upload.vue' - import { registerComponent } from '../../utils/plugins' const Plugin = { - install(Vue) { + install(Vue: App) { registerComponent(Vue, Upload) } } diff --git a/packages/buefy-next/src/utils/FormElementMixin.ts b/packages/buefy-next/src/utils/FormElementMixin.ts index 4e1d684b8..28a299c0b 100644 --- a/packages/buefy-next/src/utils/FormElementMixin.ts +++ b/packages/buefy-next/src/utils/FormElementMixin.ts @@ -182,11 +182,15 @@ const FormElementMixin = defineComponent({ * If validation fail, send 'is-danger' type, * and error message to parent if it's a Field. */ - checkHtml5Validity() { - if (!this.useHtml5Validation) return + checkHtml5Validity(): boolean { + if (!this.useHtml5Validation) { + return false + } const el = this.getElement() - if (el == null) return + if (el == null) { + return false + } if (!el.checkValidity()) { this.setInvalid() diff --git a/packages/docs/src/pages/components/upload/Upload.vue b/packages/docs/src/pages/components/upload/Upload.vue index 70005bea2..0f2c48c7a 100644 --- a/packages/docs/src/pages/components/upload/Upload.vue +++ b/packages/docs/src/pages/components/upload/Upload.vue @@ -14,27 +14,36 @@ - diff --git a/packages/docs/src/pages/components/upload/api/upload.js b/packages/docs/src/pages/components/upload/api/upload.ts similarity index 100% rename from packages/docs/src/pages/components/upload/api/upload.js rename to packages/docs/src/pages/components/upload/api/upload.ts diff --git a/packages/docs/src/pages/components/upload/examples/ExDragDrop.vue b/packages/docs/src/pages/components/upload/examples/ExDragDrop.vue index 71683a996..f9ef18faf 100644 --- a/packages/docs/src/pages/components/upload/examples/ExDragDrop.vue +++ b/packages/docs/src/pages/components/upload/examples/ExDragDrop.vue @@ -32,17 +32,25 @@ - diff --git a/packages/docs/src/pages/components/upload/examples/ExExpanded.vue b/packages/docs/src/pages/components/upload/examples/ExExpanded.vue index 74aed7e37..50deeac0c 100644 --- a/packages/docs/src/pages/components/upload/examples/ExExpanded.vue +++ b/packages/docs/src/pages/components/upload/examples/ExExpanded.vue @@ -30,18 +30,26 @@ - diff --git a/packages/docs/src/pages/components/upload/examples/ExRounded.vue b/packages/docs/src/pages/components/upload/examples/ExRounded.vue index e3e21f026..c1d584c5e 100644 --- a/packages/docs/src/pages/components/upload/examples/ExRounded.vue +++ b/packages/docs/src/pages/components/upload/examples/ExRounded.vue @@ -22,18 +22,26 @@ {{ file2.name }} - + - diff --git a/packages/docs/src/pages/components/upload/examples/ExSimple.vue b/packages/docs/src/pages/components/upload/examples/ExSimple.vue index 090672792..4c06de334 100644 --- a/packages/docs/src/pages/components/upload/examples/ExSimple.vue +++ b/packages/docs/src/pages/components/upload/examples/ExSimple.vue @@ -12,12 +12,20 @@ - diff --git a/packages/docs/src/pages/components/upload/examples/ExValidation.vue b/packages/docs/src/pages/components/upload/examples/ExValidation.vue index 40625063f..ee7e0f582 100644 --- a/packages/docs/src/pages/components/upload/examples/ExValidation.vue +++ b/packages/docs/src/pages/components/upload/examples/ExValidation.vue @@ -12,12 +12,20 @@ -