@commonsku/styles 1.15.1 → 1.16.0
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.d.ts +558 -32
- package/dist/index.es.js +31 -60
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +32 -67
- package/dist/index.js.map +1 -1
- package/dist/styles/Artwork.d.ts +1 -0
- package/dist/styles/Artwork.d.ts.map +1 -1
- package/dist/styles/Img.d.ts.map +1 -1
- package/dist/styles/Input.d.ts +9 -9
- package/dist/styles/Input.d.ts.map +1 -1
- package/dist/styles/MultiProgress.d.ts +1 -1
- package/dist/styles/Select.d.ts +548 -30
- package/dist/styles/Select.d.ts.map +1 -1
- package/dist/styles/icons/CheckboxIcon.d.ts +3 -1
- package/dist/styles/icons/CheckboxIcon.d.ts.map +1 -1
- package/package.json +9 -17
package/dist/index.js
CHANGED
|
@@ -13,8 +13,7 @@ var React__default = _interopDefault(React);
|
|
|
13
13
|
var reactDropzone = require('react-dropzone');
|
|
14
14
|
var BaseSelect = require('react-select');
|
|
15
15
|
var BaseSelect__default = _interopDefault(BaseSelect);
|
|
16
|
-
var BaseCreatableSelect = require('react-select/creatable');
|
|
17
|
-
var BaseCreatableSelect__default = _interopDefault(BaseCreatableSelect);
|
|
16
|
+
var BaseCreatableSelect = _interopDefault(require('react-select/creatable'));
|
|
18
17
|
var BaseAsyncSelect = _interopDefault(require('react-select/async'));
|
|
19
18
|
var reactBeautifulDnd = require('react-beautiful-dnd');
|
|
20
19
|
var ReactDOM = _interopDefault(require('react-dom'));
|
|
@@ -2107,27 +2106,26 @@ function RadioIcon(_a) {
|
|
|
2107
2106
|
|
|
2108
2107
|
function CheckboxIcon(_a) {
|
|
2109
2108
|
var _b = _a.color, color = _b === void 0 ? teal.main : _b, _c = _a.hoverColor, hoverColor = _c === void 0 ? teal.light : _c, _d = _a.disabledColor, disabledColor = _d === void 0 ? neutrals['60'] : _d, _e = _a.size, size = _e === void 0 ? "medium" : _e, _f = _a.hover, hover = _f === void 0 ? false : _f, _g = _a.selected, selected = _g === void 0 ? false : _g, _h = _a.disabled, disabled = _h === void 0 ? false : _h, _j = _a.indeterminate, indeterminate = _j === void 0 ? false : _j, _k = _a.altText, altText = _k === void 0 ? "Select" : _k, props = __rest(_a, ["color", "hoverColor", "disabledColor", "size", "hover", "selected", "disabled", "indeterminate", "altText"]);
|
|
2110
|
-
selected ? altText = "Unselect" : altText = "Select";
|
|
2111
|
-
var renderPath = React__default.useMemo(function () {
|
|
2112
|
-
if (indeterminate) {
|
|
2113
|
-
return React__default.createElement("path", { d: "M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM16 13H8C7.45 13 7 12.55 7 12C7 11.45 7.45 11 8 11H16C16.55 11 17 11.45 17 12C17 12.55 16.55 13 16 13Z", fill: disabled ? disabledColor : color });
|
|
2114
|
-
}
|
|
2115
|
-
else if (selected) {
|
|
2116
|
-
return React__default.createElement("path", { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm-8.29 13.29a.996.996 0 0 1-1.41 0L5.71 12.7a.996.996 0 1 1 1.41-1.41L10 14.17l6.88-6.88a.996.996 0 1 1 1.41 1.41l-7.58 7.59Z", fill: disabled ? disabledColor : color });
|
|
2117
|
-
}
|
|
2118
|
-
else if (hover === true && !disabled) {
|
|
2119
|
-
return React__default.createElement(React__default.Fragment, null,
|
|
2120
|
-
React__default.createElement("path", { d: "M18 19H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1Zm1-16H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Z", fill: color }),
|
|
2121
|
-
React__default.createElement("rect", { x: 6, y: 6, width: 12, height: 12, rx: 1, fill: hoverColor }));
|
|
2122
|
-
}
|
|
2123
|
-
// default to unselected
|
|
2124
|
-
return React__default.createElement("path", { d: "M18 19H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1Zm1-16H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Z", fill: disabled ? disabledColor : color });
|
|
2125
|
-
}, [selected, hover, hoverColor, disabled, disabledColor, color]);
|
|
2126
2109
|
return React__default.createElement(SVG, __assign({ size: size, "aria-labelledby": "CheckboxIcon" }, props),
|
|
2127
|
-
React__default.createElement("title", { id: "CheckboxIcon" }, altText),
|
|
2110
|
+
React__default.createElement("title", { id: "CheckboxIcon" }, selected && (altText === "Select" || !altText) ? "Unselect" : altText),
|
|
2128
2111
|
React__default.createElement("path", { fill: "none", d: "M0 0h24v24H0z" }),
|
|
2129
|
-
|
|
2130
|
-
}
|
|
2112
|
+
React__default.createElement(IconPath, { indeterminate: indeterminate, selected: selected, hover: hover, disabled: disabled, color: color, hoverColor: hoverColor, disabledColor: disabledColor }));
|
|
2113
|
+
}
|
|
2114
|
+
var IconPath = React__default.memo(function (props) {
|
|
2115
|
+
var indeterminate = props.indeterminate, selected = props.selected, hover = props.hover, disabled = props.disabled, color = props.color, hoverColor = props.hoverColor, disabledColor = props.disabledColor;
|
|
2116
|
+
if (indeterminate) {
|
|
2117
|
+
return React__default.createElement("path", { d: "M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM16 13H8C7.45 13 7 12.55 7 12C7 11.45 7.45 11 8 11H16C16.55 11 17 11.45 17 12C17 12.55 16.55 13 16 13Z", fill: disabled ? disabledColor : color });
|
|
2118
|
+
}
|
|
2119
|
+
else if (selected) {
|
|
2120
|
+
return React__default.createElement("path", { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm-8.29 13.29a.996.996 0 0 1-1.41 0L5.71 12.7a.996.996 0 1 1 1.41-1.41L10 14.17l6.88-6.88a.996.996 0 1 1 1.41 1.41l-7.58 7.59Z", fill: disabled ? disabledColor : color });
|
|
2121
|
+
}
|
|
2122
|
+
else if (hover === true && !disabled) {
|
|
2123
|
+
return React__default.createElement(React__default.Fragment, null,
|
|
2124
|
+
React__default.createElement("path", { d: "M18 19H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1Zm1-16H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Z", fill: color }),
|
|
2125
|
+
React__default.createElement("rect", { x: 6, y: 6, width: 12, height: 12, rx: 1, fill: hoverColor }));
|
|
2126
|
+
}
|
|
2127
|
+
return React__default.createElement("path", { d: "M18 19H6c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h12c.55 0 1 .45 1 1v12c0 .55-.45 1-1 1Zm1-16H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Z", fill: disabled ? disabledColor : color });
|
|
2128
|
+
});
|
|
2131
2129
|
|
|
2132
2130
|
function EditIcon(_a) {
|
|
2133
2131
|
var _b = _a.color, color = _b === void 0 ? teal.main : _b, _c = _a.size, size = _c === void 0 ? "medium" : _c, _d = _a.filled, filled = _d === void 0 ? false : _d, _e = _a.altText, altText = _e === void 0 ? "Edit" : _e, props = __rest(_a, ["color", "size", "filled", "altText"]);
|
|
@@ -3060,8 +3058,8 @@ var LabeledRadioInButtonGroup = function (_a) {
|
|
|
3060
3058
|
}));
|
|
3061
3059
|
};
|
|
3062
3060
|
var LabeledCheckbox = React__default.forwardRef(function (_a, ref) {
|
|
3063
|
-
var label = _a.label, name = _a.name, checked = _a.checked, disabled = _a.disabled,
|
|
3064
|
-
var
|
|
3061
|
+
var label = _a.label, name = _a.name, checked = _a.checked, disabled = _a.disabled, onChange = _a.onChange, checkboxColor = _a.checkboxColor, checkboxHoverColor = _a.checkboxHoverColor, _b = _a.hoverByLabel, hoverByLabel = _b === void 0 ? true : _b, _c = _a.stopPropagation, _d = _a.indeterminate, indeterminate = _d === void 0 ? false : _d, _e = _a.labelStyle, labelStyle = _e === void 0 ? {} : _e, _f = _a.checkboxStyle, checkboxStyle = _f === void 0 ? {} : _f, _g = _a.labelProps, labelProps = _g === void 0 ? {} : _g, _h = _a.checkboxIconProps, checkboxIconProps = _h === void 0 ? {} : _h, props = __rest(_a, ["label", "name", "checked", "disabled", "onChange", "checkboxColor", "checkboxHoverColor", "hoverByLabel", "stopPropagation", "indeterminate", "labelStyle", "checkboxStyle", "labelProps", "checkboxIconProps"]);
|
|
3062
|
+
var _j = React.useState(false), isHovering = _j[0], updateHover = _j[1];
|
|
3065
3063
|
var onMouseOver = function (e) { return updateHover(true); };
|
|
3066
3064
|
var onMouseLeave = function (e) { return updateHover(false); };
|
|
3067
3065
|
return (React__default.createElement(CheckboxLabel, __assign({ htmlFor: name, onMouseOver: hoverByLabel ? onMouseOver : undefined, onMouseLeave: hoverByLabel ? onMouseLeave : undefined, disabled: disabled }, labelProps, { style: labelStyle }),
|
|
@@ -3157,11 +3155,7 @@ function skuSelectStyles(props) {
|
|
|
3157
3155
|
},
|
|
3158
3156
|
indicatorSeparator: function (provided, state) { return (__assign(__assign({}, provided), { display: 'none' })); },
|
|
3159
3157
|
option: function (provided, state) {
|
|
3160
|
-
|
|
3161
|
-
if (state.data && state.data.styles) {
|
|
3162
|
-
optionStyle = state.data.styles;
|
|
3163
|
-
}
|
|
3164
|
-
return (__assign(__assign(__assign({}, provided), optionStyle), { borderBottom: 'none', padding: 10 }));
|
|
3158
|
+
return (__assign(__assign(__assign({}, provided), (_.get(state.data, 'styles') || {})), { borderBottom: 'none', padding: 10 }));
|
|
3165
3159
|
},
|
|
3166
3160
|
input: function (provided, state) {
|
|
3167
3161
|
return __assign(__assign({}, provided), { height: 'auto', borderColor: props.error
|
|
@@ -3259,11 +3253,13 @@ function skuSelectStyles(props) {
|
|
|
3259
3253
|
}
|
|
3260
3254
|
var skuSelectTheme = function (theme) { return (__assign(__assign({}, theme), { borderRadius: 5, colors: __assign(__assign({}, theme.colors), { primary25: colors.primary0, primary75: colors.primary0, primary50: colors.primary10, primary: colors.primary, neutral20: colors.select.border, neutral30: colors.select.border, neutral80: colors.textbody, neutral90: colors.textbody }) })); };
|
|
3261
3255
|
// duplicate styles to overide .resku global styles
|
|
3256
|
+
// : React.ForwardRefExoticComponent<SKUSelectProps & React.RefAttributes<BaseSelect>>
|
|
3257
|
+
// React.ForwardRefExoticComponent<AdditionalSKUSelectProps & Omit<Pick<Props<unknown, boolean, GroupBase<unknown>>, "aria-errormessage" | "aria-invalid" | "aria-label" | ... 27 more ... | "form"> & InexactPartial<...> & InexactPartial<...>, StateManagedPropKeys> & Partial<...> & StateManagerAdditionalProps<...> & React.RefAttributes<...>>
|
|
3262
3258
|
var SKUSelect = React__default.forwardRef(function (_a, ref) {
|
|
3263
3259
|
var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error"]);
|
|
3264
3260
|
var classNamePrefix = "".concat(error ? 'select-error' : '', " commonsku-styles-select");
|
|
3265
3261
|
var selectStyleProps = __assign(__assign({}, props), { noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
|
|
3266
|
-
return React__default.createElement(BaseSelect__default, __assign({ ref: ref, classNamePrefix: classNamePrefix }, (inPopup ? popupStyles : {}), {
|
|
3262
|
+
return React__default.createElement(BaseSelect__default, __assign({ ref: ref, classNamePrefix: classNamePrefix }, (inPopup ? popupStyles : {}), { styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props));
|
|
3267
3263
|
});
|
|
3268
3264
|
var LabeledSelect = React__default.forwardRef(function (_a, ref) {
|
|
3269
3265
|
var parentStyle = _a.parentStyle, props = __rest(_a, ["parentStyle"]);
|
|
@@ -3278,7 +3274,7 @@ var SKUCreatableSelect = React__default.forwardRef(function (_a, ref) {
|
|
|
3278
3274
|
var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error"]);
|
|
3279
3275
|
var classNamePrefix = "".concat(error ? 'select-error' : '', " commonsku-styles-select");
|
|
3280
3276
|
var selectStyleProps = __assign(__assign({}, props), { noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
|
|
3281
|
-
return (React__default.createElement(
|
|
3277
|
+
return (React__default.createElement(BaseCreatableSelect, __assign({ ref: ref, classNamePrefix: classNamePrefix, styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props, (inPopup ? popupStyles : {}))));
|
|
3282
3278
|
});
|
|
3283
3279
|
var LabeledCreatableSelect = React__default.forwardRef(function (_a, ref) {
|
|
3284
3280
|
var parentStyle = _a.parentStyle, props = __rest(_a, ["parentStyle"]);
|
|
@@ -3293,7 +3289,7 @@ var SKUAsyncSelect = React__default.forwardRef(function (_a, ref) {
|
|
|
3293
3289
|
var noMargin = _a.noMargin, menuRelative = _a.menuRelative, inPopup = _a.inPopup, error = _a.error, props = __rest(_a, ["noMargin", "menuRelative", "inPopup", "error"]);
|
|
3294
3290
|
var classNamePrefix = "".concat(error ? 'select-error' : '', " commonsku-styles-select");
|
|
3295
3291
|
var selectStyleProps = __assign(__assign({}, props), { noMargin: noMargin, menuRelative: menuRelative, inPopup: inPopup, error: error, classNamePrefix: classNamePrefix, theme: skuSelectTheme });
|
|
3296
|
-
return (React__default.createElement(BaseAsyncSelect, __assign({ ref: ref, classNamePrefix: classNamePrefix,
|
|
3292
|
+
return (React__default.createElement(BaseAsyncSelect, __assign({ ref: ref, classNamePrefix: classNamePrefix, styles: skuSelectStyles(selectStyleProps), theme: skuSelectTheme }, props, (inPopup ? popupStyles : {}))));
|
|
3297
3293
|
});
|
|
3298
3294
|
var LabeledAsyncSelect = React__default.forwardRef(function (_a, ref) {
|
|
3299
3295
|
var parentStyle = _a.parentStyle, props = __rest(_a, ["parentStyle"]);
|
|
@@ -3933,23 +3929,19 @@ function _defineProperty(obj, key, value) {
|
|
|
3933
3929
|
} else {
|
|
3934
3930
|
obj[key] = value;
|
|
3935
3931
|
}
|
|
3936
|
-
|
|
3937
3932
|
return obj;
|
|
3938
3933
|
}
|
|
3939
3934
|
|
|
3940
3935
|
function ownKeys(object, enumerableOnly) {
|
|
3941
3936
|
var keys = Object.keys(object);
|
|
3942
|
-
|
|
3943
3937
|
if (Object.getOwnPropertySymbols) {
|
|
3944
3938
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
3945
3939
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
3946
3940
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
3947
3941
|
})), keys.push.apply(keys, symbols);
|
|
3948
3942
|
}
|
|
3949
|
-
|
|
3950
3943
|
return keys;
|
|
3951
3944
|
}
|
|
3952
|
-
|
|
3953
3945
|
function _objectSpread2(target) {
|
|
3954
3946
|
for (var i = 1; i < arguments.length; i++) {
|
|
3955
3947
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -3959,7 +3951,6 @@ function _objectSpread2(target) {
|
|
|
3959
3951
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3960
3952
|
});
|
|
3961
3953
|
}
|
|
3962
|
-
|
|
3963
3954
|
return target;
|
|
3964
3955
|
}
|
|
3965
3956
|
|
|
@@ -3978,7 +3969,6 @@ function _defineProperties(target, props) {
|
|
|
3978
3969
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
3979
3970
|
}
|
|
3980
3971
|
}
|
|
3981
|
-
|
|
3982
3972
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
3983
3973
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
3984
3974
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
@@ -3992,7 +3982,6 @@ function _assertThisInitialized(self) {
|
|
|
3992
3982
|
if (self === void 0) {
|
|
3993
3983
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3994
3984
|
}
|
|
3995
|
-
|
|
3996
3985
|
return self;
|
|
3997
3986
|
}
|
|
3998
3987
|
|
|
@@ -4008,7 +3997,6 @@ function _inherits(subClass, superClass) {
|
|
|
4008
3997
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
4009
3998
|
throw new TypeError("Super expression must either be null or a function");
|
|
4010
3999
|
}
|
|
4011
|
-
|
|
4012
4000
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
4013
4001
|
constructor: {
|
|
4014
4002
|
value: subClass,
|
|
@@ -4033,7 +4021,6 @@ function _isNativeReflectConstruct() {
|
|
|
4033
4021
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
4034
4022
|
if (Reflect.construct.sham) return false;
|
|
4035
4023
|
if (typeof Proxy === "function") return true;
|
|
4036
|
-
|
|
4037
4024
|
try {
|
|
4038
4025
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
4039
4026
|
return true;
|
|
@@ -4058,7 +4045,6 @@ function _possibleConstructorReturn(self, call) {
|
|
|
4058
4045
|
} else if (call !== void 0) {
|
|
4059
4046
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
4060
4047
|
}
|
|
4061
|
-
|
|
4062
4048
|
return _assertThisInitialized(self);
|
|
4063
4049
|
}
|
|
4064
4050
|
|
|
@@ -4066,15 +4052,13 @@ function _createSuper(Derived) {
|
|
|
4066
4052
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
4067
4053
|
return function _createSuperInternal() {
|
|
4068
4054
|
var Super = _getPrototypeOf(Derived),
|
|
4069
|
-
|
|
4070
|
-
|
|
4055
|
+
result;
|
|
4071
4056
|
if (hasNativeReflectConstruct) {
|
|
4072
4057
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
4073
4058
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
4074
4059
|
} else {
|
|
4075
4060
|
result = Super.apply(this, arguments);
|
|
4076
4061
|
}
|
|
4077
|
-
|
|
4078
4062
|
return _possibleConstructorReturn(this, result);
|
|
4079
4063
|
};
|
|
4080
4064
|
}
|
|
@@ -4083,17 +4067,12 @@ var LOADING_IMG_SRC = '/images/gears.gif';
|
|
|
4083
4067
|
var NOT_FOUND_IMG_SRC = '/images/404.png';
|
|
4084
4068
|
var DEFAULT_MAX_ATTEMPTS = 3;
|
|
4085
4069
|
var DEFAULT_ATTEMPT_INTERVAL = 10000;
|
|
4086
|
-
|
|
4087
4070
|
var Img = /*#__PURE__*/function (_Component) {
|
|
4088
4071
|
_inherits(Img, _Component);
|
|
4089
|
-
|
|
4090
4072
|
var _super = _createSuper(Img);
|
|
4091
|
-
|
|
4092
4073
|
function Img(props) {
|
|
4093
4074
|
var _this;
|
|
4094
|
-
|
|
4095
4075
|
_classCallCheck(this, Img);
|
|
4096
|
-
|
|
4097
4076
|
_this = _super.call(this, props);
|
|
4098
4077
|
_this.state = {
|
|
4099
4078
|
src: _this.props.src,
|
|
@@ -4102,7 +4081,6 @@ var Img = /*#__PURE__*/function (_Component) {
|
|
|
4102
4081
|
_this.onError = _this.onError.bind(_assertThisInitialized(_this));
|
|
4103
4082
|
return _this;
|
|
4104
4083
|
}
|
|
4105
|
-
|
|
4106
4084
|
_createClass(Img, [{
|
|
4107
4085
|
key: "UNSAFE_componentWillReceiveProps",
|
|
4108
4086
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
@@ -4124,21 +4102,17 @@ var Img = /*#__PURE__*/function (_Component) {
|
|
|
4124
4102
|
key: "onError",
|
|
4125
4103
|
value: function onError() {
|
|
4126
4104
|
var _this2 = this;
|
|
4127
|
-
|
|
4128
4105
|
if (NOT_FOUND_IMG_SRC === this.state.src) {
|
|
4129
4106
|
return;
|
|
4130
4107
|
}
|
|
4131
|
-
|
|
4132
4108
|
var max_attempts = this.props.max_attempts || DEFAULT_MAX_ATTEMPTS;
|
|
4133
4109
|
var attempt_interval = this.props.attempt_interval || DEFAULT_ATTEMPT_INTERVAL;
|
|
4134
|
-
|
|
4135
4110
|
if (this.state.attempts >= max_attempts) {
|
|
4136
4111
|
this.setState({
|
|
4137
4112
|
src: NOT_FOUND_IMG_SRC
|
|
4138
4113
|
});
|
|
4139
4114
|
return;
|
|
4140
4115
|
}
|
|
4141
|
-
|
|
4142
4116
|
this.setState({
|
|
4143
4117
|
src: LOADING_IMG_SRC,
|
|
4144
4118
|
attempts: this.state.attempts + 1
|
|
@@ -4152,17 +4126,16 @@ var Img = /*#__PURE__*/function (_Component) {
|
|
|
4152
4126
|
}, {
|
|
4153
4127
|
key: "render",
|
|
4154
4128
|
value: function render() {
|
|
4155
|
-
var props = _objectSpread2(_objectSpread2({
|
|
4156
|
-
src: this.state.src,
|
|
4129
|
+
var props = _objectSpread2(_objectSpread2({
|
|
4157
4130
|
onError: this.onError
|
|
4131
|
+
}, this.props), {}, {
|
|
4132
|
+
src: this.state.src
|
|
4158
4133
|
});
|
|
4159
|
-
|
|
4160
4134
|
return /*#__PURE__*/React__default.createElement("img", Object.assign({
|
|
4161
4135
|
alt: ""
|
|
4162
4136
|
}, props));
|
|
4163
4137
|
}
|
|
4164
4138
|
}]);
|
|
4165
|
-
|
|
4166
4139
|
return Img;
|
|
4167
4140
|
}(React.Component);
|
|
4168
4141
|
|
|
@@ -4186,7 +4159,7 @@ var Artwork = function (_a) {
|
|
|
4186
4159
|
return React__default.createElement(ArtworkWrapper, { cssHeight: props.cssHeight ? props.cssHeight : props.picture ? 17 : 0, onClick: !props.picture && props.onClick ? props.onClick : undefined },
|
|
4187
4160
|
props.picture ?
|
|
4188
4161
|
React__default.createElement(ArtworkPicture, { onClick: function (e) { return props.onClick ? props.onClick(e) : null; }, cssHeight: props.cssHeight ? props.cssHeight : 17 },
|
|
4189
|
-
React__default.createElement(Img, { src: props.picture, style: { objectFit: "contain", width: "100%", height: "100%" } }))
|
|
4162
|
+
React__default.createElement(Img, { src: props.picture, style: { objectFit: "contain", width: "100%", height: "100%" }, onError: props.onError }))
|
|
4190
4163
|
:
|
|
4191
4164
|
React__default.createElement(IconDoc, { ext: extension(props.name), style: { width: "3vw" } }),
|
|
4192
4165
|
!props.edit ?
|
|
@@ -5191,13 +5164,11 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
5191
5164
|
var target = {};
|
|
5192
5165
|
var sourceKeys = Object.keys(source);
|
|
5193
5166
|
var key, i;
|
|
5194
|
-
|
|
5195
5167
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
5196
5168
|
key = sourceKeys[i];
|
|
5197
5169
|
if (excluded.indexOf(key) >= 0) continue;
|
|
5198
5170
|
target[key] = source[key];
|
|
5199
5171
|
}
|
|
5200
|
-
|
|
5201
5172
|
return target;
|
|
5202
5173
|
}
|
|
5203
5174
|
|
|
@@ -7154,12 +7125,6 @@ Object.defineProperty(exports, 'mergeStyles', {
|
|
|
7154
7125
|
return BaseSelect.mergeStyles;
|
|
7155
7126
|
}
|
|
7156
7127
|
});
|
|
7157
|
-
Object.defineProperty(exports, 'makeCreatableSelect', {
|
|
7158
|
-
enumerable: true,
|
|
7159
|
-
get: function () {
|
|
7160
|
-
return BaseCreatableSelect.makeCreatableSelect;
|
|
7161
|
-
}
|
|
7162
|
-
});
|
|
7163
7128
|
exports.AddIcon = AddIcon;
|
|
7164
7129
|
exports.AddNoteIcon = AddNoteIcon;
|
|
7165
7130
|
exports.AddTaskIcon = AddTaskIcon;
|