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 +4 -0
- package/dist/index.js +72 -18
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +72 -18
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
@@ -42,7 +42,7 @@ function _setPrototypeOf(o, p) {
|
|
42
42
|
return _setPrototypeOf(o, p);
|
43
43
|
}
|
44
44
|
|
45
|
-
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"};
|
45
|
+
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"};
|
46
46
|
|
47
47
|
var Modal = /*#__PURE__*/function (_React$Component) {
|
48
48
|
_inheritsLoose(Modal, _React$Component);
|
@@ -75,7 +75,7 @@ var Modal = /*#__PURE__*/function (_React$Component) {
|
|
75
75
|
return null;
|
76
76
|
}
|
77
77
|
|
78
|
-
var modalContainerClass = classNames$1((_classNames = {}, _classNames[style.large] = !!this.props.large, _classNames), style.modal_container, this.props.className);
|
78
|
+
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);
|
79
79
|
return /*#__PURE__*/React.createElement("div", {
|
80
80
|
className: style.modal,
|
81
81
|
onMouseDown: function onMouseDown(e) {
|
@@ -901,6 +901,9 @@ var Card = /*#__PURE__*/function (_React$Component) {
|
|
901
901
|
|
902
902
|
_proto.render = function render() {
|
903
903
|
return /*#__PURE__*/React.createElement("div", {
|
904
|
+
style: this.props.border ? {
|
905
|
+
borderLeft: "solid " + this.props.border + " 16px"
|
906
|
+
} : {},
|
904
907
|
className: classNames$1(style$b.card, this.props.className)
|
905
908
|
}, this.props.disabled ? /*#__PURE__*/React.createElement("div", {
|
906
909
|
className: classNames$1(style$b.card_disabled)
|
@@ -3025,6 +3028,56 @@ var DropzoneMultiple = /*#__PURE__*/function (_React$Component) {
|
|
3025
3028
|
|
3026
3029
|
_this = _React$Component.call(this, props) || this;
|
3027
3030
|
|
3031
|
+
_this.resizeImage = function (base64, mime, callback) {
|
3032
|
+
if (callback === void 0) {
|
3033
|
+
callback = function callback() {};
|
3034
|
+
}
|
3035
|
+
|
3036
|
+
if (_this.props.maxImageSize && ['image/png', 'image/jpeg', 'image/jpg'].includes(mime)) {
|
3037
|
+
var image = new Image();
|
3038
|
+
image.src = base64;
|
3039
|
+
|
3040
|
+
image.onload = function () {
|
3041
|
+
var initialWidth = image.width;
|
3042
|
+
var initialHeight = image.height;
|
3043
|
+
var finalWidth = 0;
|
3044
|
+
var finalHeight = 0;
|
3045
|
+
|
3046
|
+
if (initialWidth > initialHeight) {
|
3047
|
+
if (initialWidth > _this.props.maxImageSize) {
|
3048
|
+
finalWidth = _this.props.maxImageSize;
|
3049
|
+
finalHeight = finalWidth * initialHeight / initialWidth;
|
3050
|
+
} else {
|
3051
|
+
finalWidth = initialWidth;
|
3052
|
+
finalHeight = initialHeight;
|
3053
|
+
}
|
3054
|
+
} else {
|
3055
|
+
if (initialHeight > _this.props.maxImageSize) {
|
3056
|
+
finalHeight = _this.props.maxImageSize;
|
3057
|
+
finalWidth = finalHeight * initialWidth / initialHeight;
|
3058
|
+
} else {
|
3059
|
+
finalWidth = initialWidth;
|
3060
|
+
finalHeight = initialHeight;
|
3061
|
+
}
|
3062
|
+
}
|
3063
|
+
|
3064
|
+
var canvas = document.createElement('canvas');
|
3065
|
+
var ctx = canvas.getContext('2d');
|
3066
|
+
canvas.width = finalWidth;
|
3067
|
+
canvas.height = finalHeight;
|
3068
|
+
ctx.drawImage(image, 0, 0, finalWidth, finalHeight);
|
3069
|
+
base64 = canvas.toDataURL(mime, 0.9);
|
3070
|
+
callback(base64);
|
3071
|
+
};
|
3072
|
+
|
3073
|
+
image.onerror = function () {
|
3074
|
+
callback(base64);
|
3075
|
+
};
|
3076
|
+
} else {
|
3077
|
+
callback(base64);
|
3078
|
+
}
|
3079
|
+
};
|
3080
|
+
|
3028
3081
|
_this.handleDeleteFile = function (idx) {
|
3029
3082
|
var files = _this.state.files;
|
3030
3083
|
files.splice(idx, 1);
|
@@ -3070,22 +3123,23 @@ var DropzoneMultiple = /*#__PURE__*/function (_React$Component) {
|
|
3070
3123
|
var reader = new window.FileReader();
|
3071
3124
|
|
3072
3125
|
reader.onload = function () {
|
3073
|
-
|
3074
|
-
|
3075
|
-
|
3076
|
-
|
3077
|
-
|
3078
|
-
|
3079
|
-
|
3080
|
-
|
3081
|
-
|
3082
|
-
|
3083
|
-
|
3084
|
-
|
3085
|
-
|
3086
|
-
|
3087
|
-
|
3088
|
-
|
3126
|
+
_this.resizeImage(reader.result, file.type, function (base64) {
|
3127
|
+
var tmpFiles = _this.state.files;
|
3128
|
+
tmpFiles.push({
|
3129
|
+
base64: base64,
|
3130
|
+
mime: file.type,
|
3131
|
+
name: file.name,
|
3132
|
+
extension: name[name.length - 1],
|
3133
|
+
size: file.size
|
3134
|
+
});
|
3135
|
+
|
3136
|
+
_this.setState({
|
3137
|
+
files: tmpFiles
|
3138
|
+
}, function () {
|
3139
|
+
_this.currentFile += 1;
|
3140
|
+
|
3141
|
+
_this.nextFile(files);
|
3142
|
+
});
|
3089
3143
|
});
|
3090
3144
|
};
|
3091
3145
|
|