(label: string, formName: string, {initState = false, required = false} = {})
| 2194 | label: string, |
| 2195 | formName: string, |
| 2196 | {required = false, files = "one", clear = false, initImg = "", width = -1, objectFit = ""} = {}, |
| 2197 | ) { |
| 2198 | const FI = this.options.addImageInput(label, (_) => {}, {clear, initImg, width, objectFit}); |
| 2199 | if (files !== "one" && files !== "multi") throw new Error("files should equal one or multi"); |
| 2200 | this.fileOptions.set(FI, {files}); |
| 2201 | this.names.set(formName, FI); |
| 2202 | if (required) { |
| 2203 | this.required.add(FI); |
| 2204 | } |
| 2205 | return FI; |
| 2206 | } |
no test coverage detected