@mw-kit/mw-ui 1.7.88 → 1.7.90
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.modern.js
CHANGED
|
@@ -15046,9 +15046,9 @@ var EmptyContentContainer = styled.div(_templateObject3$f || (_templateObject3$f
|
|
|
15046
15046
|
var Select = React__default.forwardRef(function (props, ref) {
|
|
15047
15047
|
var position = props.position,
|
|
15048
15048
|
loader = props.loader,
|
|
15049
|
-
|
|
15049
|
+
initialLoader = props.initialLoader;
|
|
15050
15050
|
|
|
15051
|
-
var _useState = useState(
|
|
15051
|
+
var _useState = useState(initialLoader || []),
|
|
15052
15052
|
options = _useState[0],
|
|
15053
15053
|
setOptions = _useState[1];
|
|
15054
15054
|
|
|
@@ -15093,7 +15093,7 @@ var Select = React__default.forwardRef(function (props, ref) {
|
|
|
15093
15093
|
setPage(1);
|
|
15094
15094
|
};
|
|
15095
15095
|
|
|
15096
|
-
var inputProps = filterObject(props, ['type', 'onScrollEnd', 'position', 'value', 'onClear', 'placeholder', '
|
|
15096
|
+
var inputProps = filterObject(props, ['type', 'onScrollEnd', 'position', 'value', 'onClear', 'placeholder', 'initialLoader']);
|
|
15097
15097
|
|
|
15098
15098
|
var _onScrollEnd = props.onScrollEnd || function () {};
|
|
15099
15099
|
|
|
@@ -15117,14 +15117,15 @@ var Select = React__default.forwardRef(function (props, ref) {
|
|
|
15117
15117
|
options = _ref2[0],
|
|
15118
15118
|
lastPage = _ref2[1];
|
|
15119
15119
|
|
|
15120
|
-
var
|
|
15121
|
-
|
|
15120
|
+
var initial = initialLoader ? initialLoader() : [];
|
|
15121
|
+
var filtered = initialLoader ? options.filter(function (x) {
|
|
15122
|
+
return !initial.some(function (y) {
|
|
15122
15123
|
return x.value === y.value;
|
|
15123
15124
|
});
|
|
15124
15125
|
}) : options;
|
|
15125
15126
|
|
|
15126
15127
|
var getWithOptions = function getWithOptions() {
|
|
15127
|
-
return !search &&
|
|
15128
|
+
return !search && initialLoader ? [].concat(initial, filtered) : options;
|
|
15128
15129
|
};
|
|
15129
15130
|
|
|
15130
15131
|
setOptions(page === 1 ? getWithOptions() : function (prev) {
|
|
@@ -15136,10 +15137,7 @@ var Select = React__default.forwardRef(function (props, ref) {
|
|
|
15136
15137
|
} catch (e) {
|
|
15137
15138
|
return Promise.reject(e);
|
|
15138
15139
|
}
|
|
15139
|
-
}, [loader, search, page,
|
|
15140
|
-
useEffect(function () {
|
|
15141
|
-
setSearch('');
|
|
15142
|
-
}, [loader]);
|
|
15140
|
+
}, [loader, search, page, initialLoader]);
|
|
15143
15141
|
useEffect(function () {
|
|
15144
15142
|
var timeoutId = setTimeout(function () {
|
|
15145
15143
|
return onSubmit();
|
|
@@ -17886,7 +17884,11 @@ var Submenu = function Submenu(props) {
|
|
|
17886
17884
|
_setSearch(value);
|
|
17887
17885
|
|
|
17888
17886
|
setPage(1);
|
|
17889
|
-
|
|
17887
|
+
|
|
17888
|
+
if (force && changed === false) {
|
|
17889
|
+
setLoading(true);
|
|
17890
|
+
onSearch();
|
|
17891
|
+
}
|
|
17890
17892
|
};
|
|
17891
17893
|
|
|
17892
17894
|
useEffect(function () {
|