@oliasoft-open-source/react-ui-library 3.9.2-beta-2 → 3.9.2-beta-3
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 +16 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27095,6 +27095,10 @@ const CustomSelect = ({
|
|
|
27095
27095
|
}
|
|
27096
27096
|
}, [options]);
|
|
27097
27097
|
const onSelectOption = (evt, option2, close2) => {
|
|
27098
|
+
console.group("onClickDeselectOption");
|
|
27099
|
+
console.log(evt, options);
|
|
27100
|
+
console.log(selectedOptions);
|
|
27101
|
+
console.groupEnd();
|
|
27098
27102
|
if (!(disabled2 || disabledContext)) {
|
|
27099
27103
|
if (close2) {
|
|
27100
27104
|
close2();
|
|
@@ -27104,8 +27108,12 @@ const CustomSelect = ({
|
|
|
27104
27108
|
onCreate(option2.value);
|
|
27105
27109
|
} else {
|
|
27106
27110
|
if (!option2.disabled) {
|
|
27107
|
-
if (selectedOptions
|
|
27108
|
-
|
|
27111
|
+
if (Array.isArray(selectedOptions)) {
|
|
27112
|
+
const alreadySelected = selectedOptions.find(
|
|
27113
|
+
(selectedOption) => lodash.exports.isEqual(selectedOption, option2)
|
|
27114
|
+
);
|
|
27115
|
+
if (!alreadySelected) {
|
|
27116
|
+
console.log("alreadySelected", alreadySelected);
|
|
27109
27117
|
const newSelectedOptions = lodash.exports.uniqWith(
|
|
27110
27118
|
selectedOptions.concat(option2),
|
|
27111
27119
|
lodash.exports.isEqual
|
|
@@ -27113,8 +27121,9 @@ const CustomSelect = ({
|
|
|
27113
27121
|
onChange(evt, newSelectedOptions);
|
|
27114
27122
|
} else {
|
|
27115
27123
|
const newSelectedOptions = selectedOptions.filter(
|
|
27116
|
-
(opt) => opt
|
|
27124
|
+
(opt) => !lodash.exports.isEqual(opt, option2)
|
|
27117
27125
|
);
|
|
27126
|
+
console.log("newSelectedOptions", newSelectedOptions);
|
|
27118
27127
|
onChange(evt, newSelectedOptions);
|
|
27119
27128
|
}
|
|
27120
27129
|
} else {
|
|
@@ -27180,6 +27189,9 @@ const CustomSelect = ({
|
|
|
27180
27189
|
}
|
|
27181
27190
|
}, [state.isLayerOpen]);
|
|
27182
27191
|
const onClickDeselectOption = (evt, options2) => {
|
|
27192
|
+
console.group("onClickDeselectOption");
|
|
27193
|
+
console.log(evt, options2);
|
|
27194
|
+
console.groupEnd();
|
|
27183
27195
|
const newSelectedOptions = selectedOptions instanceof Array ? selectedOptions.filter((option2) => option2.value !== options2.value) : null;
|
|
27184
27196
|
onChange(evt, newSelectedOptions);
|
|
27185
27197
|
};
|
|
@@ -27509,9 +27521,6 @@ const Select = (props) => {
|
|
|
27509
27521
|
closeOnOptionActionClick,
|
|
27510
27522
|
testId
|
|
27511
27523
|
} = props;
|
|
27512
|
-
console.group("PROPS");
|
|
27513
|
-
console.log(props);
|
|
27514
|
-
console.groupEnd();
|
|
27515
27524
|
const enableAutoScroll = !native && autoScroll2 === true;
|
|
27516
27525
|
const {
|
|
27517
27526
|
multi,
|
|
@@ -27526,14 +27535,7 @@ const Select = (props) => {
|
|
|
27526
27535
|
enableAutoScroll,
|
|
27527
27536
|
checkNonExistentValues
|
|
27528
27537
|
);
|
|
27529
|
-
console.
|
|
27530
|
-
console.log(multi);
|
|
27531
|
-
console.log(simpleInputs);
|
|
27532
|
-
console.log(options);
|
|
27533
|
-
console.log(selectedOptions);
|
|
27534
|
-
console.log(firstSelectedOptionIndex);
|
|
27535
|
-
console.log(hasNonExistentValue);
|
|
27536
|
-
console.groupEnd();
|
|
27538
|
+
console.log("selectedOptions", selectedOptions);
|
|
27537
27539
|
const canUseNative = !multi;
|
|
27538
27540
|
const useNative = native && canUseNative;
|
|
27539
27541
|
if (native && !canUseNative) {
|
|
@@ -27561,31 +27563,20 @@ const Select = (props) => {
|
|
|
27561
27563
|
]
|
|
27562
27564
|
}) : error2;
|
|
27563
27565
|
const onChangeSelectedValue = (evt, selectedOptions2) => {
|
|
27564
|
-
console.group("ON CHANGE");
|
|
27565
|
-
console.group("ON CHANGE PROPS");
|
|
27566
|
-
console.log(evt);
|
|
27567
|
-
console.log(selectedOptions2);
|
|
27568
|
-
console.groupEnd();
|
|
27569
27566
|
if (deprecatedEventHandler) {
|
|
27570
|
-
console.log("DEPRECATED");
|
|
27571
27567
|
const newSelectedOptions = multi ? selectedOptions2.map((o) => simpleInputs ? o.value : o) : simpleInputs ? selectedOptions2.value : selectedOptions2;
|
|
27572
27568
|
onChange(newSelectedOptions);
|
|
27573
27569
|
} else {
|
|
27574
|
-
console.log("DEPRECATED ELSE");
|
|
27575
27570
|
const isSyntheticEvent = !(evt instanceof Event);
|
|
27576
27571
|
const value = multi ? selectedOptions2 : selectedOptions2.value;
|
|
27577
|
-
console.log("VALUE", value);
|
|
27578
27572
|
if (isSyntheticEvent) {
|
|
27579
|
-
console.log("SYNTHETIC");
|
|
27580
27573
|
evt.target.name = name2;
|
|
27581
27574
|
evt.target.value = value;
|
|
27582
27575
|
if (!multi) {
|
|
27583
|
-
console.log("NO MULTI");
|
|
27584
27576
|
evt.target.label = selectedOptions2.label;
|
|
27585
27577
|
}
|
|
27586
27578
|
onChange(evt);
|
|
27587
27579
|
} else {
|
|
27588
|
-
console.log("SYNTHETIC ELSE");
|
|
27589
27580
|
onChange({
|
|
27590
27581
|
...evt,
|
|
27591
27582
|
target: {
|
|
@@ -27597,7 +27588,6 @@ const Select = (props) => {
|
|
|
27597
27588
|
});
|
|
27598
27589
|
}
|
|
27599
27590
|
}
|
|
27600
|
-
console.groupEnd();
|
|
27601
27591
|
};
|
|
27602
27592
|
return useNative ? /* @__PURE__ */ jsx(NativeSelect, {
|
|
27603
27593
|
...props,
|