@entur/fileupload 0.3.54 → 0.3.56

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.
@@ -20,69 +20,61 @@ function _extends() {
20
20
  _extends = Object.assign || function (target) {
21
21
  for (var i = 1; i < arguments.length; i++) {
22
22
  var source = arguments[i];
23
-
24
23
  for (var key in source) {
25
24
  if (Object.prototype.hasOwnProperty.call(source, key)) {
26
25
  target[key] = source[key];
27
26
  }
28
27
  }
29
28
  }
30
-
31
29
  return target;
32
30
  };
33
-
34
31
  return _extends.apply(this, arguments);
35
32
  }
36
-
37
33
  function _objectWithoutPropertiesLoose(source, excluded) {
38
34
  if (source == null) return {};
39
35
  var target = {};
40
36
  var sourceKeys = Object.keys(source);
41
37
  var key, i;
42
-
43
38
  for (i = 0; i < sourceKeys.length; i++) {
44
39
  key = sourceKeys[i];
45
40
  if (excluded.indexOf(key) >= 0) continue;
46
41
  target[key] = source[key];
47
42
  }
48
-
49
43
  return target;
50
44
  }
51
45
 
52
46
  var _excluded = ["standbyText", "errorText", "successText", "errorUpload", "onDrop", "onDelete", "accept", "files", "label", "removeFileButtonDescription", "style"];
53
47
  var FileUpload = function FileUpload(_ref) {
54
48
  var _ref$standbyText = _ref.standbyText,
55
- standbyText = _ref$standbyText === void 0 ? 'Dra fil eller klikk for å laste opp' : _ref$standbyText,
56
- _ref$errorText = _ref.errorText,
57
- errorText = _ref$errorText === void 0 ? 'Feil ved opplasting av fil' : _ref$errorText,
58
- _ref$successText = _ref.successText,
59
- successText = _ref$successText === void 0 ? 'Opplasting fullført' : _ref$successText,
60
- _ref$errorUpload = _ref.errorUpload,
61
- errorUpload = _ref$errorUpload === void 0 ? false : _ref$errorUpload,
62
- onDrop = _ref.onDrop,
63
- _ref$onDelete = _ref.onDelete,
64
- onDelete = _ref$onDelete === void 0 ? function (file) {
65
- return console.log(file);
66
- } : _ref$onDelete,
67
- _ref$accept = _ref.accept,
68
- accept = _ref$accept === void 0 ? '' : _ref$accept,
69
- _ref$files = _ref.files,
70
- files = _ref$files === void 0 ? [] : _ref$files,
71
- label = _ref.label,
72
- _ref$removeFileButton = _ref.removeFileButtonDescription,
73
- removeFileButtonDescription = _ref$removeFileButton === void 0 ? 'Fjern fil' : _ref$removeFileButton,
74
- style = _ref.style,
75
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
76
-
49
+ standbyText = _ref$standbyText === void 0 ? 'Dra fil eller klikk for å laste opp' : _ref$standbyText,
50
+ _ref$errorText = _ref.errorText,
51
+ errorText = _ref$errorText === void 0 ? 'Feil ved opplasting av fil' : _ref$errorText,
52
+ _ref$successText = _ref.successText,
53
+ successText = _ref$successText === void 0 ? 'Opplasting fullført' : _ref$successText,
54
+ _ref$errorUpload = _ref.errorUpload,
55
+ errorUpload = _ref$errorUpload === void 0 ? false : _ref$errorUpload,
56
+ onDrop = _ref.onDrop,
57
+ _ref$onDelete = _ref.onDelete,
58
+ onDelete = _ref$onDelete === void 0 ? function (file) {
59
+ return console.log(file);
60
+ } : _ref$onDelete,
61
+ _ref$accept = _ref.accept,
62
+ accept = _ref$accept === void 0 ? '' : _ref$accept,
63
+ _ref$files = _ref.files,
64
+ files = _ref$files === void 0 ? [] : _ref$files,
65
+ label = _ref.label,
66
+ _ref$removeFileButton = _ref.removeFileButtonDescription,
67
+ removeFileButtonDescription = _ref$removeFileButton === void 0 ? 'Fjern fil' : _ref$removeFileButton,
68
+ style = _ref.style,
69
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
77
70
  var _useDropzone = reactDropzone.useDropzone(_extends({
78
- onDrop: onDrop,
79
- accept: accept
80
- }, rest)),
81
- getRootProps = _useDropzone.getRootProps,
82
- getInputProps = _useDropzone.getInputProps,
83
- isDragActive = _useDropzone.isDragActive,
84
- isDragReject = _useDropzone.isDragReject;
85
-
71
+ onDrop: onDrop,
72
+ accept: accept
73
+ }, rest)),
74
+ getRootProps = _useDropzone.getRootProps,
75
+ getInputProps = _useDropzone.getInputProps,
76
+ isDragActive = _useDropzone.isDragActive,
77
+ isDragReject = _useDropzone.isDragReject;
86
78
  var success = files.length > 0;
87
79
  return React__default["default"].createElement("div", _extends({
88
80
  className: "eds-file-upload__wrapper"
@@ -119,7 +111,6 @@ var FileUpload = function FileUpload(_ref) {
119
111
  }, React__default["default"].createElement(a11y.VisuallyHidden, null, removeFileButtonDescription, ", ", file.name), React__default["default"].createElement(icons.DeleteIcon, null)));
120
112
  })));
121
113
  };
