@oliasoft-open-source/react-ui-library 4.14.1-beta-3 → 4.14.1
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 +1 -1
- package/dist/index.js +8 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -21196,48 +21196,43 @@ const useCustomSelectLogic = ({
|
|
|
21196
21196
|
setTriggerFocus();
|
|
21197
21197
|
};
|
|
21198
21198
|
const openLayer = () => dispatch({ type: ActionTypes.OPEN_LAYER });
|
|
21199
|
+
const isFirstRun = useRef(true);
|
|
21200
|
+
useEffect(() => {
|
|
21201
|
+
if (isFirstRun.current) {
|
|
21202
|
+
isFirstRun.current = false;
|
|
21203
|
+
} else {
|
|
21204
|
+
dispatch({ type: ActionTypes.SET_VISIBLE_OPTIONS, options });
|
|
21205
|
+
}
|
|
21206
|
+
}, [options]);
|
|
21199
21207
|
const onSelectOption = (evt, option2, close2) => {
|
|
21200
21208
|
if (!(disabled2 || disabledContext)) {
|
|
21201
|
-
console.log(1);
|
|
21202
21209
|
if (close2) {
|
|
21203
|
-
console.log(2);
|
|
21204
21210
|
close2();
|
|
21205
21211
|
}
|
|
21206
21212
|
if (option2) {
|
|
21207
|
-
console.log(3);
|
|
21208
21213
|
if (option2.createAble && onCreate) {
|
|
21209
|
-
console.log(4);
|
|
21210
21214
|
onCreate(option2.value);
|
|
21211
21215
|
} else {
|
|
21212
|
-
console.log(5);
|
|
21213
21216
|
if (!option2.disabled) {
|
|
21214
|
-
console.log(6);
|
|
21215
21217
|
if (Array.isArray(selectedOptions)) {
|
|
21216
|
-
console.log(7);
|
|
21217
21218
|
const alreadySelected = selectedOptions.some(
|
|
21218
21219
|
(selectedOption) => selectedOption.label === option2.label
|
|
21219
21220
|
);
|
|
21220
21221
|
if (!alreadySelected) {
|
|
21221
|
-
console.log(8);
|
|
21222
21222
|
const newSelectedOptions = [...selectedOptions, option2];
|
|
21223
21223
|
if (onChange) {
|
|
21224
|
-
console.log(9);
|
|
21225
21224
|
onChange(evt, newSelectedOptions);
|
|
21226
21225
|
}
|
|
21227
21226
|
} else {
|
|
21228
|
-
console.log(10);
|
|
21229
21227
|
const newSelectedOptions = selectedOptions.filter(
|
|
21230
21228
|
(opt) => opt.label !== option2.label
|
|
21231
21229
|
);
|
|
21232
21230
|
if (onChange) {
|
|
21233
|
-
console.log(11);
|
|
21234
21231
|
onChange(evt, newSelectedOptions);
|
|
21235
21232
|
}
|
|
21236
21233
|
}
|
|
21237
21234
|
} else {
|
|
21238
|
-
console.log(12);
|
|
21239
21235
|
if (onChange) {
|
|
21240
|
-
console.log(14);
|
|
21241
21236
|
onChange(evt, option2);
|
|
21242
21237
|
}
|
|
21243
21238
|
}
|