@goldenpine/react-form-builder2 0.20.3-build.19 → 0.20.3-build.20

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.
@@ -803,7 +803,10 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
803
803
  // so adjust it "contain" to make it bigger if possible.
804
804
  // "contain" is supposed to "Preserves the aspect ratio, and fits the image inside the container, without cutting"
805
805
  objectFit: 'contain',
806
- objectPosition: this.props.data.center ? 'center' : 'left'
806
+ objectPosition: this.props.data.center ? 'center' : 'left',
807
+ // Move width and height from element style to inline style of image, to make it work the same way as 'Image' element.
808
+ width: this.props.data.width,
809
+ height: this.props.data.height
807
810
  };
808
811
  var baseClasses = 'SortableItem rfb-item';
809
812
  var name = this.props.data.field_name;
@@ -826,18 +829,20 @@ var Camera = /*#__PURE__*/function (_React$Component17) {
826
829
  className: baseClasses
827
830
  }, /*#__PURE__*/_react["default"].createElement(_componentHeader["default"], this.props), /*#__PURE__*/_react["default"].createElement("div", {
828
831
  className: "mb-3"
829
- }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.read_only === true && this.props.defaultValue && this.props.defaultValue.length > 0 ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", (0, _extends2["default"])({
832
+ }, /*#__PURE__*/_react["default"].createElement(_componentLabel["default"], this.props), this.props.read_only === true && this.props.defaultValue && this.props.defaultValue.length > 0 ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("img", {
830
833
  style: imageStyle,
831
834
  src: sourceDataURL
832
- }, this.getImageSizeProps(this.props.data)))) : /*#__PURE__*/_react["default"].createElement("div", {
835
+ // {...this.getImageSizeProps(this.props.data)} // move width and height from element style to inline style of image, to make it work the same way as 'Image' element.
836
+ })) : /*#__PURE__*/_react["default"].createElement("div", {
833
837
  className: "image-upload-container"
834
838
  }, /*#__PURE__*/_react["default"].createElement("div", {
835
839
  style: fileInputStyle
836
840
  }, /*#__PURE__*/_react["default"].createElement("input", {
837
841
  name: name,
838
842
  type: "file",
839
- accept: "image/*",
840
- capture: "camera",
843
+ accept: "image/*"
844
+ //capture="camera" // With this property, users on most mobiles can only take photo but no options to pick up a photo from gallery
845
+ ,
841
846
  className: "image-upload visually-hidden",
842
847
  onChange: this.displayImage,
843
848
  "data-clearlabel": this.props.data.label_after_photo_clear_icon,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goldenpine/react-form-builder2",
3
- "version": "0.20.3-build.19",
3
+ "version": "0.20.3-build.20",
4
4
  "description": "A complete form builder for react.",
5
5
  "main": "lib/index.js",
6
6
  "types": "types/index.d.ts",