design-react-kit 5.7.3 → 5.8.0
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/CHANGELOG.md +15 -0
- package/dist/Pager/Pager.cjs +1 -1
- package/dist/Pager/Pager.cjs.map +1 -1
- package/dist/Pager/Pager.js +9 -1
- package/dist/Pager/Pager.js.map +1 -1
- package/dist/Transfer/Item.cjs +1 -1
- package/dist/Transfer/Item.cjs.map +1 -1
- package/dist/Transfer/SelectAllCheckbox.cjs.map +1 -1
- package/dist/Transfer/Source.cjs +1 -1
- package/dist/Transfer/Source.cjs.map +1 -1
- package/dist/Transfer/Target.cjs +1 -1
- package/dist/Transfer/Target.cjs.map +1 -1
- package/dist/Transfer/Transfer.cjs +1 -1
- package/dist/Transfer/Transfer.cjs.map +1 -1
- package/dist/Upload/Upload.cjs +2 -0
- package/dist/Upload/Upload.cjs.map +1 -0
- package/dist/Upload/Upload.js +37 -0
- package/dist/Upload/Upload.js.map +1 -0
- package/dist/Upload/UploadDragNdrop.cjs +2 -0
- package/dist/Upload/UploadDragNdrop.cjs.map +1 -0
- package/dist/Upload/UploadDragNdrop.js +53 -0
- package/dist/Upload/UploadDragNdrop.js.map +1 -0
- package/dist/Upload/UploadList.cjs +2 -0
- package/dist/Upload/UploadList.cjs.map +1 -0
- package/dist/Upload/UploadList.js +9 -0
- package/dist/Upload/UploadList.js.map +1 -0
- package/dist/Upload/UploadListItem.cjs +2 -0
- package/dist/Upload/UploadListItem.cjs.map +1 -0
- package/dist/Upload/UploadListItem.js +53 -0
- package/dist/Upload/UploadListItem.js.map +1 -0
- package/dist/Upload/useUploadContext.cjs +2 -0
- package/dist/Upload/useUploadContext.cjs.map +1 -0
- package/dist/Upload/useUploadContext.js +9 -0
- package/dist/Upload/useUploadContext.js.map +1 -0
- package/dist/assets/index.d.cjs +2 -0
- package/dist/assets/index.d.cjs.map +1 -0
- package/dist/assets/index.d.js +1 -0
- package/dist/assets/index.d.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/types/Upload/Upload.d.ts +26 -0
- package/dist/types/Upload/UploadDragNdrop.d.ts +13 -0
- package/dist/types/Upload/UploadList.d.ts +13 -0
- package/dist/types/Upload/UploadListItem.d.ts +33 -0
- package/dist/types/Upload/useUploadContext.d.ts +6 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/upload-drag-drop-icon-TT56BXNQ.svg +21 -0
- package/package.json +2 -1
- package/src/Pager/Pager.tsx +11 -1
- package/src/Upload/Upload.tsx +98 -0
- package/src/Upload/UploadDragNdrop.tsx +101 -0
- package/src/Upload/UploadList.tsx +30 -0
- package/src/Upload/UploadListItem.tsx +120 -0
- package/src/Upload/useUploadContext.ts +14 -0
- package/src/assets/index.d.ts +1 -0
- package/src/assets/upload-drag-drop-icon.svg +21 -0
- package/src/index.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -103,6 +103,10 @@ export { Toolbar } from './Toolbar/Toolbar';
|
|
|
103
103
|
export { ToolbarDividerItem } from './Toolbar/ToolbarDividerItem';
|
|
104
104
|
export { ToolbarItem } from './Toolbar/ToolbarItem';
|
|
105
105
|
export { Transfer } from './Transfer/Transfer';
|
|
106
|
+
export { Upload } from './Upload/Upload';
|
|
107
|
+
export { UploadDragNdrop } from './Upload/UploadDragNdrop';
|
|
108
|
+
export { UploadList } from './Upload/UploadList';
|
|
109
|
+
export { UploadListItem } from './Upload/UploadListItem';
|
|
106
110
|
export { Video } from './Video/Video';
|
|
107
111
|
import './track-focus.js';
|
|
108
112
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,E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CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAkKtC,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { ElementType, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { IconProps } from '../Icon/Icon';
|
|
3
|
+
export interface UploadProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
/** L'id che lega il componente con la label */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Etichetta del per il componente Upload, default 'Upload' */
|
|
7
|
+
label?: string | ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Il nome dell'icona da mostrare, default è 'it-upload'. Per una lista completa vedi:
|
|
10
|
+
* <a href="https://italia.github.io/design-react-kit/?path=/story/componenti-icon--lista-icone" target="_blank">Lista icone</a>
|
|
11
|
+
* In caso di un'immagine esterna l'URL da utilizzare.
|
|
12
|
+
**/
|
|
13
|
+
icon?: string;
|
|
14
|
+
iconSize?: IconProps['size'];
|
|
15
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati. Il valore di default è 'input' */
|
|
16
|
+
tag?: ElementType;
|
|
17
|
+
/** Classi aggiuntive da usare per il componente Upload */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Indica che l'input è con un avatar */
|
|
20
|
+
isAvatar?: boolean;
|
|
21
|
+
avatarImg?: ReactNode;
|
|
22
|
+
/** Indica che l'avatar è piccolo */
|
|
23
|
+
avatarSmall?: boolean;
|
|
24
|
+
testId?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const Upload: ({ id, className, icon, iconSize, label, tag, isAvatar, avatarImg, avatarSmall, testId, ...attributes }: UploadProps) => React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
interface UploadDragNdropProps {
|
|
3
|
+
/**
|
|
4
|
+
* Array di file per il caricamento del file
|
|
5
|
+
*/
|
|
6
|
+
files: File[];
|
|
7
|
+
/**
|
|
8
|
+
* Funzione per impostare lo stato dei files
|
|
9
|
+
*/
|
|
10
|
+
setFiles: React.Dispatch<React.SetStateAction<File[]>>;
|
|
11
|
+
}
|
|
12
|
+
export declare const UploadDragNdrop: FC<UploadDragNdropProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
export interface UploadListProps extends HTMLAttributes<HTMLUListElement> {
|
|
3
|
+
/** Classi aggiuntive da usare per il componente lista del UploadList */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** Indica che gli item list hanno l'immagine come anteprima */
|
|
6
|
+
previewImage?: boolean;
|
|
7
|
+
/** Indica la tipologia di lista
|
|
8
|
+
* @default file
|
|
9
|
+
*/
|
|
10
|
+
tipologia: 'file' | 'gallery';
|
|
11
|
+
testId?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const UploadList: FC<UploadListProps>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ElementType, FC, HTMLAttributes, InputHTMLAttributes } from 'react';
|
|
2
|
+
export interface UploadListItemProps extends HTMLAttributes<HTMLUListElement> {
|
|
3
|
+
/** Classi aggiuntive da usare per il componente lista del UploadList */
|
|
4
|
+
className?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Indica l'icona del file
|
|
7
|
+
* @default it-file
|
|
8
|
+
*/
|
|
9
|
+
icon?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Indica lo stato dell'upload
|
|
12
|
+
* @default success
|
|
13
|
+
*/
|
|
14
|
+
uploadStatus?: 'success' | 'uploading' | 'error';
|
|
15
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
16
|
+
buttonTag?: ElementType;
|
|
17
|
+
/** Nome del file */
|
|
18
|
+
fileName?: string;
|
|
19
|
+
/** Peso del file */
|
|
20
|
+
fileWeight?: string;
|
|
21
|
+
/** Valore della barra progress in caso uploadStatus sia uploading */
|
|
22
|
+
progressValue?: number;
|
|
23
|
+
/** Indica che gli item list hanno l'immagine come anteprima */
|
|
24
|
+
previewImage?: boolean;
|
|
25
|
+
previewImageSrc?: string;
|
|
26
|
+
previewImageAlt?: string;
|
|
27
|
+
testId?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const UploadListItem: FC<UploadListItemProps> & {
|
|
30
|
+
UploadButton: typeof UploadButton;
|
|
31
|
+
};
|
|
32
|
+
declare const UploadButton: FC<InputHTMLAttributes<HTMLInputElement>>;
|
|
33
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -103,6 +103,10 @@ export { Toolbar } from './Toolbar/Toolbar';
|
|
|
103
103
|
export { ToolbarDividerItem } from './Toolbar/ToolbarDividerItem';
|
|
104
104
|
export { ToolbarItem } from './Toolbar/ToolbarItem';
|
|
105
105
|
export { Transfer } from './Transfer/Transfer';
|
|
106
|
+
export { Upload } from './Upload/Upload';
|
|
107
|
+
export { UploadDragNdrop } from './Upload/UploadDragNdrop';
|
|
108
|
+
export { UploadList } from './Upload/UploadList';
|
|
109
|
+
export { UploadListItem } from './Upload/UploadListItem';
|
|
106
110
|
export { Video } from './Video/Video';
|
|
107
111
|
export type { AccordionProps } from './Accordion/Accordion';
|
|
108
112
|
export type { AccordionBodyProps } from './Accordion/AccordionBody';
|
|
@@ -198,6 +202,7 @@ export type { TimelineProps } from './Timeline/TimelineWrapper';
|
|
|
198
202
|
export type { ToggleProps } from './Toggle/Toggle';
|
|
199
203
|
export type { ToolbarProps } from './Toolbar/Toolbar';
|
|
200
204
|
export type { ToolbarItemBadge, ToolbarItemProps } from './Toolbar/ToolbarItem';
|
|
205
|
+
export type { UploadProps } from './Upload/Upload';
|
|
201
206
|
export type { VideoProps, VideoSource, VideoTrackSource, VideoYouTube } from './Video/Video';
|
|
202
207
|
export type { BreadcrumbItemProps, ButtonDropdownProps, ButtonGroupProps, ButtonToolbarProps, CardColumnsProps, CardDeckProps, CardFooterProps, CardGroupProps, CardHeaderProps, CardImgOverlayProps, CardImgProps, CardLinkProps, CardSubtitleProps, ColProps, ContainerProps, FadeProps, FormFeedbackProps, FormGroupProps, FormProps, FormTextProps, InputGroupProps, InputGroupTextProps, LabelProps, ListGroupItemHeadingProps, ListGroupItemProps, ListGroupItemTextProps, ListGroupProps, MediaProps, NavbarBrandProps, NavbarProps, NavbarTogglerProps, NavItemProps, NavLinkProps, PaginationItem as PagerItemProps, PaginationLink as PagerLinkProps, PopoverBodyProps, PopoverHeaderProps, PopoverProps, RowProps, TableProps, TooltipProps, UncontrolledAlertProps, UncontrolledCollapseProps, UncontrolledTooltipProps } from 'reactstrap';
|
|
203
208
|
export type { SplideProps } from '@splidejs/react-splide';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="180px" height="180px" viewBox="0 0 180 180" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<!-- Generator: Sketch 52.4 (67378) - http://www.bohemiancoding.com/sketch -->
|
|
4
|
+
<title>icon</title>
|
|
5
|
+
<desc>Created with Sketch.</desc>
|
|
6
|
+
<g id="Upload" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
7
|
+
<g id="Artboard">
|
|
8
|
+
<g id="icon">
|
|
9
|
+
<rect id="Rectangle" fill="#D1E7FF" x="-4.54747351e-13" y="0" width="180" height="180"></rect>
|
|
10
|
+
<g id="Group-6-Copy" transform="translate(107.855175, 109.702248) rotate(-10.000000) translate(-107.855175, -109.702248) translate(48.355175, 35.202248)">
|
|
11
|
+
<path d="M9.09485765,0.818376999 L89.0909206,0.818376999 L118.590921,30.418377 L118.590921,140.31444 C118.590921,145.011035 114.783578,148.818377 110.086984,148.818377 L6.26021198,148.818377 C3.12914883,148.818377 0.590920643,146.280149 0.590920643,143.149086 L0.590920643,9.32231401 C0.590920643,4.62571928 4.39826293,0.818376999 9.09485765,0.818376999 Z" id="Rectangle-3" fill="#66A5E3" opacity="0.4"></path>
|
|
12
|
+
<polygon id="Line-3" fill="#FFFFFF" fill-rule="nonzero" points="21.0573959 73.8584959 21.0573959 65.3545589 70.8630412 65.3545589 70.8630412 73.8584959"></polygon>
|
|
13
|
+
<polygon id="Line-3-Copy" fill="#FFFFFF" fill-rule="nonzero" points="20.2171934 91.322159 20.2171934 82.818222 99.7211304 82.818222 99.7211304 91.322159"></polygon>
|
|
14
|
+
<polygon id="Line-3-Copy-2" fill="#FFFFFF" fill-rule="nonzero" points="20.3932458 107.600028 20.3932458 99.0960906 99.8971828 99.0960906 99.8971828 107.600028"></polygon>
|
|
15
|
+
<polygon id="Rectangle-7" fill="#0059B3" opacity="0.2" transform="translate(105.449361, 40.610535) scale(-1, 1) rotate(90.000000) translate(-105.449361, -40.610535) " points="92.3040422 27.4750409 118.594681 53.7460296 95.2464052 53.7377589"></polygon>
|
|
16
|
+
<path d="M89.0927528,0.842666647 L118.560625,30.3915947 L100.247733,30.6719146 C94.1805894,30.7647859 89.186911,25.9216815 89.0940397,19.8545382 C89.0931818,19.7984895 89.0927528,19.7424351 89.0927528,19.6863799 L89.0927528,0.842666647 Z" id="Rectangle-7" fill="#FFFFFF"></path>
|
|
17
|
+
</g>
|
|
18
|
+
</g>
|
|
19
|
+
</g>
|
|
20
|
+
</g>
|
|
21
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/italia/design-react-kit/issues"
|
|
27
27
|
},
|
|
28
|
-
"version": "5.
|
|
28
|
+
"version": "5.8.0",
|
|
29
29
|
"license": "BSD-3",
|
|
30
30
|
"type": "module",
|
|
31
31
|
"module": "./dist/index.js",
|
|
@@ -118,6 +118,7 @@
|
|
|
118
118
|
"husky": "^8.0.1",
|
|
119
119
|
"jest": "^29.7.0",
|
|
120
120
|
"jest-environment-jsdom": "^29.7.0",
|
|
121
|
+
"jest-transform-stub": "^2.0.0",
|
|
121
122
|
"lint-staged": "15.2.10",
|
|
122
123
|
"prettier": "^3.2.5",
|
|
123
124
|
"react": "^18.2.0",
|
package/src/Pager/Pager.tsx
CHANGED
|
@@ -34,9 +34,19 @@ export const Pager: FC<PagerProps> = ({
|
|
|
34
34
|
const listClasses = classNames(listClassName, 'pagination');
|
|
35
35
|
const { ariaLabel, label } = total || {};
|
|
36
36
|
const totalAriaLabel = ariaLabel ? <span className='visually-hidden'>{ariaLabel}</span> : null;
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
const listChildren = React.Children.toArray(children).filter((child: any) => child.type.name === 'PaginationItem');
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
const extraChildren = React.Children.toArray(children).filter((child: any)=> child.type.name !== 'PaginationItem');
|
|
41
|
+
|
|
42
|
+
// listChildren?.forEach(child => {
|
|
43
|
+
// console.log(child)
|
|
44
|
+
// })
|
|
45
|
+
|
|
37
46
|
return (
|
|
38
47
|
<Tag className={classes} {...attributes} data-testid={testId}>
|
|
39
|
-
<ListTag className={listClasses}>{
|
|
48
|
+
<ListTag className={listClasses}>{listChildren}</ListTag>
|
|
49
|
+
{extraChildren}
|
|
40
50
|
{total ? (
|
|
41
51
|
<p>
|
|
42
52
|
{totalAriaLabel}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React, { ElementType, InputHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { Icon, IconProps } from '../Icon/Icon';
|
|
4
|
+
|
|
5
|
+
export interface UploadProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
6
|
+
/** L'id che lega il componente con la label */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Etichetta del per il componente Upload, default 'Upload' */
|
|
9
|
+
label?: string | ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Il nome dell'icona da mostrare, default è 'it-upload'. Per una lista completa vedi:
|
|
12
|
+
* <a href="https://italia.github.io/design-react-kit/?path=/story/componenti-icon--lista-icone" target="_blank">Lista icone</a>
|
|
13
|
+
* In caso di un'immagine esterna l'URL da utilizzare.
|
|
14
|
+
**/
|
|
15
|
+
icon?: string;
|
|
16
|
+
iconSize?: IconProps['size'];
|
|
17
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati. Il valore di default è 'input' */
|
|
18
|
+
tag?: ElementType;
|
|
19
|
+
/** Classi aggiuntive da usare per il componente Upload */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Indica che l'input è con un avatar */
|
|
22
|
+
isAvatar?: boolean;
|
|
23
|
+
avatarImg?: ReactNode;
|
|
24
|
+
/** Indica che l'avatar è piccolo */
|
|
25
|
+
avatarSmall?: boolean;
|
|
26
|
+
testId?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Upload = ({
|
|
30
|
+
id,
|
|
31
|
+
className,
|
|
32
|
+
icon = 'it-upload',
|
|
33
|
+
iconSize,
|
|
34
|
+
label = 'Upload',
|
|
35
|
+
tag = 'input',
|
|
36
|
+
isAvatar,
|
|
37
|
+
avatarImg,
|
|
38
|
+
avatarSmall,
|
|
39
|
+
testId,
|
|
40
|
+
...attributes
|
|
41
|
+
}: UploadProps) => {
|
|
42
|
+
const Tag = tag,
|
|
43
|
+
classes = classNames(
|
|
44
|
+
className,
|
|
45
|
+
{
|
|
46
|
+
upload: isAvatar ? false : true
|
|
47
|
+
},
|
|
48
|
+
{ 'upload-avatar': isAvatar }
|
|
49
|
+
),
|
|
50
|
+
classesAvatarWrapper = classNames({
|
|
51
|
+
'avatar-upload-wrapper': true,
|
|
52
|
+
'size-sm': avatarSmall
|
|
53
|
+
}),
|
|
54
|
+
extraAttributes: {
|
|
55
|
+
id?: string;
|
|
56
|
+
type: 'file';
|
|
57
|
+
['aria-describedby']?: string;
|
|
58
|
+
} = {
|
|
59
|
+
id,
|
|
60
|
+
type: 'file'
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// associate the input field with the help text
|
|
64
|
+
const infoId = id ? `${id}Description` : undefined;
|
|
65
|
+
if (id) {
|
|
66
|
+
extraAttributes['aria-describedby'] = infoId;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (isAvatar) {
|
|
70
|
+
return (
|
|
71
|
+
<div className={classesAvatarWrapper}>
|
|
72
|
+
<div className='avatar size-xxl avatar-upload'>
|
|
73
|
+
{avatarImg}
|
|
74
|
+
<div className='upload-avatar-container'>
|
|
75
|
+
<Tag {...attributes} {...extraAttributes} className={classes} data-testid={testId} />
|
|
76
|
+
<label htmlFor={id}>
|
|
77
|
+
<Icon icon={icon} size={iconSize} />
|
|
78
|
+
<span>{label}</span>
|
|
79
|
+
</label>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<div className='avatar-upload-icon'>
|
|
83
|
+
<Icon icon='it-camera' size='sm' />
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<>
|
|
91
|
+
<Tag {...attributes} {...extraAttributes} className={classes} data-testid={testId} />
|
|
92
|
+
<label htmlFor={id}>
|
|
93
|
+
<Icon icon={icon} size={iconSize} />
|
|
94
|
+
<span>{label}</span>
|
|
95
|
+
</label>
|
|
96
|
+
</>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React, { DragEventHandler, FC, useState } from 'react';
|
|
3
|
+
import { Icon } from '../Icon/Icon';
|
|
4
|
+
import DragandDropIcon from '../assets/upload-drag-drop-icon.svg';
|
|
5
|
+
|
|
6
|
+
interface UploadDragNdropProps {
|
|
7
|
+
/**
|
|
8
|
+
* Array di file per il caricamento del file
|
|
9
|
+
*/
|
|
10
|
+
files: File[];
|
|
11
|
+
/**
|
|
12
|
+
* Funzione per impostare lo stato dei files
|
|
13
|
+
*/
|
|
14
|
+
setFiles: React.Dispatch<React.SetStateAction<File[]>>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const UploadDragNdrop: FC<UploadDragNdropProps> = ({ files, setFiles }) => {
|
|
18
|
+
const [dragOverClass, setDragOverClass] = useState(false),
|
|
19
|
+
dragOverClasses = classNames('upload-dragdrop', {
|
|
20
|
+
dragover: dragOverClass,
|
|
21
|
+
success: files.length > 0
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const handleDrop: DragEventHandler<HTMLDivElement> = (event) => {
|
|
25
|
+
handleDrag(event);
|
|
26
|
+
const droppedFiles = event.dataTransfer.files;
|
|
27
|
+
if (droppedFiles.length > 0) {
|
|
28
|
+
setFiles(Array.from(droppedFiles));
|
|
29
|
+
}
|
|
30
|
+
setDragOverClass(false);
|
|
31
|
+
},
|
|
32
|
+
handleDrag: DragEventHandler<HTMLDivElement> = (event) => {
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
event.stopPropagation();
|
|
35
|
+
},
|
|
36
|
+
handleDragOver: DragEventHandler<HTMLDivElement> = (event) => {
|
|
37
|
+
handleDrag(event);
|
|
38
|
+
setDragOverClass(true);
|
|
39
|
+
},
|
|
40
|
+
handleDragLeave: DragEventHandler<HTMLDivElement> = (event) => {
|
|
41
|
+
handleDrag(event);
|
|
42
|
+
setDragOverClass(false);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const byteConverter = (bytes: number) => {
|
|
46
|
+
const K_UNIT = 1024;
|
|
47
|
+
const SIZES = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
48
|
+
|
|
49
|
+
if (bytes == 0) return '0 Byte';
|
|
50
|
+
|
|
51
|
+
const i = Math.floor(Math.log(bytes) / Math.log(K_UNIT)),
|
|
52
|
+
resp = parseFloat((bytes / Math.pow(K_UNIT, i)).toFixed(2)) + ' ' + SIZES[i];
|
|
53
|
+
|
|
54
|
+
return resp;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div className={dragOverClasses}>
|
|
59
|
+
<div
|
|
60
|
+
className='upload-dragdrop-image'
|
|
61
|
+
onDrop={handleDrop}
|
|
62
|
+
onDrag={handleDrag}
|
|
63
|
+
onDragStart={handleDrag}
|
|
64
|
+
onDragEnd={handleDrag}
|
|
65
|
+
onDragExit={handleDrag}
|
|
66
|
+
onDragOver={handleDragOver}
|
|
67
|
+
onDragEnter={handleDrag}
|
|
68
|
+
onDragLeave={handleDragLeave}
|
|
69
|
+
>
|
|
70
|
+
<img src={DragandDropIcon} alt='descrizione immagine' aria-hidden='true' />
|
|
71
|
+
{files.length > 0 && (
|
|
72
|
+
<div className='upload-dragdrop-success'>
|
|
73
|
+
<Icon icon='it-check' size='xs' />
|
|
74
|
+
</div>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
<div className='upload-dragdrop-text'>
|
|
78
|
+
{files.length > 0 && (
|
|
79
|
+
<p className='upload-dragdrop-weight'>
|
|
80
|
+
<Icon icon='it-file' size='xs' />
|
|
81
|
+
{files.map((file) => file.type + ' ' + byteConverter(file.size))}
|
|
82
|
+
</p>
|
|
83
|
+
)}
|
|
84
|
+
{files.length > 0 ? (
|
|
85
|
+
<>
|
|
86
|
+
<h5>{files.map((file) => file.name)}</h5>
|
|
87
|
+
<p>Caricamento completato</p>
|
|
88
|
+
</>
|
|
89
|
+
) : (
|
|
90
|
+
<>
|
|
91
|
+
<h5>Trascina il file per caricarlo</h5>
|
|
92
|
+
<p>
|
|
93
|
+
oppure <input type='file' name='upload7' id='upload7' className='upload-dragdrop-input' />
|
|
94
|
+
<label htmlFor='upload7'>selezionalo dal dispositivo</label>
|
|
95
|
+
</p>
|
|
96
|
+
</>
|
|
97
|
+
)}
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React, { FC, HTMLAttributes } from 'react';
|
|
3
|
+
import { UploadContext } from './useUploadContext';
|
|
4
|
+
|
|
5
|
+
export interface UploadListProps extends HTMLAttributes<HTMLUListElement> {
|
|
6
|
+
/** Classi aggiuntive da usare per il componente lista del UploadList */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Indica che gli item list hanno l'immagine come anteprima */
|
|
9
|
+
previewImage?: boolean;
|
|
10
|
+
/** Indica la tipologia di lista
|
|
11
|
+
* @default file
|
|
12
|
+
*/
|
|
13
|
+
tipologia: 'file' | 'gallery';
|
|
14
|
+
testId?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const UploadList: FC<UploadListProps> = ({ className, previewImage, tipologia = 'file', ...attributes }) => {
|
|
18
|
+
const classes = classNames(
|
|
19
|
+
{ 'upload-file-list': tipologia == 'file' },
|
|
20
|
+
{ 'upload-pictures-wall': tipologia == 'gallery' },
|
|
21
|
+
{ 'upload-file-list-image': previewImage },
|
|
22
|
+
className
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<UploadContext.Provider value={{ tipologia }}>
|
|
27
|
+
<ul {...attributes} className={classes} />
|
|
28
|
+
</UploadContext.Provider>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import React, { ElementType, FC, HTMLAttributes, InputHTMLAttributes } from 'react';
|
|
3
|
+
import { Icon } from '../Icon/Icon';
|
|
4
|
+
import { Progress } from '../Progress/Progress';
|
|
5
|
+
import { useUploadContext } from './useUploadContext';
|
|
6
|
+
|
|
7
|
+
export interface UploadListItemProps extends HTMLAttributes<HTMLUListElement> {
|
|
8
|
+
/** Classi aggiuntive da usare per il componente lista del UploadList */
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Indica l'icona del file
|
|
12
|
+
* @default it-file
|
|
13
|
+
*/
|
|
14
|
+
icon?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Indica lo stato dell'upload
|
|
17
|
+
* @default success
|
|
18
|
+
*/
|
|
19
|
+
uploadStatus?: 'success' | 'uploading' | 'error';
|
|
20
|
+
/** Utilizzarlo in caso di utilizzo di componenti personalizzati */
|
|
21
|
+
buttonTag?: ElementType;
|
|
22
|
+
/** Nome del file */
|
|
23
|
+
fileName?: string;
|
|
24
|
+
/** Peso del file */
|
|
25
|
+
fileWeight?: string;
|
|
26
|
+
/** Valore della barra progress in caso uploadStatus sia uploading */
|
|
27
|
+
progressValue?: number;
|
|
28
|
+
/** Indica che gli item list hanno l'immagine come anteprima */
|
|
29
|
+
previewImage?: boolean;
|
|
30
|
+
previewImageSrc?: string;
|
|
31
|
+
previewImageAlt?: string;
|
|
32
|
+
testId?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const UploadListItem: FC<UploadListItemProps> & {
|
|
36
|
+
UploadButton: typeof UploadButton;
|
|
37
|
+
} = ({
|
|
38
|
+
className,
|
|
39
|
+
icon = 'it-file',
|
|
40
|
+
uploadStatus = 'success',
|
|
41
|
+
buttonTag = 'button',
|
|
42
|
+
progressValue,
|
|
43
|
+
previewImage,
|
|
44
|
+
previewImageSrc,
|
|
45
|
+
previewImageAlt,
|
|
46
|
+
fileName,
|
|
47
|
+
fileWeight,
|
|
48
|
+
children
|
|
49
|
+
}) => {
|
|
50
|
+
const tipologia = useUploadContext(),
|
|
51
|
+
classes = classNames(
|
|
52
|
+
{
|
|
53
|
+
'upload-file': tipologia === 'file',
|
|
54
|
+
success: uploadStatus === 'success' && tipologia === 'file',
|
|
55
|
+
uploading: uploadStatus === 'uploading' && tipologia === 'file',
|
|
56
|
+
error: uploadStatus === 'error' && tipologia === 'file'
|
|
57
|
+
},
|
|
58
|
+
className
|
|
59
|
+
),
|
|
60
|
+
classesProgress = classNames({ 'progress-image': previewImage }),
|
|
61
|
+
ButtonTag = buttonTag;
|
|
62
|
+
|
|
63
|
+
const elementiListItem = {
|
|
64
|
+
success: {
|
|
65
|
+
testoVHFile: 'File caricato:',
|
|
66
|
+
testoVHRightIcon: 'Caricamento ultimato',
|
|
67
|
+
rightIcon: 'it-check'
|
|
68
|
+
},
|
|
69
|
+
uploading: {
|
|
70
|
+
testoVHFile: 'File caricato:',
|
|
71
|
+
testoVHRightIcon: 'Annulla caricamento',
|
|
72
|
+
rightIcon: 'it-close'
|
|
73
|
+
},
|
|
74
|
+
error: {
|
|
75
|
+
testoVHFile: 'Errore caricamento file:',
|
|
76
|
+
testoVHRightIcon: 'Elimina file caricato',
|
|
77
|
+
rightIcon: 'it-close'
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<li className={classes}>
|
|
83
|
+
{children}
|
|
84
|
+
{previewImage ? (
|
|
85
|
+
<div className='upload-image'>
|
|
86
|
+
<img src={previewImageSrc} alt={previewImageAlt} />
|
|
87
|
+
</div>
|
|
88
|
+
) : (
|
|
89
|
+
tipologia === 'file' && <Icon icon={icon} size='sm' />
|
|
90
|
+
)}
|
|
91
|
+
{tipologia === 'file' && (
|
|
92
|
+
<>
|
|
93
|
+
<p>
|
|
94
|
+
<span className='visually-hidden'>{elementiListItem[uploadStatus].testoVHFile}</span>
|
|
95
|
+
{fileName} {uploadStatus === 'success' && <span className='upload-file-weight'>{fileWeight}</span>}
|
|
96
|
+
</p>
|
|
97
|
+
<ButtonTag disabled={uploadStatus === 'success' ? true : false}>
|
|
98
|
+
<span className='visually-hidden'>{elementiListItem[uploadStatus].testoVHRightIcon}</span>
|
|
99
|
+
<Icon icon={elementiListItem[uploadStatus].rightIcon} />
|
|
100
|
+
</ButtonTag>
|
|
101
|
+
{uploadStatus === 'uploading' && <Progress value={progressValue} wrapperClassName={classesProgress} />}
|
|
102
|
+
</>
|
|
103
|
+
)}
|
|
104
|
+
</li>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const UploadButton: FC<InputHTMLAttributes<HTMLInputElement>> = ({ id, children, ...props }) => {
|
|
109
|
+
return (
|
|
110
|
+
<>
|
|
111
|
+
<input type='file' id={id} className='upload pictures-wall' multiple={true} {...props} />
|
|
112
|
+
<label htmlFor={id}>
|
|
113
|
+
<Icon icon='it-plus' />
|
|
114
|
+
<span>{children}</span>
|
|
115
|
+
</label>
|
|
116
|
+
</>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
UploadListItem.UploadButton = UploadButton;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
interface UploadContextType {
|
|
4
|
+
tipologia: 'file' | 'gallery';
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const UploadContext = createContext<UploadContextType>({
|
|
8
|
+
tipologia: 'file'
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const useUploadContext = () => {
|
|
12
|
+
const { tipologia } = useContext(UploadContext);
|
|
13
|
+
return tipologia;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module '*.svg';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="180px" height="180px" viewBox="0 0 180 180" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<!-- Generator: Sketch 52.4 (67378) - http://www.bohemiancoding.com/sketch -->
|
|
4
|
+
<title>icon</title>
|
|
5
|
+
<desc>Created with Sketch.</desc>
|
|
6
|
+
<g id="Upload" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
7
|
+
<g id="Artboard">
|
|
8
|
+
<g id="icon">
|
|
9
|
+
<rect id="Rectangle" fill="#D1E7FF" x="-4.54747351e-13" y="0" width="180" height="180"></rect>
|
|
10
|
+
<g id="Group-6-Copy" transform="translate(107.855175, 109.702248) rotate(-10.000000) translate(-107.855175, -109.702248) translate(48.355175, 35.202248)">
|
|
11
|
+
<path d="M9.09485765,0.818376999 L89.0909206,0.818376999 L118.590921,30.418377 L118.590921,140.31444 C118.590921,145.011035 114.783578,148.818377 110.086984,148.818377 L6.26021198,148.818377 C3.12914883,148.818377 0.590920643,146.280149 0.590920643,143.149086 L0.590920643,9.32231401 C0.590920643,4.62571928 4.39826293,0.818376999 9.09485765,0.818376999 Z" id="Rectangle-3" fill="#66A5E3" opacity="0.4"></path>
|
|
12
|
+
<polygon id="Line-3" fill="#FFFFFF" fill-rule="nonzero" points="21.0573959 73.8584959 21.0573959 65.3545589 70.8630412 65.3545589 70.8630412 73.8584959"></polygon>
|
|
13
|
+
<polygon id="Line-3-Copy" fill="#FFFFFF" fill-rule="nonzero" points="20.2171934 91.322159 20.2171934 82.818222 99.7211304 82.818222 99.7211304 91.322159"></polygon>
|
|
14
|
+
<polygon id="Line-3-Copy-2" fill="#FFFFFF" fill-rule="nonzero" points="20.3932458 107.600028 20.3932458 99.0960906 99.8971828 99.0960906 99.8971828 107.600028"></polygon>
|
|
15
|
+
<polygon id="Rectangle-7" fill="#0059B3" opacity="0.2" transform="translate(105.449361, 40.610535) scale(-1, 1) rotate(90.000000) translate(-105.449361, -40.610535) " points="92.3040422 27.4750409 118.594681 53.7460296 95.2464052 53.7377589"></polygon>
|
|
16
|
+
<path d="M89.0927528,0.842666647 L118.560625,30.3915947 L100.247733,30.6719146 C94.1805894,30.7647859 89.186911,25.9216815 89.0940397,19.8545382 C89.0931818,19.7984895 89.0927528,19.7424351 89.0927528,19.6863799 L89.0927528,0.842666647 Z" id="Rectangle-7" fill="#FFFFFF"></path>
|
|
17
|
+
</g>
|
|
18
|
+
</g>
|
|
19
|
+
</g>
|
|
20
|
+
</g>
|
|
21
|
+
</svg>
|
package/src/index.ts
CHANGED
|
@@ -149,6 +149,10 @@ export { Toolbar } from './Toolbar/Toolbar';
|
|
|
149
149
|
export { ToolbarDividerItem } from './Toolbar/ToolbarDividerItem';
|
|
150
150
|
export { ToolbarItem } from './Toolbar/ToolbarItem';
|
|
151
151
|
export { Transfer } from './Transfer/Transfer';
|
|
152
|
+
export { Upload } from './Upload/Upload';
|
|
153
|
+
export { UploadDragNdrop } from './Upload/UploadDragNdrop';
|
|
154
|
+
export { UploadList } from './Upload/UploadList';
|
|
155
|
+
export { UploadListItem } from './Upload/UploadListItem';
|
|
152
156
|
export { Video } from './Video/Video';
|
|
153
157
|
|
|
154
158
|
// Types
|
|
@@ -259,6 +263,7 @@ export type { TimelineProps } from './Timeline/TimelineWrapper';
|
|
|
259
263
|
export type { ToggleProps } from './Toggle/Toggle';
|
|
260
264
|
export type { ToolbarProps } from './Toolbar/Toolbar';
|
|
261
265
|
export type { ToolbarItemBadge, ToolbarItemProps } from './Toolbar/ToolbarItem';
|
|
266
|
+
export type { UploadProps } from './Upload/Upload';
|
|
262
267
|
export type { VideoProps, VideoSource, VideoTrackSource, VideoYouTube } from './Video/Video';
|
|
263
268
|
|
|
264
269
|
export type {
|