ui-kit-ck-consultant 0.5.216 → 0.5.219

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/dist/index.css CHANGED
@@ -64,6 +64,10 @@
64
64
  border-radius: 15px;
65
65
  }
66
66
 
67
+ ._2YluD._HtAga {
68
+ background-color: transparent !important;
69
+ }
70
+
67
71
  ._2YluD._22C7A {
68
72
  width: 900px;
69
73
  }
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ function _setPrototypeOf(o, p) {
45
45
  return _setPrototypeOf(o, p);
46
46
  }
47
47
 
48
- var style = {"modal":"_Tr9L0","modal_container":"_2YluD","large":"_22C7A","modal_valid":"_RsujT","modal_close":"_1AbTJ","modal_header":"_2EzqX","modal_body":"_1-Y1J","full_modal_container":"_1w6wH","full_modal_header":"_2wSoq","full_modal_body":"_3bfp5","full_modal_body_no_padding":"_Pf5Uh"};
48
+ var style = {"modal":"_Tr9L0","modal_container":"_2YluD","no_background ":"_HtAga","large":"_22C7A","modal_valid":"_RsujT","modal_close":"_1AbTJ","modal_header":"_2EzqX","modal_body":"_1-Y1J","full_modal_container":"_1w6wH","full_modal_header":"_2wSoq","full_modal_body":"_3bfp5","full_modal_body_no_padding":"_Pf5Uh"};
49
49
 
50
50
  var Modal = /*#__PURE__*/function (_React$Component) {
51
51
  _inheritsLoose(Modal, _React$Component);
@@ -78,7 +78,7 @@ var Modal = /*#__PURE__*/function (_React$Component) {
78
78
  return null;
79
79
  }
80
80
 
81
- var modalContainerClass = classNames$1((_classNames = {}, _classNames[style.large] = !!this.props.large, _classNames), style.modal_container, this.props.className);
81
+ var modalContainerClass = classNames$1((_classNames = {}, _classNames[style.large] = !!this.props.large, _classNames[style.no_background] = !!this.props.noBackground, _classNames), style.modal_container, this.props.className);
82
82
  return /*#__PURE__*/React__default.createElement("div", {
83
83
  className: style.modal,
84
84
  onMouseDown: function onMouseDown(e) {
@@ -904,6 +904,9 @@ var Card = /*#__PURE__*/function (_React$Component) {
904
904
 
905
905
  _proto.render = function render() {
906
906
  return /*#__PURE__*/React__default.createElement("div", {
907
+ style: this.props.border ? {
908
+ borderLeft: "solid " + this.props.border + " 16px"
909
+ } : {},
907
910
  className: classNames$1(style$b.card, this.props.className)
908
911
  }, this.props.disabled ? /*#__PURE__*/React__default.createElement("div", {
909
912
  className: classNames$1(style$b.card_disabled)
@@ -3028,6 +3031,56 @@ var DropzoneMultiple = /*#__PURE__*/function (_React$Component) {
3028
3031
 
3029
3032
  _this = _React$Component.call(this, props) || this;
3030
3033
 
3034
+ _this.resizeImage = function (base64, mime, callback) {
3035
+ if (callback === void 0) {
3036
+ callback = function callback() {};
3037
+ }
3038
+
3039
+ if (_this.props.maxImageSize && ['image/png', 'image/jpeg', 'image/jpg'].includes(mime)) {
3040
+ var image = new Image();
3041
+ image.src = base64;
3042
+
3043
+ image.onload = function () {
3044
+ var initialWidth = image.width;
3045
+ var initialHeight = image.height;
3046
+ var finalWidth = 0;
3047
+ var finalHeight = 0;
3048
+
3049
+ if (initialWidth > initialHeight) {
3050
+ if (initialWidth > _this.props.maxImageSize) {
3051
+ finalWidth = _this.props.maxImageSize;
3052
+ finalHeight = finalWidth * initialHeight / initialWidth;
3053
+ } else {
3054
+ finalWidth = initialWidth;
3055
+ finalHeight = initialHeight;
3056
+ }
3057
+ } else {
3058
+ if (initialHeight > _this.props.maxImageSize) {
3059
+ finalHeight = _this.props.maxImageSize;
3060
+ finalWidth = finalHeight * initialWidth / initialHeight;
3061
+ } else {
3062
+ finalWidth = initialWidth;
3063
+ finalHeight = initialHeight;
3064
+ }
3065
+ }
3066
+
3067
+ var canvas = document.createElement('canvas');
3068
+ var ctx = canvas.getContext('2d');
3069
+ canvas.width = finalWidth;
3070
+ canvas.height = finalHeight;
3071
+ ctx.drawImage(image, 0, 0, finalWidth, finalHeight);
3072
+ base64 = canvas.toDataURL(mime, 0.9);
3073
+ callback(base64);
3074
+ };
3075
+
3076
+ image.onerror = function () {
3077
+ callback(base64);
3078
+ };
3079
+ } else {
3080
+ callback(base64);
3081
+ }
3082
+ };
3083
+
3031
3084
  _this.handleDeleteFile = function (idx) {
3032
3085
  var files = _this.state.files;
3033
3086
  files.splice(idx, 1);
@@ -3073,22 +3126,23 @@ var DropzoneMultiple = /*#__PURE__*/function (_React$Component) {
3073
3126
  var reader = new window.FileReader();
3074
3127
 
3075
3128
  reader.onload = function () {
3076
- var base64 = reader.result;
3077
- var tmpFiles = _this.state.files;
3078
- tmpFiles.push({
3079
- base64: base64,
3080
- mime: file.type,
3081
- name: file.name,
3082
- extension: name[name.length - 1],
3083
- size: file.size
3084
- });
3085
-
3086
- _this.setState({
3087
- files: tmpFiles
3088
- }, function () {
3089
- _this.currentFile += 1;
3090
-
3091
- _this.nextFile(files);
3129
+ _this.resizeImage(reader.result, file.type, function (base64) {
3130
+ var tmpFiles = _this.state.files;
3131
+ tmpFiles.push({
3132
+ base64: base64,
3133
+ mime: file.type,
3134
+ name: file.name,
3135
+ extension: name[name.length - 1],
3136
+ size: file.size
3137
+ });
3138
+
3139
+ _this.setState({
3140
+ files: tmpFiles
3141
+ }, function () {
3142
+ _this.currentFile += 1;
3143
+
3144
+ _this.nextFile(files);
3145
+ });
3092
3146
  });
3093
3147
  };
3094
3148