cr-ui-lib 1.1.110 → 1.1.112

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.mts CHANGED
@@ -218,6 +218,7 @@ declare const SingleListInput: React$1.FC<SingleListInputProps>;
218
218
  declare type Option = {
219
219
  id: string;
220
220
  name: string;
221
+ isDisabled?: boolean;
221
222
  };
222
223
  declare type SingleSelectDropdownProps = {
223
224
  label?: string;
package/dist/index.d.ts CHANGED
@@ -218,6 +218,7 @@ declare const SingleListInput: React$1.FC<SingleListInputProps>;
218
218
  declare type Option = {
219
219
  id: string;
220
220
  name: string;
221
+ isDisabled?: boolean;
221
222
  };
222
223
  declare type SingleSelectDropdownProps = {
223
224
  label?: string;
package/dist/index.js CHANGED
@@ -3629,7 +3629,7 @@ function SingleSelectDropdown({
3629
3629
  }
3630
3630
  };
3631
3631
  const openList = () => {
3632
- if (!disabled) {
3632
+ if (!disabled && !isOpen) {
3633
3633
  setIsOpen(true);
3634
3634
  }
3635
3635
  };
@@ -3740,9 +3740,11 @@ function SingleSelectDropdown({
3740
3740
  {
3741
3741
  className: tailwindMerge.twMerge(
3742
3742
  `h-[40px] px-2 py-2 my-1 text-sm cursor-pointer select-none rounded-md hover:bg-gray-100 ${opt.id === value ? "bg-[#ECF3F7] font-semibold" + selectedColorDropdownItem : "text-[#131414]"}`,
3743
+ opt.isDisabled ? "opacity-50" : "",
3743
3744
  displayItemClass
3744
3745
  ),
3745
3746
  onClick: () => {
3747
+ if (opt.isDisabled) return;
3746
3748
  onChange(opt.id);
3747
3749
  setIsOpen(false);
3748
3750
  if (uniqueSearch) {
@@ -3837,6 +3839,7 @@ function SingleSelectDropdown({
3837
3839
  type: "text",
3838
3840
  autoFocus: true,
3839
3841
  onClick: openList,
3842
+ onFocus: openList,
3840
3843
  className: tailwindMerge.twMerge(
3841
3844
  "input-placeholder-ellipsis w-full pr-[30px] h-[48px] px-2 py-1 rounded-md border border-gray-300 text-sm focus:border-1 focus:border-[#4683B4] focus:outline-none",
3842
3845
  searchInputClass,