@uncinc/uncinc-react-kitchen-sink 2.8.23 → 2.8.24
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.
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
var _excluded = ["fieldName", "id", "validation", "defaultValue", "onChange", "options", "placeholder", "disabled", "className", "wrapperClassName", "isClearable", "isSearchable", "multiple", "size", "required"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
1
5
|
import React from 'react';
|
|
2
6
|
import SelectStyled from 'react-select';
|
|
3
7
|
import c from 'classnames';
|
|
@@ -34,7 +38,8 @@ var SelectInput = function SelectInput(props) {
|
|
|
34
38
|
_props$multiple = props.multiple,
|
|
35
39
|
multiple = _props$multiple === void 0 ? false : _props$multiple,
|
|
36
40
|
size = props.size,
|
|
37
|
-
required = props.required
|
|
41
|
+
required = props.required,
|
|
42
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
38
43
|
var selectedOption = props.selectedOption;
|
|
39
44
|
var _useExtendedFormikCon = useExtendedFormikContext(),
|
|
40
45
|
values = _useExtendedFormikCon.values,
|
|
@@ -83,7 +88,7 @@ var SelectInput = function SelectInput(props) {
|
|
|
83
88
|
value: value,
|
|
84
89
|
validate: handleValidation
|
|
85
90
|
}, function () {
|
|
86
|
-
return /*#__PURE__*/React.createElement(SelectStyled, {
|
|
91
|
+
return /*#__PURE__*/React.createElement(SelectStyled, _extends({}, restProps, {
|
|
87
92
|
id: id,
|
|
88
93
|
inputId: fieldName,
|
|
89
94
|
className: c('Select__select', className),
|
|
@@ -146,7 +151,7 @@ var SelectInput = function SelectInput(props) {
|
|
|
146
151
|
primary75: 'hsla(0,0%,0%, 0)'
|
|
147
152
|
}
|
|
148
153
|
}
|
|
149
|
-
});
|
|
154
|
+
}));
|
|
150
155
|
});
|
|
151
156
|
};
|
|
152
157
|
export default SelectInput;
|
|
@@ -80,7 +80,13 @@ var AdaptivePicture = function AdaptivePicture(_ref) {
|
|
|
80
80
|
}, [fallbackImage, status, targetSrc, validatedSources]);
|
|
81
81
|
var loadedUrl = useImageLoader(fallbackImage, targetSrc, imageRef);
|
|
82
82
|
function onErrorFallback(e) {
|
|
83
|
-
|
|
83
|
+
// Make sure that both URLs are absolute URLs, so we can compare them.
|
|
84
|
+
// Otherwise this error callback will constantly be thrown.
|
|
85
|
+
var link = document.createElement('a');
|
|
86
|
+
link.href = e.target.src;
|
|
87
|
+
var link2 = document.createElement('a');
|
|
88
|
+
link2.href = fallbackImage;
|
|
89
|
+
if (link.href !== link2.href) {
|
|
84
90
|
e.target.src = fallbackImage;
|
|
85
91
|
}
|
|
86
92
|
}
|