122
-
123
114
  function convertSizeToHuman(size) {
124
115
  if (size < 1000) {
125
116
  return size + 'bytes;';
@@ -1 +1 @@
1
- {"version":3,"file":"fileupload.cjs.development.js","sources":["../src/FileUpload.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n"],"names":["FileUpload","standbyText","errorText","successText","errorUpload","onDrop","onDelete","file","console","log","accept","files","label","removeFileButtonDescription","style","rest","useDropzone","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","className","Label","display","classNames","map","index","key","FileIcon","path","convertSizeToHuman","size","IconButton","onClick","VisuallyHidden","name","DeleteIcon","toPrecision","warnAboutMissingStyles"],"mappings":"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"}
1
+ {"version":3,"file":"fileupload.cjs.development.js","sources":["../src/FileUpload.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n"],"names":["FileUpload","standbyText","errorText","successText","errorUpload","onDrop","onDelete","file","console","log","accept","files","label","removeFileButtonDescription","style","rest","useDropzone","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","className","Label","display","classNames","map","index","key","FileIcon","path","convertSizeToHuman","size","IconButton","onClick","VisuallyHidden","name","DeleteIcon","toPrecision","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6DaA,UAAU,GAA8B,SAAxCA,UAAU;8BACrBC,WAAW;IAAXA,WAAW,iCAAG,qCAAqC;IAAA,sBACnDC,SAAS;IAATA,SAAS,+BAAG,4BAA4B;IAAA,wBACxCC,WAAW;IAAXA,WAAW,iCAAG,qBAAqB;IAAA,wBACnCC,WAAW;IAAXA,WAAW,iCAAG,KAAK;IACnBC,MAAM,QAANA,MAAM;IAAA,qBACNC,QAAQ;IAARA,QAAQ,8BAAG,UAAAC,IAAI;MAAA,OAAIC,OAAO,CAACC,GAAG,CAACF,IAAI,CAAC;;IAAA,mBACpCG,MAAM;IAANA,MAAM,4BAAG,EAAE;IAAA,kBACXC,KAAK;IAALA,KAAK,2BAAG,EAAE;IACVC,KAAK,QAALA,KAAK;IAAA,6BACLC,2BAA2B;IAA3BA,2BAA2B,sCAAG,WAAW;IACzCC,KAAK,QAALA,KAAK;IACFC,IAAI;EAEP,mBACEC,yBAAW;MACTX,MAAM,EAANA,MAAM;MACNK,MAAM,EAAEA;OACLK,IAAI,EACP;IALIE,YAAY,gBAAZA,YAAY;IAAEC,aAAa,gBAAbA,aAAa;IAAEC,YAAY,gBAAZA,YAAY;IAAEC,YAAY,gBAAZA,YAAY;EAO/D,IAAMC,OAAO,GAAGV,KAAK,CAACW,MAAM,GAAG,CAAC;EAEhC,OACEC;IAAKC,SAAS,EAAC;KAA+BV,KAAK,GACjDS;IAAKC,SAAS,EAAC;KAA6BP,YAAY,EAAE,GACvDL,KAAK,IAAIW,wCAACE,gBAAK;IAACX,KAAK,EAAE;MAAEY,OAAO,EAAE;;KAAWd,KAAK,CAAS,EAC5DW,8DAAWL,aAAa,EAAE,EAAI,EAC9BK;IACEC,SAAS,EAAEG,8BAAU,CACnB,2BAA2B,EAC3B;MACE,oCAAoC,EAAEN;KACvC,EACD;MAAE,mCAAmC,EAAEF;KAAc,EACrD;MAAE,mCAAmC,EAAEC;KAAc,EACrD;MAAE,kCAAkC,EAAEhB;KAAa;KAGpDiB,OAAO,GAAGlB,WAAW,GAAGC,WAAW,GAAGF,SAAS,GAAGD,WAAW,CACzD,CACH,EACNsB;IAAKC,SAAS,EAAC;KACZb,KAAK,CAACiB,GAAG,CAAC,UAACrB,IAAkB,EAAEsB,KAAK;IAAA,OACnCN;MAAKC,SAAS,EAAC,4BAA4B;MAACM,GAAG,EAAED;OAC/CN,wCAACQ,cAAQ;MAACP,SAAS,EAAC;MAAoC,EACxDD;MAAMC,SAAS,EAAC;OACbjB,IAAI,CAACyB,IAAI,SAAKC,kBAAkB,CAAC1B,IAAI,CAAC2B,IAAI,CAAC,EAAE,GAAG,CAC5C,EACPX,wCAACY,iBAAU;MAACC,OAAO,EAAE;QAAA,OAAM9B,QAAQ,CAACC,IAAI,CAAC;;OACvCgB,wCAACc,mBAAc,QACZxB,2BAA2B,QAAIN,IAAI,CAAC+B,IAAI,CAC1B,EACjBf,wCAACgB,gBAAU,OAAG,CACH,CACT;GACP,CAAC,CACE,CACF;AAEV;AAEA,SAASN,kBAAkB,CAACC,IAAY;EACtC,IAAIA,IAAI,GAAG,IAAI,EAAE;IACf,OAAOA,IAAI,GAAG,QAAQ;GACvB,MAAM,IAAIA,IAAI,GAAG,OAAO,EAAE;IACzB,OAAUA,IAAI,GAAG,IAAI;GACtB,MAAM;IACL,OAAU,CAACA,IAAI,GAAG,OAAO,EAAEM,WAAW,CAAC,CAAC,CAAC;;AAE7C;;AChIAC,4BAAsB,CAAC,YAAY,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"fileupload.cjs.production.min.js","sources":["../src/index.tsx","../src/FileUpload.tsx"],"sourcesContent":["import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n","import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n"],"names":["warnAboutMissingStyles","standbyText","errorText","successText","errorUpload","onDrop","onDelete","file","console","log","accept","files","label","removeFileButtonDescription","style","rest","useDropzone","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","className","Label","display","classNames","map","index","key","FileIcon","path","size","toPrecision","IconButton","onClick","VisuallyHidden","name","DeleteIcon"],"mappings":"itBAGAA,yBAAuB,iCC0D8B,oBACnDC,YAAAA,aAAc,4CACdC,UAAAA,aAAY,mCACZC,YAAAA,aAAc,4BACdC,YAAAA,gBACAC,IAAAA,WACAC,SAAAA,aAAW,SAAAC,UAAQC,QAAQC,IAAIF,UAC/BG,OAAAA,aAAS,SACTC,MAAAA,aAAQ,KACRC,IAAAA,UACAC,4BAAAA,aAA8B,cAC9BC,IAAAA,MACGC,4IAGDC,iBACEX,OAAAA,EACAK,OAAQA,GACLK,IAJCE,IAAAA,aAAcC,IAAAA,cAAeC,IAAAA,aAAcC,IAAAA,aAO7CC,EAAUV,EAAMW,OAAS,SAG7BC,iCAAKC,UAAU,4BAA+BV,GAC5CS,iCAAKC,UAAU,0BAA6BP,KACzCL,GAASW,wBAACE,SAAMX,MAAO,CAAEY,QAAS,SAAWd,GAC9CW,qCAAWL,MACXK,gCACEC,UAAWG,UACT,4BACA,sCACwCN,GAExC,qCAAuCF,GACvC,qCAAuCC,GACvC,oCAAsChB,KAGvCiB,EAAUlB,EAAcC,EAAcF,EAAYD,IAGvDsB,+BAAKC,UAAU,8BACZb,EAAMiB,KAAI,SAACrB,EAAoBsB,UAC9BN,+BAAKC,UAAU,6BAA6BM,IAAKD,GAC/CN,wBAACQ,YAASP,UAAU,oCACpBD,gCAAMC,UAAU,oCACbjB,EAAKyB,YAeQC,EAfoB1B,EAAK0B,MAgBxC,IACFA,EAAO,SACLA,EAAO,IACNA,EAAO,YAENA,EAAO,KAASC,YAAY,SArBiB,KAEhDX,wBAACY,cAAWC,QAAS,kBAAM9B,EAASC,KAClCgB,wBAACc,sBACExB,OAA+BN,EAAK+B,MAEvCf,wBAACgB,qBASf,IAA4BN"}
1
+ {"version":3,"file":"fileupload.cjs.production.min.js","sources":["../src/index.tsx","../src/FileUpload.tsx"],"sourcesContent":["import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n","import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n"],"names":["warnAboutMissingStyles","standbyText","_ref$errorText","errorText","_ref$successText","successText","_ref$errorUpload","errorUpload","onDrop","_ref$onDelete","onDelete","file","console","log","_ref$accept","accept","_ref$files","files","label","_ref$removeFileButton","removeFileButtonDescription","style","rest","useDropzone","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","className","Label","display","classNames","map","index","key","FileIcon","path","size","toPrecision","IconButton","onClick","VisuallyHidden","name","DeleteIcon"],"mappings":"itBAGAA,yBAAuB,iCC0D8B,oBACnDC,YAAAA,aAAc,wCAAqCC,IACnDC,UAAAA,aAAY,+BAA4BC,IACxCC,YAAAA,aAAc,wBAAqBC,IACnCC,YAAAA,gBACAC,IAAAA,OAAMC,IACNC,SAAAA,aAAW,SAAAC,GAAI,OAAIC,QAAQC,IAAIF,MAAKG,IACpCC,OAAAA,aAAS,KAAEC,IACXC,MAAAA,aAAQ,KACRC,IAAAA,MAAKC,IACLC,4BAAAA,aAA8B,cAC9BC,IAAAA,MACGC,4IAGDC,iBACEf,OAAAA,EACAO,OAAQA,GACLO,IAJCE,IAAAA,aAAcC,IAAAA,cAAeC,IAAAA,aAAcC,IAAAA,aAO7CC,EAAUX,EAAMY,OAAS,EAE/B,OACEC,iCAAKC,UAAU,4BAA+BV,GAC5CS,iCAAKC,UAAU,0BAA6BP,KACzCN,GAASY,wBAACE,SAAMX,MAAO,CAAEY,QAAS,SAAWf,GAC9CY,qCAAWL,MACXK,gCACEC,UAAWG,UACT,4BACA,CACE,qCAAsCN,GAExC,CAAE,oCAAqCF,GACvC,CAAE,oCAAqCC,GACvC,CAAE,mCAAoCpB,KAGvCqB,EAAUvB,EAAcE,EAAcJ,EAAYF,IAGvD6B,+BAAKC,UAAU,8BACZd,EAAMkB,KAAI,SAACxB,EAAoByB,GAAK,OACnCN,+BAAKC,UAAU,6BAA6BM,IAAKD,GAC/CN,wBAACQ,YAASP,UAAU,oCACpBD,gCAAMC,UAAU,oCACbpB,EAAK4B,YAeQC,EAfoB7B,EAAK6B,MAgBxC,IACFA,EAAO,SACLA,EAAO,IACNA,EAAO,YAENA,EAAO,KAASC,YAAY,SArBiB,KAEhDX,wBAACY,cAAWC,QAAS,WAAA,OAAMjC,EAASC,KAClCmB,wBAACc,sBACExB,OAA+BT,EAAKkC,MAEvCf,wBAACgB,qBASf,IAA4BN"}
@@ -11,69 +11,61 @@ function _extends() {
11
11
  _extends = Object.assign || function (target) {
12
12
  for (var i = 1; i < arguments.length; i++) {
13
13
  var source = arguments[i];
14
-
15
14
  for (var key in source) {
16
15
  if (Object.prototype.hasOwnProperty.call(source, key)) {
17
16
  target[key] = source[key];
18
17
  }
19
18
  }
20
19
  }
21
-
22
20
  return target;
23
21
  };
24
-
25
22
  return _extends.apply(this, arguments);
26
23
  }
27
-
28
24
  function _objectWithoutPropertiesLoose(source, excluded) {
29
25
  if (source == null) return {};
30
26
  var target = {};
31
27
  var sourceKeys = Object.keys(source);
32
28
  var key, i;
33
-
34
29
  for (i = 0; i < sourceKeys.length; i++) {
35
30
  key = sourceKeys[i];
36
31
  if (excluded.indexOf(key) >= 0) continue;
37
32
  target[key] = source[key];
38
33
  }
39
-
40
34
  return target;
41
35
  }
42
36
 
43
37
  var _excluded = ["standbyText", "errorText", "successText", "errorUpload", "onDrop", "onDelete", "accept", "files", "label", "removeFileButtonDescription", "style"];
44
38
  var FileUpload = function FileUpload(_ref) {
45
39
  var _ref$standbyText = _ref.standbyText,
46
- standbyText = _ref$standbyText === void 0 ? 'Dra fil eller klikk for å laste opp' : _ref$standbyText,
47
- _ref$errorText = _ref.errorText,
48
- errorText = _ref$errorText === void 0 ? 'Feil ved opplasting av fil' : _ref$errorText,
49
- _ref$successText = _ref.successText,
50
- successText = _ref$successText === void 0 ? 'Opplasting fullført' : _ref$successText,
51
- _ref$errorUpload = _ref.errorUpload,
52
- errorUpload = _ref$errorUpload === void 0 ? false : _ref$errorUpload,
53
- onDrop = _ref.onDrop,
54
- _ref$onDelete = _ref.onDelete,
55
- onDelete = _ref$onDelete === void 0 ? function (file) {
56
- return console.log(file);
57
- } : _ref$onDelete,
58
- _ref$accept = _ref.accept,
59
- accept = _ref$accept === void 0 ? '' : _ref$accept,
60
- _ref$files = _ref.files,
61
- files = _ref$files === void 0 ? [] : _ref$files,
62
- label = _ref.label,
63
- _ref$removeFileButton = _ref.removeFileButtonDescription,
64
- removeFileButtonDescription = _ref$removeFileButton === void 0 ? 'Fjern fil' : _ref$removeFileButton,
65
- style = _ref.style,
66
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
67
-
40
+ standbyText = _ref$standbyText === void 0 ? 'Dra fil eller klikk for å laste opp' : _ref$standbyText,
41
+ _ref$errorText = _ref.errorText,
42
+ errorText = _ref$errorText === void 0 ? 'Feil ved opplasting av fil' : _ref$errorText,
43
+ _ref$successText = _ref.successText,
44
+ successText = _ref$successText === void 0 ? 'Opplasting fullført' : _ref$successText,
45
+ _ref$errorUpload = _ref.errorUpload,
46
+ errorUpload = _ref$errorUpload === void 0 ? false : _ref$errorUpload,
47
+ onDrop = _ref.onDrop,
48
+ _ref$onDelete = _ref.onDelete,
49
+ onDelete = _ref$onDelete === void 0 ? function (file) {
50
+ return console.log(file);
51
+ } : _ref$onDelete,
52
+ _ref$accept = _ref.accept,
53
+ accept = _ref$accept === void 0 ? '' : _ref$accept,
54
+ _ref$files = _ref.files,
55
+ files = _ref$files === void 0 ? [] : _ref$files,
56
+ label = _ref.label,
57
+ _ref$removeFileButton = _ref.removeFileButtonDescription,
58
+ removeFileButtonDescription = _ref$removeFileButton === void 0 ? 'Fjern fil' : _ref$removeFileButton,
59
+ style = _ref.style,
60
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
68
61
  var _useDropzone = useDropzone(_extends({
69
- onDrop: onDrop,
70
- accept: accept
71
- }, rest)),
72
- getRootProps = _useDropzone.getRootProps,
73
- getInputProps = _useDropzone.getInputProps,
74
- isDragActive = _useDropzone.isDragActive,
75
- isDragReject = _useDropzone.isDragReject;
76
-
62
+ onDrop: onDrop,
63
+ accept: accept
64
+ }, rest)),
65
+ getRootProps = _useDropzone.getRootProps,
66
+ getInputProps = _useDropzone.getInputProps,
67
+ isDragActive = _useDropzone.isDragActive,
68
+ isDragReject = _useDropzone.isDragReject;
77
69
  var success = files.length > 0;
78
70
  return React.createElement("div", _extends({
79
71
  className: "eds-file-upload__wrapper"
@@ -110,7 +102,6 @@ var FileUpload = function FileUpload(_ref) {
110
102
  }, React.createElement(VisuallyHidden, null, removeFileButtonDescription, ", ", file.name), React.createElement(DeleteIcon, null)));
111
103
  })));
112
104
  };
113
-
114
105
  function convertSizeToHuman(size) {
115
106
  if (size < 1000) {
116
107
  return size + 'bytes;';
@@ -1 +1 @@
1
- {"version":3,"file":"fileupload.esm.js","sources":["../src/FileUpload.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n"],"names":["FileUpload","standbyText","errorText","successText","errorUpload","onDrop","onDelete","file","console","log","accept","files","label","removeFileButtonDescription","style","rest","useDropzone","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","className","Label","display","classNames","map","index","key","FileIcon","path","convertSizeToHuman","size","IconButton","onClick","VisuallyHidden","name","DeleteIcon","toPrecision","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6DaA,UAAU,GAA8B,SAAxCA,UAAwC;8BACnDC;MAAAA,4CAAc;4BACdC;MAAAA,wCAAY;8BACZC;MAAAA,4CAAc;8BACdC;MAAAA,4CAAc;MACdC,cAAAA;2BACAC;MAAAA,sCAAW,UAAAC,IAAI;AAAA,WAAIC,OAAO,CAACC,GAAR,CAAYF,IAAZ,CAAJ;AAAA;yBACfG;MAAAA,kCAAS;wBACTC;MAAAA,gCAAQ;MACRC,aAAAA;mCACAC;MAAAA,iEAA8B;MAC9BC,aAAAA;MACGC;;AAEH,qBACEC,WAAW;AACTX,IAAAA,MAAM,EAANA,MADS;AAETK,IAAAA,MAAM,EAAEA;AAFC,KAGNK,IAHM,EADb;AAAA,MAAQE,YAAR,gBAAQA,YAAR;AAAA,MAAsBC,aAAtB,gBAAsBA,aAAtB;AAAA,MAAqCC,YAArC,gBAAqCA,YAArC;AAAA,MAAmDC,YAAnD,gBAAmDA,YAAnD;;AAOA,MAAMC,OAAO,GAAGV,KAAK,CAACW,MAAN,GAAe,CAA/B;AAEA,SACEC,mBAAA,MAAA;AAAKC,IAAAA,SAAS,EAAC;AAAf,KAA8CV,KAA9C,GACES,mBAAA,MAAA;AAAKC,IAAAA,SAAS,EAAC;AAAf,KAA4CP,YAAY,EAAxD,GACGL,KAAK,IAAIW,mBAAA,CAACE,KAAD;AAAOX,IAAAA,KAAK,EAAE;AAAEY,MAAAA,OAAO,EAAE;AAAX;GAAd,EAAoCd,KAApC,CADZ,EAEEW,mBAAA,QAAA,eAAWL,aAAa,EAAxB,EAFF,EAGEK,mBAAA,OAAA;AACEC,IAAAA,SAAS,EAAEG,UAAU,CACnB,2BADmB,EAEnB;AACE,4CAAsCN;AADxC,KAFmB,EAKnB;AAAE,2CAAqCF;AAAvC,KALmB,EAMnB;AAAE,2CAAqCC;AAAvC,KANmB,EAOnB;AAAE,0CAAoChB;AAAtC,KAPmB;GADvB,EAWGiB,OAAO,GAAGlB,WAAH,GAAiBC,WAAW,GAAGF,SAAH,GAAeD,WAXrD,CAHF,CADF,EAkBEsB,mBAAA,MAAA;AAAKC,IAAAA,SAAS,EAAC;GAAf,EACGb,KAAK,CAACiB,GAAN,CAAU,UAACrB,IAAD,EAAqBsB,KAArB;AAAA,WACTN,mBAAA,MAAA;AAAKC,MAAAA,SAAS,EAAC;AAA6BM,MAAAA,GAAG,EAAED;KAAjD,EACEN,mBAAA,CAACQ,QAAD;AAAUP,MAAAA,SAAS,EAAC;KAApB,CADF,EAEED,mBAAA,OAAA;AAAMC,MAAAA,SAAS,EAAC;KAAhB,EACGjB,IAAI,CAACyB,IADR,OAAA,EACiBC,kBAAkB,CAAC1B,IAAI,CAAC2B,IAAN,CADnC,EACgD,GADhD,CAFF,EAKEX,mBAAA,CAACY,UAAD;AAAYC,MAAAA,OAAO,EAAE;AAAA,eAAM9B,QAAQ,CAACC,IAAD,CAAd;AAAA;KAArB,EACEgB,mBAAA,CAACc,cAAD,MAAA,EACGxB,2BADH,MAAA,EACkCN,IAAI,CAAC+B,IADvC,CADF,EAIEf,mBAAA,CAACgB,UAAD,MAAA,CAJF,CALF,CADS;AAAA,GAAV,CADH,CAlBF,CADF;AAqCD;;AAED,SAASN,kBAAT,CAA4BC,IAA5B;AACE,MAAIA,IAAI,GAAG,IAAX,EAAiB;AACf,WAAOA,IAAI,GAAG,QAAd;AACD,GAFD,MAEO,IAAIA,IAAI,GAAG,OAAX,EAAoB;AACzB,WAAUA,IAAI,GAAG,IAAjB;AACD,GAFM,MAEA;AACL,WAAU,CAACA,IAAI,GAAG,OAAR,EAAiBM,WAAjB,CAA6B,CAA7B,CAAV;AACD;AACF;;AChIDC,sBAAsB,CAAC,YAAD,CAAtB;;;;"}
1
+ {"version":3,"file":"fileupload.esm.js","sources":["../src/FileUpload.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport {\n useDropzone,\n DropzoneOptions,\n FileRejection,\n DropEvent,\n FileWithPath,\n} from 'react-dropzone';\nimport classNames from 'classnames';\n\nimport { FileIcon, DeleteIcon } from '@entur/icons';\nimport { IconButton } from '@entur/button';\nimport { Label } from '@entur/typography';\nimport { VisuallyHidden } from '@entur/a11y';\n\nimport './FileUpload.scss';\n\ntype FileUploadProps = DropzoneOptions & {\n /** Tekst som vises ved fullført opplasting\n * @default \"Opplasting fullført\"\n */\n successText?: string;\n /** Tekst som vises om opplasting feilet\n * @default \"Feil ved opplasting av fil\"\n */\n errorText?: string;\n /** Tekst som vises før man laster opp noe\n * @default \"Dra fil eller klikk for å laste opp\"\n */\n standbyText?: string;\n /** Boolean for hvis opplastingen feiler.\n * @default false\n */\n errorUpload?: boolean;\n /** Callback for når en fil legges til */\n onDrop?<T extends File>(\n acceptedFiles: T[],\n fileRejections: FileRejection[],\n event: DropEvent,\n ): void;\n /** Callback for når en fil slettes fra lista */\n onDelete?: (file: FileWithPath) => void;\n /** Hvilken filtyper som skal aksepteres */\n accept?: string | string[];\n /** Filene som er aktive i komponenten */\n files: File[];\n /** Beskrivende tekst som forklarer feltet */\n label?: string;\n /** Mulighet for å laste opp flere filer */\n multiple?: boolean;\n /**Minste filstørrelse */\n minSize?: number;\n /**Største filstørrelse */\n maxSize?: number;\n /**Tekst som leses opp av skjermleser på søppelbøtte-ikonet\n * @default \"Fjern fil\"\n */\n removeFileButtonDescription?: string;\n [key: string]: any;\n};\n\nexport const FileUpload: React.FC<FileUploadProps> = ({\n standbyText = 'Dra fil eller klikk for å laste opp',\n errorText = 'Feil ved opplasting av fil',\n successText = 'Opplasting fullført',\n errorUpload = false,\n onDrop,\n onDelete = file => console.log(file),\n accept = '',\n files = [],\n label,\n removeFileButtonDescription = 'Fjern fil',\n style,\n ...rest\n}) => {\n const { getRootProps, getInputProps, isDragActive, isDragReject } =\n useDropzone({\n onDrop,\n accept: accept,\n ...rest,\n });\n\n const success = files.length > 0;\n\n return (\n <div className=\"eds-file-upload__wrapper\" {...style}>\n <div className=\"eds-file-upload__input\" {...getRootProps()}>\n {label && <Label style={{ display: 'flex' }}>{label}</Label>}\n <input {...getInputProps()} />\n <span\n className={classNames(\n 'eds-file-upload__dropzone',\n {\n 'eds-file-upload__dropzone--success': success,\n },\n { 'eds-file-upload__dropzone--active': isDragActive },\n { 'eds-file-upload__dropzone--reject': isDragReject },\n { 'eds-file-upload__dropzone--error': errorUpload },\n )}\n >\n {success ? successText : errorUpload ? errorText : standbyText}\n </span>\n </div>\n <div className=\"eds-file-upload__file-list\">\n {files.map((file: FileWithPath, index) => (\n <div className=\"eds-file-upload__file-name\" key={index}>\n <FileIcon className=\"eds-file-upload__file-name-icon\" />\n <span className=\"eds-field-upload__file-name-path\">\n {file.path} - {convertSizeToHuman(file.size)}{' '}\n </span>\n <IconButton onClick={() => onDelete(file)}>\n <VisuallyHidden>\n {removeFileButtonDescription}, {file.name}\n </VisuallyHidden>\n <DeleteIcon />\n </IconButton>\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nfunction convertSizeToHuman(size: number) {\n if (size < 1000) {\n return size + 'bytes;';\n } else if (size < 1000000) {\n return `${size / 1000} KB`;\n } else {\n return `${(size / 1000000).toPrecision(4)} MB`;\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('fileupload');\n\nexport * from './FileUpload';\n"],"names":["FileUpload","standbyText","errorText","successText","errorUpload","onDrop","onDelete","file","console","log","accept","files","label","removeFileButtonDescription","style","rest","useDropzone","getRootProps","getInputProps","isDragActive","isDragReject","success","length","React","className","Label","display","classNames","map","index","key","FileIcon","path","convertSizeToHuman","size","IconButton","onClick","VisuallyHidden","name","DeleteIcon","toPrecision","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6DaA,UAAU,GAA8B,SAAxCA,UAAU;8BACrBC,WAAW;IAAXA,WAAW,iCAAG,qCAAqC;IAAA,sBACnDC,SAAS;IAATA,SAAS,+BAAG,4BAA4B;IAAA,wBACxCC,WAAW;IAAXA,WAAW,iCAAG,qBAAqB;IAAA,wBACnCC,WAAW;IAAXA,WAAW,iCAAG,KAAK;IACnBC,MAAM,QAANA,MAAM;IAAA,qBACNC,QAAQ;IAARA,QAAQ,8BAAG,UAAAC,IAAI;MAAA,OAAIC,OAAO,CAACC,GAAG,CAACF,IAAI,CAAC;;IAAA,mBACpCG,MAAM;IAANA,MAAM,4BAAG,EAAE;IAAA,kBACXC,KAAK;IAALA,KAAK,2BAAG,EAAE;IACVC,KAAK,QAALA,KAAK;IAAA,6BACLC,2BAA2B;IAA3BA,2BAA2B,sCAAG,WAAW;IACzCC,KAAK,QAALA,KAAK;IACFC,IAAI;EAEP,mBACEC,WAAW;MACTX,MAAM,EAANA,MAAM;MACNK,MAAM,EAAEA;OACLK,IAAI,EACP;IALIE,YAAY,gBAAZA,YAAY;IAAEC,aAAa,gBAAbA,aAAa;IAAEC,YAAY,gBAAZA,YAAY;IAAEC,YAAY,gBAAZA,YAAY;EAO/D,IAAMC,OAAO,GAAGV,KAAK,CAACW,MAAM,GAAG,CAAC;EAEhC,OACEC;IAAKC,SAAS,EAAC;KAA+BV,KAAK,GACjDS;IAAKC,SAAS,EAAC;KAA6BP,YAAY,EAAE,GACvDL,KAAK,IAAIW,oBAACE,KAAK;IAACX,KAAK,EAAE;MAAEY,OAAO,EAAE;;KAAWd,KAAK,CAAS,EAC5DW,0CAAWL,aAAa,EAAE,EAAI,EAC9BK;IACEC,SAAS,EAAEG,UAAU,CACnB,2BAA2B,EAC3B;MACE,oCAAoC,EAAEN;KACvC,EACD;MAAE,mCAAmC,EAAEF;KAAc,EACrD;MAAE,mCAAmC,EAAEC;KAAc,EACrD;MAAE,kCAAkC,EAAEhB;KAAa;KAGpDiB,OAAO,GAAGlB,WAAW,GAAGC,WAAW,GAAGF,SAAS,GAAGD,WAAW,CACzD,CACH,EACNsB;IAAKC,SAAS,EAAC;KACZb,KAAK,CAACiB,GAAG,CAAC,UAACrB,IAAkB,EAAEsB,KAAK;IAAA,OACnCN;MAAKC,SAAS,EAAC,4BAA4B;MAACM,GAAG,EAAED;OAC/CN,oBAACQ,QAAQ;MAACP,SAAS,EAAC;MAAoC,EACxDD;MAAMC,SAAS,EAAC;OACbjB,IAAI,CAACyB,IAAI,SAAKC,kBAAkB,CAAC1B,IAAI,CAAC2B,IAAI,CAAC,EAAE,GAAG,CAC5C,EACPX,oBAACY,UAAU;MAACC,OAAO,EAAE;QAAA,OAAM9B,QAAQ,CAACC,IAAI,CAAC;;OACvCgB,oBAACc,cAAc,QACZxB,2BAA2B,QAAIN,IAAI,CAAC+B,IAAI,CAC1B,EACjBf,oBAACgB,UAAU,OAAG,CACH,CACT;GACP,CAAC,CACE,CACF;AAEV;AAEA,SAASN,kBAAkB,CAACC,IAAY;EACtC,IAAIA,IAAI,GAAG,IAAI,EAAE;IACf,OAAOA,IAAI,GAAG,QAAQ;GACvB,MAAM,IAAIA,IAAI,GAAG,OAAO,EAAE;IACzB,OAAUA,IAAI,GAAG,IAAI;GACtB,MAAM;IACL,OAAU,CAACA,IAAI,GAAG,OAAO,EAAEM,WAAW,CAAC,CAAC,CAAC;;AAE7C;;AChIAC,sBAAsB,CAAC,YAAY,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entur/fileupload",
3
- "version": "0.3.54",
3
+ "version": "0.3.56",
4
4
  "license": "EUPL-1.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/fileupload.esm.js",
@@ -17,18 +17,18 @@
17
17
  "access": "public"
18
18
  },
19
19
  "scripts": {
20
- "start": "dts watch --noClean",
21
- "build": "dts build",
22
- "test": "dts test --env=jsdom",
23
- "lint": "dts lint"
20
+ "start": "yarn run dts watch --noClean",
21
+ "build": "yarn run dts build",
22
+ "test": "yarn run dts test --env=jsdom",
23
+ "lint": "yarn run dts lint"
24
24
  },
25
25
  "dependencies": {
26
- "@entur/a11y": "^0.2.49",
27
- "@entur/button": "^2.10.4",
28
- "@entur/icons": "^5.2.1",
29
- "@entur/tokens": "^3.4.1",
30
- "@entur/typography": "^1.7.0",
31
- "@entur/utils": "^0.4.5",
26
+ "@entur/a11y": "^0.2.51",
27
+ "@entur/button": "^2.10.6",
28
+ "@entur/icons": "^5.3.0",
29
+ "@entur/tokens": "^3.4.2",
30
+ "@entur/typography": "^1.7.2",
31
+ "@entur/utils": "^0.4.7",
32
32
  "classnames": "^2.3.1",
33
33
  "react-dropzone": "^11.3.4"
34
34
  },
@@ -36,5 +36,12 @@
36
36
  "react": ">=16.8.0",
37
37
  "react-dom": ">=16.8.0"
38
38
  },
39
- "gitHead": "55fa775a3dc3520ba18f006ae982ad9a7644518a"
39
+ "devDependencies": {
40
+ "dts-cli": "^1.1.6",
41
+ "jest": "^27.0.0",
42
+ "jest-watch-typeahead": "^2.2.0",
43
+ "ts-jest": "^27.0.0",
44
+ "typescript": "^4.8.0"
45
+ },
46
+ "gitHead": "8915b1630bd936740ba9a4a88883f3432948a80e"
40
47
  }
package/CHANGELOG.md DELETED
@@ -1,260 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [0.3.54](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.53...@entur/fileupload@0.3.54) (2022-10-31)
7
-
8
- ### Bug Fixes
9
-
10
- - **file upload:** set onDelete type to be optional as it actually is ([1248b59](https://bitbucket.org/enturas/design-system/commits/1248b597c795459c484d788c077d9c3a58f0a1a2))
11
-
12
- ## [0.3.53](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.52...@entur/fileupload@0.3.53) (2022-10-31)
13
-
14
- **Note:** Version bump only for package @entur/fileupload
15
-
16
- ## [0.3.52](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.51...@entur/fileupload@0.3.52) (2022-10-31)
17
-
18
- **Note:** Version bump only for package @entur/fileupload
19
-
20
- ## [0.3.51](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.50...@entur/fileupload@0.3.51) (2022-10-20)
21
-
22
- **Note:** Version bump only for package @entur/fileupload
23
-
24
- ## [0.3.50](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.49...@entur/fileupload@0.3.50) (2022-10-20)
25
-
26
- **Note:** Version bump only for package @entur/fileupload
27
-
28
- ## [0.3.49](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.48...@entur/fileupload@0.3.49) (2022-10-12)
29
-
30
- **Note:** Version bump only for package @entur/fileupload
31
-
32
- ## [0.3.47](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.46...@entur/fileupload@0.3.47) (2022-08-31)
33
-
34
- **Note:** Version bump only for package @entur/fileupload
35
-
36
- ## [0.3.46](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.45...@entur/fileupload@0.3.46) (2022-08-31)
37
-
38
- ### Bug Fixes
39
-
40
- - **file upload:** add descriptive screen reader text to remove file button ([42c37d1](https://bitbucket.org/enturas/design-system/commits/42c37d131e2db5f712b1ce7cf3336b6d536cadd2))
41
-
42
- ## [0.3.45](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.44...@entur/fileupload@0.3.45) (2022-08-24)
43
-
44
- **Note:** Version bump only for package @entur/fileupload
45
-
46
- ## [0.3.44](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.43...@entur/fileupload@0.3.44) (2022-08-09)
47
-
48
- **Note:** Version bump only for package @entur/fileupload
49
-
50
- ## [0.3.43](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.42...@entur/fileupload@0.3.43) (2022-07-05)
51
-
52
- **Note:** Version bump only for package @entur/fileupload
53
-
54
- ## [0.3.42](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.41...@entur/fileupload@0.3.42) (2022-06-28)
55
-
56
- **Note:** Version bump only for package @entur/fileupload
57
-
58
- ## [0.3.41](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.40...@entur/fileupload@0.3.41) (2022-06-24)
59
-
60
- **Note:** Version bump only for package @entur/fileupload
61
-
62
- ## [0.3.40](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.39...@entur/fileupload@0.3.40) (2022-06-02)
63
-
64
- **Note:** Version bump only for package @entur/fileupload
65
-
66
- ## [0.3.39](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.38...@entur/fileupload@0.3.39) (2022-05-13)
67
-
68
- **Note:** Version bump only for package @entur/fileupload
69
-
70
- ## [0.3.38](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.37...@entur/fileupload@0.3.38) (2022-05-04)
71
-
72
- **Note:** Version bump only for package @entur/fileupload
73
-
74
- ## [0.3.37](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.36...@entur/fileupload@0.3.37) (2022-04-27)
75
-
76
- **Note:** Version bump only for package @entur/fileupload
77
-
78
- ## [0.3.36](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.35...@entur/fileupload@0.3.36) (2022-04-20)
79
-
80
- **Note:** Version bump only for package @entur/fileupload
81
-
82
- ## [0.3.35](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.34...@entur/fileupload@0.3.35) (2022-04-19)
83
-
84
- **Note:** Version bump only for package @entur/fileupload
85
-
86
- ## [0.3.34](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.33...@entur/fileupload@0.3.34) (2022-03-01)
87
-
88
- **Note:** Version bump only for package @entur/fileupload
89
-
90
- ## [0.3.33](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.32...@entur/fileupload@0.3.33) (2022-02-09)
91
-
92
- **Note:** Version bump only for package @entur/fileupload
93
-
94
- ## [0.3.32](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.31...@entur/fileupload@0.3.32) (2021-11-17)
95
-
96
- **Note:** Version bump only for package @entur/fileupload
97
-
98
- ## [0.3.31](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.30...@entur/fileupload@0.3.31) (2021-09-23)
99
-
100
- **Note:** Version bump only for package @entur/fileupload
101
-
102
- ## [0.3.30](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.29...@entur/fileupload@0.3.30) (2021-09-13)
103
-
104
- **Note:** Version bump only for package @entur/fileupload
105
-
106
- ## [0.3.29](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.28...@entur/fileupload@0.3.29) (2021-09-07)
107
-
108
- ### Bug Fixes
109
-
110
- - fix lint warning ([6d8d06e](https://bitbucket.org/enturas/design-system/commits/6d8d06e7f2a088d2e857d41d52aa08f4ab50a49f))
111
- - update dependencies ([d99dbde](https://bitbucket.org/enturas/design-system/commits/d99dbde566107589902f7f19bde3286a7195a600))
112
- - utilize reworked focus token ([586758f](https://bitbucket.org/enturas/design-system/commits/586758fc86eb5aa52116c63c14ef033eb2e8b12f))
113
-
114
- ## [0.3.28](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.27...@entur/fileupload@0.3.28) (2021-08-13)
115
-
116
- **Note:** Version bump only for package @entur/fileupload
117
-
118
- ## [0.3.27](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.26...@entur/fileupload@0.3.27) (2021-07-16)
119
-
120
- **Note:** Version bump only for package @entur/fileupload
121
-
122
- ## [0.3.26](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.25...@entur/fileupload@0.3.26) (2021-06-25)
123
-
124
- ### Bug Fixes
125
-
126
- - update dependencies ([30a33f7](https://bitbucket.org/enturas/design-system/commits/30a33f773e488c64c4cec2d1d07a9d617412f46a))
127
-
128
- ## [0.3.25](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.24...@entur/fileupload@0.3.25) (2021-05-05)
129
-
130
- **Note:** Version bump only for package @entur/fileupload
131
-
132
- ## [0.3.24](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.23...@entur/fileupload@0.3.24) (2021-04-23)
133
-
134
- ### Bug Fixes
135
-
136
- - utilize new focus tokens ([17113ef](https://bitbucket.org/enturas/design-system/commits/17113ef3f791c86fa6e19e71680fd5acdbae4990))
137
-
138
- ## [0.3.23](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.22...@entur/fileupload@0.3.23) (2021-04-09)
139
-
140
- **Note:** Version bump only for package @entur/fileupload
141
-
142
- ## [0.3.22](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.21...@entur/fileupload@0.3.22) (2021-03-02)
143
-
144
- **Note:** Version bump only for package @entur/fileupload
145
-
146
- ## [0.3.21](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.20...@entur/fileupload@0.3.21) (2021-02-17)
147
-
148
- **Note:** Version bump only for package @entur/fileupload
149
-
150
- ## [0.3.20](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.19...@entur/fileupload@0.3.20) (2021-01-29)
151
-
152
- **Note:** Version bump only for package @entur/fileupload
153
-
154
- ## [0.3.19](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.18...@entur/fileupload@0.3.19) (2021-01-20)
155
-
156
- **Note:** Version bump only for package @entur/fileupload
157
-
158
- ## [0.3.18](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.17...@entur/fileupload@0.3.18) (2021-01-13)
159
-
160
- ### Bug Fixes
161
-
162
- - transpose grey colors for updated color tokens ([d6a444c](https://bitbucket.org/enturas/design-system/commits/d6a444c2c37339b9bac0702738ed52693367d344))
163
-
164
- ## [0.3.17](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.16...@entur/fileupload@0.3.17) (2021-01-05)
165
-
166
- **Note:** Version bump only for package @entur/fileupload
167
-
168
- ## [0.3.16](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.15...@entur/fileupload@0.3.16) (2020-12-04)
169
-
170
- **Note:** Version bump only for package @entur/fileupload
171
-
172
- ## [0.3.15](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.14...@entur/fileupload@0.3.15) (2020-11-10)
173
-
174
- ### Bug Fixes
175
-
176
- - **fileupload:** improve typing for onDrop prop ([29005c0](https://bitbucket.org/enturas/design-system/commits/29005c0a37dd2ad2c539072a0b22741ab98b6a3c))
177
-
178
- ## [0.3.14](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.13...@entur/fileupload@0.3.14) (2020-11-05)
179
-
180
- **Note:** Version bump only for package @entur/fileupload
181
-
182
- ## [0.3.13](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.12...@entur/fileupload@0.3.13) (2020-10-28)
183
-
184
- **Note:** Version bump only for package @entur/fileupload
185
-
186
- ## [0.3.12](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.11...@entur/fileupload@0.3.12) (2020-10-23)
187
-
188
- **Note:** Version bump only for package @entur/fileupload
189
-
190
- ## [0.3.11](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.10...@entur/fileupload@0.3.11) (2020-10-16)
191
-
192
- **Note:** Version bump only for package @entur/fileupload
193
-
194
- ## [0.3.10](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.9...@entur/fileupload@0.3.10) (2020-10-09)
195
-
196
- ### Bug Fixes
197
-
198
- - **fileupload:** adjust size to accomadate new input fields ([640ab33](https://bitbucket.org/enturas/design-system/commits/640ab33d45b11a325d03e2328eb1b1752a9d47d2))
199
-
200
- ## [0.3.9](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.8...@entur/fileupload@0.3.9) (2020-09-25)
201
-
202
- **Note:** Version bump only for package @entur/fileupload
203
-
204
- ## [0.3.8](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.7...@entur/fileupload@0.3.8) (2020-09-14)
205
-
206
- **Note:** Version bump only for package @entur/fileupload
207
-
208
- ## [0.3.7](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.6...@entur/fileupload@0.3.7) (2020-09-02)
209
-
210
- **Note:** Version bump only for package @entur/fileupload
211
-
212
- ## [0.3.6](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.5...@entur/fileupload@0.3.6) (2020-08-26)
213
-
214
- **Note:** Version bump only for package @entur/fileupload
215
-
216
- ## [0.3.5](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.4...@entur/fileupload@0.3.5) (2020-08-19)
217
-
218
- **Note:** Version bump only for package @entur/fileupload
219
-
220
- ## [0.3.4](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.3...@entur/fileupload@0.3.4) (2020-08-11)
221
-
222
- **Note:** Version bump only for package @entur/fileupload
223
-
224
- ## [0.3.3](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.2...@entur/fileupload@0.3.3) (2020-07-22)
225
-
226
- **Note:** Version bump only for package @entur/fileupload
227
-
228
- ## [0.3.2](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.1...@entur/fileupload@0.3.2) (2020-07-16)
229
-
230
- **Note:** Version bump only for package @entur/fileupload
231
-
232
- ## [0.3.1](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.3.0...@entur/fileupload@0.3.1) (2020-07-09)
233
-
234
- ### Bug Fixes
235
-
236
- - fix styling bugs for fileupload ([c194c71](https://bitbucket.org/enturas/design-system/commits/c194c71b55cc1e6511959f063928dfbec1c00b47))
237
-
238
- # [0.3.0](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.2.3...@entur/fileupload@0.3.0) (2020-07-03)
239
-
240
- ### Features
241
-
242
- - add label prop to fileupload component ([ec235b5](https://bitbucket.org/enturas/design-system/commits/ec235b5b4babc7571a809102528f829df01c526d))
243
-
244
- ## [0.2.3](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.2.2...@entur/fileupload@0.2.3) (2020-06-17)
245
-
246
- **Note:** Version bump only for package @entur/fileupload
247
-
248
- ## [0.2.2](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.2.1...@entur/fileupload@0.2.2) (2020-05-27)
249
-
250
- **Note:** Version bump only for package @entur/fileupload
251
-
252
- ## [0.2.1](https://bitbucket.org/enturas/design-system/compare/@entur/fileupload@0.2.0...@entur/fileupload@0.2.1) (2020-05-26)
253
-
254
- **Note:** Version bump only for package @entur/fileupload
255
-
256
- # 0.2.0 (2020-05-20)
257
-
258
- ### Features
259
-
260
- - add fileuploading component ([06f408d](https://bitbucket.org/enturas/design-system/commits/06f408d575fb2ed03aedfdac5df5d329b3d5895d))