@oliasoft-open-source/react-ui-library 3.9.2-beta-1 → 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 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 instanceof Array) {
27108
- if (selectedOptions.indexOf(option2) === -1) {
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 !== option2
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,6 +27535,7 @@ const Select = (props) => {
27526
27535
  enableAutoScroll,
27527
27536
  checkNonExistentValues
27528
27537
  );
27538
+ console.log("selectedOptions", selectedOptions);
27529
27539
  const canUseNative = !multi;
27530
27540
  const useNative = native && canUseNative;
27531
27541
  if (native && !canUseNative) {
@@ -27553,30 +27563,20 @@ const Select = (props) => {
27553
27563
  ]
27554
27564
  }) : error2;
27555
27565
  const onChangeSelectedValue = (evt, selectedOptions2) => {
27556
- console.group("ON CHANGE");
27557
- console.group("ON CHANGE PROPS");
27558
- console.log(evt);
27559
- console.log(selectedOptions2);
27560
- console.groupEnd();
27561
27566
  if (deprecatedEventHandler) {
27562
- console.log("DEPRECATED");
27563
27567
  const newSelectedOptions = multi ? selectedOptions2.map((o) => simpleInputs ? o.value : o) : simpleInputs ? selectedOptions2.value : selectedOptions2;
27564
27568
  onChange(newSelectedOptions);
27565
27569
  } else {
27566
- console.log("DEPRECATED ELSE");
27567
27570
  const isSyntheticEvent = !(evt instanceof Event);
27568
27571
  const value = multi ? selectedOptions2 : selectedOptions2.value;
27569
27572
  if (isSyntheticEvent) {
27570
- console.log("SYNTHETIC");
27571
27573
  evt.target.name = name2;
27572
27574
  evt.target.value = value;
27573
27575
  if (!multi) {
27574
- console.log("NO MULTI");
27575
27576
  evt.target.label = selectedOptions2.label;
27576
27577
  }
27577
27578
  onChange(evt);
27578
27579
  } else {
27579
- console.log("SYNTHETIC ELSE");
27580
27580
  onChange({
27581
27581
  ...evt,
27582
27582
  target: {
@@ -27588,7 +27588,6 @@ const Select = (props) => {
27588
27588
  });
27589
27589
  }
27590
27590
  }
27591
- console.groupEnd();
27592
27591
  };
27593
27592
  return useNative ? /* @__PURE__ */ jsx(NativeSelect, {
27594
27593
  ...props,