file-select-dialog
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -0,1 +1,8 @@ | ||
# [1.3.0](https://github.com/TomokiMiyauci/file-select-dialog/compare/v1.2.1...v1.3.0) (2020-11-21) | ||
### Features | ||
* **file-dialog.ts:** split functions ([36a6619](https://github.com/TomokiMiyauci/file-select-dialog/commit/36a661998a39f21da1397c164da7cd96da2d5ce2)) | ||
## [1.2.1](https://github.com/TomokiMiyauci/file-select-dialog/compare/v1.2.0...v1.2.1) (2020-11-20) | ||
@@ -2,0 +9,0 @@ |
@@ -1,2 +0,2 @@ | ||
var fileDialog=function(e){"use strict";class t extends Error{}class n extends t{}class c extends t{}const l={accept:"*",multiple:!1};return e.fileDialog=e=>{const{accept:t,multiple:s}={...l,...e},r=document.createElement("input");return r.type="file",r.multiple=s,r.accept=Array.isArray(t)?((e,t=",")=>e.join(t))(t):t,new Promise(((e,t)=>{r.onchange=()=>{l(),r.remove()};const l=()=>{const{files:l}=r;l?s?e(l):1===l.length?e(l[0]):t(new c):t(new n)};r.click()}))},Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
var fileDialog=function(e){"use strict";class t extends Error{}class n extends t{}class l extends t{}const c=(e,t=",")=>e.join(t),r={accept:"*",multiple:!1},i=(e,t)=>new Promise(((c,r)=>{if(!e)return r(new n);const i=s(e,t);if(!i)return r(new l);c(i)})),s=(e,t)=>t?e:1===e.length?e[0]:null,u=({accept:e,multiple:t})=>{const n=document.createElement("input");return n.type="file",n.multiple=t,n.accept=e,n};return e.fileDialog=e=>{const{accept:t,multiple:n}={...r,...e},l=u({multiple:n,accept:Array.isArray(t)?c(t):t});return new Promise((e=>{l.onchange=()=>{e(i(l.files,n)),l.remove()},l.click()}))},Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
//# sourceMappingURL=bundle.js.map |
@@ -12,3 +12,6 @@ export interface Parameters<T extends boolean = false> { | ||
export declare const fileDialog: <T extends boolean = false>(parameters?: Partial<Parameters<T>> | undefined) => Promise<PickFile<T>>; | ||
export declare const resolver: <T extends boolean>(fileList: HTMLInputElement['files'], multiple: T) => Promise<PickFile<T>>; | ||
export declare const getFileListObj: <T extends boolean>(files: NonNullable<HTMLInputElement['files']>, multiple: T) => PickFile<T> | null; | ||
export declare const createFileInputElement: ({ accept, multiple }: Pick<HTMLInputElement, 'accept' | 'multiple'>) => HTMLInputElement; | ||
export {}; | ||
//# sourceMappingURL=file-dialog.d.ts.map |
@@ -1,2 +0,2 @@ | ||
class e extends Error{}class t extends e{}class c extends e{}const n={accept:"*",multiple:!1},s=e=>{const{accept:s,multiple:l}={...n,...e},r=document.createElement("input");return r.type="file",r.multiple=l,r.accept=Array.isArray(s)?((e,t=",")=>e.join(t))(s):s,new Promise(((e,n)=>{r.onchange=()=>{s(),r.remove()};const s=()=>{const{files:s}=r;s?l?e(s):1===s.length?e(s[0]):n(new c):n(new t)};r.click()}))};export{s as fileDialog}; | ||
class e extends Error{}class t extends e{}class n extends e{}const c=(e,t=",")=>e.join(t),l={accept:"*",multiple:!1},r=e=>{const{accept:t,multiple:n}={...l,...e},r=p({multiple:n,accept:Array.isArray(t)?c(t):t});return new Promise((e=>{r.onchange=()=>{e(s(r.files,n)),r.remove()},r.click()}))},s=(e,c)=>new Promise(((l,r)=>{if(!e)return r(new t);const s=i(e,c);if(!s)return r(new n);l(s)})),i=(e,t)=>t?e:1===e.length?e[0]:null,p=({accept:e,multiple:t})=>{const n=document.createElement("input");return n.type="file",n.multiple=t,n.accept=e,n};export{r as fileDialog}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "file-select-dialog", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Call file select dialog programmatically", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18057
32