@collaborne/paper-image-upload-button
Advanced tools
Comparing version 3.0.0 to 3.0.2
@@ -15,16 +15,21 @@ { | ||
"name": "@collaborne/paper-image-upload-button", | ||
"version": "3.0.0", | ||
"resolutions": { | ||
"inherits": "2.0.3", | ||
"samsam": "1.1.3", | ||
"supports-color": "3.1.2", | ||
"type-detect": "1.0.0" | ||
}, | ||
"version": "3.0.2", | ||
"main": "paper-image-upload-button.js", | ||
"author": "collaborne", | ||
"author": "Collaborne B.V.", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/Collaborne/paper-image-upload-button/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Collaborne/paper-image-upload-button.git" | ||
}, | ||
"scripts": { | ||
"lint": "eslint . && polymer lint", | ||
"test": "npm run lint && echo 'No tests yet'" | ||
}, | ||
"dependencies": { | ||
"@polymer/polymer": "^3.0.0", | ||
"@polymer/iron-icon": "^3.0.0", | ||
"@polymer/iron-icons": "^3.0.0" | ||
"@polymer/iron-icons": "^3.0.0", | ||
"@polymer/polymer": "^3.0.0" | ||
}, | ||
@@ -34,4 +39,6 @@ "devDependencies": { | ||
"@polymer/paper-checkbox": "^3.0.0", | ||
"@webcomponents/webcomponentsjs": "^2.0.0" | ||
"eslint": "^5.12.1", | ||
"eslint-config-collaborne": "^1.5.0", | ||
"polymer-cli": "^1.9.5" | ||
} | ||
} |
@@ -1,3 +0,3 @@ | ||
import { PolymerElement, html } from '@polymer/polymer/polymer-element.js'; | ||
import { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event-listeners.js'; | ||
import {PolymerElement, html} from '@polymer/polymer/polymer-element.js'; | ||
import {GestureEventListeners} from '@polymer/polymer/lib/mixins/gesture-event-listeners.js'; | ||
import '@polymer/iron-icon'; | ||
@@ -46,2 +46,3 @@ import '@polymer/iron-icons'; | ||
} | ||
:host([can-upload]:hover) #image, :host([uploading]) #image { | ||
@@ -94,22 +95,10 @@ filter: brightness(40%); | ||
return { | ||
/** | ||
* URL to the currently shown image | ||
*/ | ||
image: String, | ||
/** | ||
* Icon that is shown during hover | ||
* Set to true if users should be allowed to upload images | ||
*/ | ||
icon: { | ||
type: String, | ||
value: 'icons:file-upload' | ||
}, | ||
/** | ||
* True if the image is currently uploading | ||
*/ | ||
uploading: { | ||
canUpload: { | ||
computed: '_computeCanUpload(disabled, uploading)', | ||
reflectToAttribute: true, | ||
type: Boolean, | ||
value: false, | ||
reflectToAttribute: true, | ||
}, | ||
@@ -126,18 +115,31 @@ | ||
/** | ||
* Set to true if users should be allowed to upload images | ||
* Icon that is shown during hover | ||
*/ | ||
canUpload: { | ||
type: Boolean, | ||
computed: '_computeCanUpload(disabled, uploading)', | ||
reflectToAttribute: true, | ||
icon: { | ||
type: String, | ||
value: 'icons:file-upload' | ||
}, | ||
/** | ||
* URL to the currently shown image | ||
*/ | ||
image: String, | ||
/** | ||
* True if no image is configured | ||
*/ | ||
noImage: { | ||
computed: '_computeNoImage(image)', | ||
reflectToAttribute: true, | ||
type: Boolean, | ||
value: true, | ||
computed: '_computeNoImage(image)', | ||
}, | ||
/** | ||
* True if the image is currently uploading | ||
*/ | ||
uploading: { | ||
reflectToAttribute: true, | ||
type: Boolean, | ||
value: false, | ||
}, | ||
@@ -156,3 +158,3 @@ }; | ||
this.$.file.addEventListener('change', e => { | ||
this.$.file.addEventListener('change', () => { | ||
const files = this.$.file.files; | ||
@@ -164,2 +166,4 @@ if (files.length > 0) { | ||
this.dispatchEvent(new CustomEvent('upload-image', { | ||
bubbles: true, | ||
composed: true, | ||
detail: { | ||
@@ -170,6 +174,4 @@ file, | ||
}, | ||
bubbles: true, | ||
composed: true, | ||
})); | ||
} | ||
}; | ||
img.src = window.URL.createObjectURL(file); | ||
@@ -176,0 +178,0 @@ } |
@@ -7,4 +7,5 @@ { | ||
"polymer-3" | ||
] | ||
], | ||
"ignoreWarnings": ["could-not-resolve-reference"] | ||
} | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# \<paper-image-upload-button\> [![Bower version](https://badge.fury.io/bo/paper-image-upload-button.svg)](http://badge.fury.io/bo/paper-image-upload-button) [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/Collaborne/paper-image-upload-button) | ||
# \<paper-image-upload-button\> [![Build Status](https://travis-ci.org/Collaborne/paper-image-upload-but.svg?branch=master)](https://travis-ci.org/Collaborne/paper-image-upload-but) [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/Collaborne/paper-image-upload-button) | ||
@@ -9,12 +9,2 @@ Material Design upload button that previews the image (Polymer) | ||
<!-- | ||
``` | ||
<custom-element-demo> | ||
<template> | ||
<link rel="import" href="paper-image-upload-button.html"> | ||
<next-code-block></next-code-block> | ||
</template> | ||
</custom-element-demo> | ||
``` | ||
--> | ||
```html | ||
@@ -21,0 +11,0 @@ <paper-image-upload-button |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
24368
1
0
5
206
1
32
1