Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@collaborne/paper-image-upload-button

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@collaborne/paper-image-upload-button - npm Package Compare versions

Comparing version 4.0.2 to 4.0.3

2

dist/paper-image-upload-button.d.ts

@@ -36,7 +36,5 @@ import { LitElement } from 'lit-element';

protected render(): import("lit-element").TemplateResult;
protected firstUpdated(): void;
protected updated(): void;
private _onFileChange;
private _onTapUpload;
private readonly fileEl;
}

44

dist/paper-image-upload-button.js

@@ -58,3 +58,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

}
:host([canupload]) {
:host([canupload]) label, :host([canupload]) .custom-overlay {
cursor: pointer;

@@ -88,15 +88,19 @@ }

.overlay {
.custom-overlay, .icon {
position: absolute;
top: calc(50% - 12px);
width: 100%;
text-align: center;
opacity: 0;
transition: opacity 0.25s;
}
.icon {
top: calc(50% - 12px);
left: calc(50% - 12px);
color: white;
}
:host([canupload]:hover) .overlay, :host([canupload][noimage]) .overlay, :host([uploading]) .overlay {
.custom-overlay {
top: calc(50% + 12px);
width: 100%;
text-align: center;
}
:host([canupload]:hover) .icon, :host([canupload][noimage]) .icon, :host([uploading]) .icon, :host([canupload]:hover) .custom-overlay, :host([canupload][noimage]) .custom-overlay, :host([uploading]) .custom-overlay {
opacity: 1;

@@ -122,14 +126,15 @@ }

return html `
<div id="image" style="background-image: ${imageUrl}"></div>
<div class="overlay">
<iron-icon class="icon" icon="${icon}" @click="${this._onTapUpload}"></iron-icon><br>
<label for="file" id="image" style="background-image: ${imageUrl}"></label>
<label for="file" class="icon"><iron-icon icon="${icon}"></iron-icon></label>
<div class="custom-overlay">
<slot></slot>
</div>
<input id="file" type="file" accept="image/*" hidden @change="${this._onFileChange}">`;
<input
id="file"
type="file"
accept="image/*"
hidden
@change="${this._onFileChange}"
.disabled="${!this.canUpload}">`;
}
firstUpdated() {
// TODO: How to declare event listener declarative on <div>
const image = this.shadowRoot.getElementById('image');
image.addEventListener('click', this._onTapUpload.bind(this));
}
updated() {

@@ -162,9 +167,2 @@ this.canUpload = !this.disabled && !this.uploading;

}
_onTapUpload() {
if (!this.canUpload) {
return;
}
// Trigger file upload
this.fileEl.click();
}
get fileEl() {

@@ -171,0 +169,0 @@ return this.shadowRoot.getElementById('file');

@@ -15,3 +15,3 @@ {

"name": "@collaborne/paper-image-upload-button",
"version": "4.0.2",
"version": "4.0.3",
"main": "dist/paper-image-upload-button.js",

@@ -18,0 +18,0 @@ "types": "dist/paper-image-upload-button.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc