@fonixtree/magic-design 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -201,6 +201,12 @@ function (_super) {
201
201
  return _this;
202
202
  }
203
203
 
204
+ ImagePicker.prototype.componentDidMount = function () {
205
+ this.setState({
206
+ inputVal: this.props.value
207
+ });
208
+ };
209
+
204
210
  ImagePicker.prototype.componentWillReceiveProps = function (nextProps) {
205
211
  if (nextProps.value != this.props.value) {
206
212
  this.setState({
@@ -0,0 +1,4 @@
1
+ .m-button-config {
2
+ padding: 0 12px;
3
+ background-color: #F5F6F7;
4
+ }
@@ -459,7 +459,7 @@ var getColorRgba = function getColorRgba(sHex, alpha) {
459
459
  exports.getColorRgba = getColorRgba;
460
460
 
461
461
  function asyncDataURLtoImage(dataUrl) {
462
- return new Promise(function (resolve, reject) {
462
+ return new Promise(function (resolve) {
463
463
  var img = new Image();
464
464
 
465
465
  img.onload = function () {
@@ -467,7 +467,8 @@ function asyncDataURLtoImage(dataUrl) {
467
467
  };
468
468
 
469
469
  img.onerror = function () {
470
- reject(new Error('img error'));
470
+ console.error(dataUrl + ' img error');
471
+ resolve({});
471
472
  };
472
473
 
473
474
  img.src = dataUrl;
@@ -201,6 +201,12 @@ function (_super) {
201
201
  return _this;
202
202
  }
203
203
 
204
+ ImagePicker.prototype.componentDidMount = function () {
205
+ this.setState({
206
+ inputVal: this.props.value
207
+ });
208
+ };
209
+
204
210
  ImagePicker.prototype.componentWillReceiveProps = function (nextProps) {
205
211
  if (nextProps.value != this.props.value) {
206
212
  this.setState({
@@ -0,0 +1,4 @@
1
+ .m-button-config {
2
+ padding: 0 12px;
3
+ background-color: #F5F6F7;
4
+ }
@@ -459,7 +459,7 @@ var getColorRgba = function getColorRgba(sHex, alpha) {
459
459
  exports.getColorRgba = getColorRgba;
460
460
 
461
461
  function asyncDataURLtoImage(dataUrl) {
462
- return new Promise(function (resolve, reject) {
462
+ return new Promise(function (resolve) {
463
463
  var img = new Image();
464
464
 
465
465
  img.onload = function () {
@@ -467,7 +467,8 @@ function asyncDataURLtoImage(dataUrl) {
467
467
  };
468
468
 
469
469
  img.onerror = function () {
470
- reject(new Error('img error'));
470
+ console.error(dataUrl + ' img error');
471
+ resolve({});
471
472
  };
472
473
 
473
474
  img.src = dataUrl;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "1.0.3",
4
+ "version": "1.0.4",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",