Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Forms): add Value.Upload component #4233

Merged
merged 16 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ import {
Section,
Upload,
} from '@dnb/eufemia/src'

const createMockFile = (name: string, size: number, type: string) => {
const file = new File([], name, { type })
Object.defineProperty(file, 'size', {
get() {
return size
},
})
return file
}
import { createMockFile } from '@dnb/eufemia/src/components/upload/__tests__/testHelpers'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't import them for inside tests – but rather export it from one of the upload Examples.tsx files and import it in the other one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okok, I'll do so then 🫡

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this better?
ab59727


const useMockFiles = (setFiles, extend) => {
React.useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: 'Upload'
description: '`Value.Upload` is a wrapper component for displaying Upload files, with user experience tailored for an array of files.'
componentType: 'feature-value'
showTabs: true
tabs:
- title: Info
key: '/info'
- title: Demos
key: '/demos'
- title: Properties
key: '/properties'
breadcrumb:
- text: Forms
href: /uilib/extensions/forms/
- text: Value
href: /uilib/extensions/forms/Value/
- text: Upload
href: /uilib/extensions/forms/Value/Upload/
---

import Info from 'Docs/uilib/extensions/forms/Value/Upload/info'
import Demos from 'Docs/uilib/extensions/forms/Value/Upload/demos'

<Info />
<Demos />
Loading
Loading