@databrainhq/plugin 0.15.16 → 0.15.17

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.
@@ -36,4 +36,4 @@ export type MultiSelectDropdownProps = Omit<MultiSelectAccordianDropdownProps, '
36
36
  isSelectAllOn?: boolean;
37
37
  };
38
38
  export declare const MultiSelectAccordianDropdown: ({ label, labelVariant, selectedOption, onChange, button, options, isDisabled, icon, buttonWidth, menuWidth, isSearchEnabled, searchIcon, closeControl, searchPlaceholder, radius, }: MultiSelectAccordianDropdownProps) => React.JSX.Element;
39
- export declare const MultiSelectDropdown: ({ id, label, labelVariant, selectedOption: selectedOption_temp, onChange, button, options, isDisabled, icon, buttonWidth, menuWidth, isSearchEnabled, searchIcon, closeControl, searchPlaceholder, isShowSelectedOptions, radius, isFilter, dataTestTitle, isAutoSelectOption, isLoadingData, error, menuZIndex, isSelectAllEnabled, isSelectAllOn, }: MultiSelectDropdownProps) => React.JSX.Element;
39
+ export declare const MultiSelectDropdown: ({ id, label, labelVariant, selectedOption, onChange, button, options, isDisabled, icon, buttonWidth, menuWidth, isSearchEnabled, searchIcon, closeControl, searchPlaceholder, isShowSelectedOptions, radius, isFilter, dataTestTitle, isAutoSelectOption, isLoadingData, error, menuZIndex, isSelectAllEnabled, isSelectAllOn, }: MultiSelectDropdownProps) => React.JSX.Element;
@@ -5872,7 +5872,7 @@ const MultiSelectDropdown = ({
5872
5872
  id: id2,
5873
5873
  label: label3,
5874
5874
  labelVariant = "static",
5875
- selectedOption: selectedOption_temp,
5875
+ selectedOption: selectedOption2,
5876
5876
  onChange,
5877
5877
  button: button2,
5878
5878
  options: options2,
@@ -5902,27 +5902,18 @@ const MultiSelectDropdown = ({
5902
5902
  const selectedOptionsRef = useRef(null);
5903
5903
  const [offset2, setOffset] = useState([0, 6]);
5904
5904
  const containerRef = useRef(null);
5905
- const [isExceeded, setExceeded] = useState(selectedOption_temp.length > 10);
5905
+ const [isExceeded, setExceeded] = useState((selectedOption2 == null ? void 0 : selectedOption2.length) > 10);
5906
5906
  const [count2, setCount] = useState(0);
5907
5907
  const badgeRefs = useRef([]);
5908
5908
  const moreRef = useRef(null);
5909
5909
  const [badgeWidths, setBadgeWidths] = useState([]);
5910
5910
  const [isSortList, setSortList] = useState(false);
5911
5911
  const [isSelectAll, setSelectAll] = useState(isSelectAllOn || false);
5912
- const [selectedOption2, setSelectedOption] = useState(isSelectAll ? [] : selectedOption_temp);
5913
5912
  useEffect(() => {
5914
- const timeoutCleanUp = [];
5915
5913
  if (!isSelectAllEnabled)
5916
5914
  return;
5917
5915
  if (isSelectAll) {
5918
- setSelectedOption([]);
5919
- setSelectedOption(options2);
5920
5916
  onChange([...options2]);
5921
- return () => {
5922
- timeoutCleanUp.forEach((time2) => {
5923
- clearTimeout(time2);
5924
- });
5925
- };
5926
5917
  } else {
5927
5918
  onChange([...selectedOption2]);
5928
5919
  }
@@ -6185,7 +6176,6 @@ const MultiSelectDropdown = ({
6185
6176
  className: isSelectAll ? styles$14.checkedOption : styles$14.option,
6186
6177
  onClick: () => {
6187
6178
  if (isSelectAll) {
6188
- setSelectedOption((prev) => []);
6189
6179
  onChange([]);
6190
6180
  setSelectAll(false);
6191
6181
  } else
@@ -6198,13 +6188,12 @@ const MultiSelectDropdown = ({
6198
6188
  id: `select-all-checkbox-tick`,
6199
6189
  onClick: () => {
6200
6190
  if (isSelectAll) {
6201
- setSelectedOption((prev) => []);
6202
6191
  onChange([]);
6203
6192
  setSelectAll(false);
6204
6193
  } else
6205
6194
  setSelectAll(true);
6206
6195
  },
6207
- checked: isSelectAll
6196
+ checked: (selectedOption2 == null ? void 0 : selectedOption2.length) === (options2 == null ? void 0 : options2.length)
6208
6197
  }
6209
6198
  ),
6210
6199
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `${styles$14.optionLabel}`, children: "Select All" })
@@ -6230,15 +6219,8 @@ const MultiSelectDropdown = ({
6230
6219
  const updatedOptions = selectedOption2 == null ? void 0 : selectedOption2.filter(
6231
6220
  (opt, index2) => index2 !== optionIndex
6232
6221
  );
6233
- setSelectedOption(updatedOptions);
6234
6222
  onChange(updatedOptions);
6235
6223
  } else {
6236
- setSelectedOption((prev) => {
6237
- const newOption = [...prev, option3];
6238
- if (newOption.length == options2.length)
6239
- setSelectAll((prev2) => true);
6240
- return newOption;
6241
- });
6242
6224
  onChange([...selectedOption2, option3]);
6243
6225
  }
6244
6226
  },
@@ -6256,15 +6238,8 @@ const MultiSelectDropdown = ({
6256
6238
  const updatedOptions = selectedOption2 == null ? void 0 : selectedOption2.filter(
6257
6239
  (opt, index2) => index2 !== optionIndex
6258
6240
  );
6259
- setSelectedOption(updatedOptions);
6260
6241
  onChange(updatedOptions);
6261
6242
  } else {
6262
- setSelectedOption((prev) => {
6263
- const newOption = [...prev, option3];
6264
- if (newOption.length == options2.length)
6265
- setSelectAll((prev2) => true);
6266
- return newOption;
6267
- });
6268
6243
  onChange([...selectedOption2, option3]);
6269
6244
  }
6270
6245
  },
@@ -6302,7 +6277,6 @@ const MultiSelectDropdown = ({
6302
6277
  type: "button",
6303
6278
  onClick: () => {
6304
6279
  setSelectAll(false);
6305
- setSelectedOption([]);
6306
6280
  onChange([]);
6307
6281
  },
6308
6282
  fitContainer: true,