indicator-ui 0.0.256 → 0.0.258
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.js +18 -15
- package/dist/index.js.map +1 -1
- package/dist/types/src/lib/array/uniqueByKey.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -32879,7 +32879,7 @@ function getSelectFieldOptionsByValue(value, options) {
|
|
|
32879
32879
|
return value === (0,_getSelectFieldOptionsItemValue__WEBPACK_IMPORTED_MODULE_0__.getSelectFieldOptionsItemValue)(item);
|
|
32880
32880
|
});
|
|
32881
32881
|
}
|
|
32882
|
-
return (0,_lib__WEBPACK_IMPORTED_MODULE_1__.uniqueByKey)(filteredOptions);
|
|
32882
|
+
return (0,_lib__WEBPACK_IMPORTED_MODULE_1__.uniqueByKey)(filteredOptions, 'value');
|
|
32883
32883
|
}
|
|
32884
32884
|
|
|
32885
32885
|
/***/ }),
|
|
@@ -33029,6 +33029,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33029
33029
|
/* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib */ "./src/ui/InputFields/SelectField/lib/index.ts");
|
|
33030
33030
|
/* harmony import */ var _styles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../styles */ "./src/ui/InputFields/SelectField/styles/index.ts");
|
|
33031
33031
|
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../config */ "./src/ui/InputFields/SelectField/config/index.ts");
|
|
33032
|
+
/* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/lib */ "./src/lib/index.ts");
|
|
33032
33033
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
33033
33034
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33034
33035
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -33056,6 +33057,7 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
33056
33057
|
|
|
33057
33058
|
|
|
33058
33059
|
|
|
33060
|
+
|
|
33059
33061
|
function SelectField(_ref) {
|
|
33060
33062
|
var value = _ref.value,
|
|
33061
33063
|
onChange = _ref.onChange,
|
|
@@ -33189,7 +33191,7 @@ function SelectField(_ref) {
|
|
|
33189
33191
|
setTimeout(function () {
|
|
33190
33192
|
requestPromiseRef.current = undefined;
|
|
33191
33193
|
}, 0);
|
|
33192
|
-
return updatedOptions;
|
|
33194
|
+
return (0,_lib__WEBPACK_IMPORTED_MODULE_8__.uniqueByKey)(updatedOptions, 'value');
|
|
33193
33195
|
});
|
|
33194
33196
|
_context.next = 16;
|
|
33195
33197
|
break;
|
|
@@ -33245,23 +33247,24 @@ function SelectField(_ref) {
|
|
|
33245
33247
|
};
|
|
33246
33248
|
});
|
|
33247
33249
|
};
|
|
33250
|
+
var search = function search(searchString) {
|
|
33251
|
+
if (isFocus) {
|
|
33252
|
+
setSearchingString(searchString);
|
|
33253
|
+
if (searchingTimeoutRef.current != null) {
|
|
33254
|
+
clearTimeout(searchingTimeoutRef.current);
|
|
33255
|
+
}
|
|
33256
|
+
searchingTimeoutRef.current = setTimeout(function () {
|
|
33257
|
+
searching(searchString, optionsState).then(function (newOptions) {
|
|
33258
|
+
return newOptions !== undefined && setOptionsState((0,_lib__WEBPACK_IMPORTED_MODULE_8__.uniqueByKey)(newOptions, 'value'));
|
|
33259
|
+
});
|
|
33260
|
+
}, _config__WEBPACK_IMPORTED_MODULE_7__.SEARCHING_DELAY_TIME);
|
|
33261
|
+
}
|
|
33262
|
+
};
|
|
33248
33263
|
var getViewField = function getViewField() {
|
|
33249
33264
|
if (searching !== undefined) {
|
|
33250
33265
|
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_FlexField__WEBPACK_IMPORTED_MODULE_4__.FlexField, {
|
|
33251
33266
|
value: isFocus ? searchingString : (0,_lib__WEBPACK_IMPORTED_MODULE_5__.getStringValue)(value, [].concat(_toConsumableArray(optionsState), _toConsumableArray(optionsCacheRef.current))),
|
|
33252
|
-
onChange:
|
|
33253
|
-
if (isFocus) {
|
|
33254
|
-
setSearchingString(searchString);
|
|
33255
|
-
if (searchingTimeoutRef.current != null) {
|
|
33256
|
-
clearTimeout(searchingTimeoutRef.current);
|
|
33257
|
-
}
|
|
33258
|
-
searchingTimeoutRef.current = setTimeout(function () {
|
|
33259
|
-
searching(searchString, optionsState).then(function (newOptions) {
|
|
33260
|
-
return newOptions !== undefined && setOptionsState(newOptions);
|
|
33261
|
-
});
|
|
33262
|
-
}, _config__WEBPACK_IMPORTED_MODULE_7__.SEARCHING_DELAY_TIME);
|
|
33263
|
-
}
|
|
33264
|
-
},
|
|
33267
|
+
onChange: search,
|
|
33265
33268
|
disabled: disabled,
|
|
33266
33269
|
onFocus: function onFocus() {
|
|
33267
33270
|
setIsShowModalWindow(true);
|