@fonixtree/magic-design 1.0.2 → 1.0.3
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.
- package/es/assets/fonts/.DS_Store +0 -0
- package/es/common/ImagePicker/index.js +21 -8
- package/es/composite-comp/bol/components/Banner/pc/index.js +4 -3
- package/es/meta-comp/config-panels/ImageConfig/index.js +1 -1
- package/lib/assets/fonts/.DS_Store +0 -0
- package/lib/common/ImagePicker/index.js +21 -8
- package/lib/composite-comp/bol/components/Banner/pc/index.js +4 -3
- package/lib/meta-comp/config-panels/ImageConfig/index.js +1 -1
- package/package.json +1 -1
|
Binary file
|
|
@@ -66,7 +66,8 @@ function (_super) {
|
|
|
66
66
|
|
|
67
67
|
_this.state = {
|
|
68
68
|
visible: false,
|
|
69
|
-
imageWay: 'upload'
|
|
69
|
+
imageWay: 'upload',
|
|
70
|
+
inputVal: ''
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
_this.onChange = function (v) {
|
|
@@ -161,30 +162,34 @@ function (_super) {
|
|
|
161
162
|
};
|
|
162
163
|
|
|
163
164
|
_this.getImageUrl = function () {
|
|
164
|
-
var
|
|
165
|
-
|
|
166
|
-
value = _a.value;
|
|
165
|
+
var onChange = _this.props.onChange;
|
|
166
|
+
var inputVal = _this.state.inputVal;
|
|
167
167
|
return /*#__PURE__*/_react["default"].createElement(_.Field, {
|
|
168
168
|
title: (0, _locale.i18n)('IMAGE_URL')
|
|
169
169
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
170
170
|
className: "input-url"
|
|
171
171
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
172
|
+
onBlur: function onBlur() {
|
|
173
|
+
onChange({
|
|
174
|
+
url: inputVal
|
|
175
|
+
});
|
|
176
|
+
},
|
|
172
177
|
onChange: function onChange(e) {
|
|
173
|
-
|
|
174
|
-
|
|
178
|
+
_this.setState({
|
|
179
|
+
inputVal: e.target.value
|
|
175
180
|
});
|
|
176
181
|
|
|
177
182
|
console.log('---d', e.target.value);
|
|
178
183
|
},
|
|
179
184
|
placeholder: (0, _locale.i18n)('PLEASE_ADD_A_LINK'),
|
|
180
185
|
type: "text",
|
|
181
|
-
value:
|
|
186
|
+
value: inputVal
|
|
182
187
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
183
188
|
className: "icon-btns"
|
|
184
189
|
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
185
190
|
color: "#FF4141",
|
|
186
191
|
onClick: function onClick() {
|
|
187
|
-
return
|
|
192
|
+
return onChange({
|
|
188
193
|
url: ''
|
|
189
194
|
});
|
|
190
195
|
},
|
|
@@ -196,6 +201,14 @@ function (_super) {
|
|
|
196
201
|
return _this;
|
|
197
202
|
}
|
|
198
203
|
|
|
204
|
+
ImagePicker.prototype.componentWillReceiveProps = function (nextProps) {
|
|
205
|
+
if (nextProps.value != this.props.value) {
|
|
206
|
+
this.setState({
|
|
207
|
+
inputVal: nextProps.value
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
|
|
199
212
|
ImagePicker.prototype.render = function () {
|
|
200
213
|
var _this = this;
|
|
201
214
|
|
|
@@ -176,13 +176,14 @@ function (_super) {
|
|
|
176
176
|
textAlign: item.customize.align
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
-
if (item.customize.vertical === '
|
|
180
|
-
styleObj.top = 30;
|
|
181
|
-
} else if (item.customize.vertical === 'bottom') {
|
|
179
|
+
if (item.customize.vertical === 'bottom') {
|
|
182
180
|
styleObj.bottom = 30;
|
|
183
181
|
} else if (item.customize.vertical === 'center') {
|
|
184
182
|
styleObj.top = '50%';
|
|
185
183
|
styleObj.transform = 'translateY(-50%)';
|
|
184
|
+
} else {
|
|
185
|
+
// item.customize.vertical === 'top'
|
|
186
|
+
styleObj.top = 30;
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
return styleObj;
|
|
Binary file
|
|
@@ -66,7 +66,8 @@ function (_super) {
|
|
|
66
66
|
|
|
67
67
|
_this.state = {
|
|
68
68
|
visible: false,
|
|
69
|
-
imageWay: 'upload'
|
|
69
|
+
imageWay: 'upload',
|
|
70
|
+
inputVal: ''
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
_this.onChange = function (v) {
|
|
@@ -161,30 +162,34 @@ function (_super) {
|
|
|
161
162
|
};
|
|
162
163
|
|
|
163
164
|
_this.getImageUrl = function () {
|
|
164
|
-
var
|
|
165
|
-
|
|
166
|
-
value = _a.value;
|
|
165
|
+
var onChange = _this.props.onChange;
|
|
166
|
+
var inputVal = _this.state.inputVal;
|
|
167
167
|
return /*#__PURE__*/_react["default"].createElement(_.Field, {
|
|
168
168
|
title: (0, _locale.i18n)('IMAGE_URL')
|
|
169
169
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
170
170
|
className: "input-url"
|
|
171
171
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
172
|
+
onBlur: function onBlur() {
|
|
173
|
+
onChange({
|
|
174
|
+
url: inputVal
|
|
175
|
+
});
|
|
176
|
+
},
|
|
172
177
|
onChange: function onChange(e) {
|
|
173
|
-
|
|
174
|
-
|
|
178
|
+
_this.setState({
|
|
179
|
+
inputVal: e.target.value
|
|
175
180
|
});
|
|
176
181
|
|
|
177
182
|
console.log('---d', e.target.value);
|
|
178
183
|
},
|
|
179
184
|
placeholder: (0, _locale.i18n)('PLEASE_ADD_A_LINK'),
|
|
180
185
|
type: "text",
|
|
181
|
-
value:
|
|
186
|
+
value: inputVal
|
|
182
187
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
183
188
|
className: "icon-btns"
|
|
184
189
|
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
185
190
|
color: "#FF4141",
|
|
186
191
|
onClick: function onClick() {
|
|
187
|
-
return
|
|
192
|
+
return onChange({
|
|
188
193
|
url: ''
|
|
189
194
|
});
|
|
190
195
|
},
|
|
@@ -196,6 +201,14 @@ function (_super) {
|
|
|
196
201
|
return _this;
|
|
197
202
|
}
|
|
198
203
|
|
|
204
|
+
ImagePicker.prototype.componentWillReceiveProps = function (nextProps) {
|
|
205
|
+
if (nextProps.value != this.props.value) {
|
|
206
|
+
this.setState({
|
|
207
|
+
inputVal: nextProps.value
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
|
|
199
212
|
ImagePicker.prototype.render = function () {
|
|
200
213
|
var _this = this;
|
|
201
214
|
|
|
@@ -176,13 +176,14 @@ function (_super) {
|
|
|
176
176
|
textAlign: item.customize.align
|
|
177
177
|
};
|
|
178
178
|
|
|
179
|
-
if (item.customize.vertical === '
|
|
180
|
-
styleObj.top = 30;
|
|
181
|
-
} else if (item.customize.vertical === 'bottom') {
|
|
179
|
+
if (item.customize.vertical === 'bottom') {
|
|
182
180
|
styleObj.bottom = 30;
|
|
183
181
|
} else if (item.customize.vertical === 'center') {
|
|
184
182
|
styleObj.top = '50%';
|
|
185
183
|
styleObj.transform = 'translateY(-50%)';
|
|
184
|
+
} else {
|
|
185
|
+
// item.customize.vertical === 'top'
|
|
186
|
+
styleObj.top = 30;
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
return styleObj;
|