rax-image
Advanced tools
Comparing version 1.1.1 to 1.1.2-0
@@ -10,6 +10,2 @@ "use strict"; | ||
var _dedupe = _interopRequireDefault(require("classnames/dedupe")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
@@ -35,3 +31,2 @@ | ||
var imgRef = (0, _rax.useRef)(null); | ||
var isInitialMount = (0, _rax.useRef)(false); | ||
@@ -78,5 +73,2 @@ | ||
}, [props.source.uri]); | ||
(0, _rax.useImperativeHandle)(ref, function () { | ||
return imgRef.current; | ||
}); | ||
var nativeProps = Object.assign({}, props); // Source must a object | ||
@@ -115,9 +107,9 @@ | ||
var cls = (0, _dedupe.default)('rax-image', className); | ||
var cls = ['rax-image', className].join(' '); | ||
return _universalEnv.isWeex ? (0, _rax.createElement)("image", _extends({ | ||
ref: imgRef, | ||
ref: ref, | ||
className: cls, | ||
style: nativeStyle | ||
}, otherProps)) : (0, _rax.createElement)("img", _extends({ | ||
ref: imgRef, | ||
ref: ref, | ||
className: cls, | ||
@@ -124,0 +116,0 @@ style: nativeStyle |
@@ -10,3 +10,3 @@ import { HTMLAttributes, RefAttributes, CSSProperties, SyntheticEvent } from 'rax'; | ||
*/ | ||
export interface ImageProps extends HTMLAttributes<HTMLImageElement>, RefAttributes<HTMLDivElement> { | ||
export interface ImageProps extends HTMLAttributes<HTMLImageElement>, RefAttributes<HTMLImageElement> { | ||
/** | ||
@@ -13,0 +13,0 @@ * source: set image uri |
{ | ||
"name": "rax-image", | ||
"version": "1.1.1", | ||
"version": "1.1.2-0", | ||
"description": "Image component for Rax.", | ||
@@ -37,3 +37,2 @@ "license": "BSD-3-Clause", | ||
"dependencies": { | ||
"classnames": "^2.2.6", | ||
"universal-env": "^1.0.0" | ||
@@ -47,3 +46,2 @@ }, | ||
"@types/ali-app": "^1.0.0", | ||
"@types/classnames": "^2.2.9", | ||
"@types/jest": "^24.0.12", | ||
@@ -50,0 +48,0 @@ "@typescript-eslint/eslint-plugin": "^1.7.0", |
@@ -1,14 +0,20 @@ | ||
import { HTMLAttributes, RefAttributes, CSSProperties, SyntheticEvent } from 'rax'; | ||
import { | ||
HTMLAttributes, | ||
RefAttributes, | ||
CSSProperties, | ||
SyntheticEvent | ||
} from 'rax'; | ||
export interface Source { | ||
uri?: string; | ||
width?: string|number; | ||
height?: string|number; | ||
width?: string | number; | ||
height?: string | number; | ||
} | ||
/** | ||
* props of components | ||
*/ | ||
export interface ImageProps extends HTMLAttributes<HTMLImageElement>, RefAttributes<HTMLDivElement> { | ||
export interface ImageProps | ||
extends HTMLAttributes<HTMLImageElement>, | ||
RefAttributes<HTMLImageElement> { | ||
/** | ||
@@ -59,4 +65,4 @@ * source: set image uri | ||
export interface ImageLoadEvent extends SyntheticEvent<HTMLImageElement>{ | ||
export interface ImageLoadEvent extends SyntheticEvent<HTMLImageElement> { | ||
success?: string; | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
2
15
550
21379
1
- Removedclassnames@^2.2.6
- Removedclassnames@2.5.1(transitive)