cr-ui-lib 1.1.109 → 1.1.111

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;
@@ -252,9 +253,10 @@ declare type SingleSelectDropdownProps = {
252
253
  displayContainerClass?: string;
253
254
  selectedColorDropdownItem?: string;
254
255
  uniqueSearch?: boolean;
256
+ emptyMessageClass?: string;
255
257
  };
256
258
  declare function SingleSelectDropdown({ label, value, onChange, options, placeholder, onScrollToEnd, onSearch, hasMore, isLoading, searchable, searchDebounceMs, requiresSearch, minSearchLength, emptyMessage, loadingMessage, searchPlaceholder, disabled, hasIcon, buttonClass, labelClass, displayItemClass, displayMainClass, hasSearchIcon, searchInputClass, placeholderSearchClass, usePortal, // default true
257
- iconClass, placeholderClass, displayContainerClass, selectedColorDropdownItem, uniqueSearch, }: SingleSelectDropdownProps): JSX.Element;
259
+ iconClass, placeholderClass, displayContainerClass, selectedColorDropdownItem, uniqueSearch, emptyMessageClass, }: SingleSelectDropdownProps): JSX.Element;
258
260
 
259
261
  interface SelectionButton {
260
262
  data: 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;
@@ -252,9 +253,10 @@ declare type SingleSelectDropdownProps = {
252
253
  displayContainerClass?: string;
253
254
  selectedColorDropdownItem?: string;
254
255
  uniqueSearch?: boolean;
256
+ emptyMessageClass?: string;
255
257
  };
256
258
  declare function SingleSelectDropdown({ label, value, onChange, options, placeholder, onScrollToEnd, onSearch, hasMore, isLoading, searchable, searchDebounceMs, requiresSearch, minSearchLength, emptyMessage, loadingMessage, searchPlaceholder, disabled, hasIcon, buttonClass, labelClass, displayItemClass, displayMainClass, hasSearchIcon, searchInputClass, placeholderSearchClass, usePortal, // default true
257
- iconClass, placeholderClass, displayContainerClass, selectedColorDropdownItem, uniqueSearch, }: SingleSelectDropdownProps): JSX.Element;
259
+ iconClass, placeholderClass, displayContainerClass, selectedColorDropdownItem, uniqueSearch, emptyMessageClass, }: SingleSelectDropdownProps): JSX.Element;
258
260
 
259
261
  interface SelectionButton {
260
262
  data: string[];
package/dist/index.js CHANGED
@@ -3496,7 +3496,8 @@ function SingleSelectDropdown({
3496
3496
  placeholderClass = "",
3497
3497
  displayContainerClass = "",
3498
3498
  selectedColorDropdownItem = "text-[#131414]",
3499
- uniqueSearch = false
3499
+ uniqueSearch = false,
3500
+ emptyMessageClass = "px-2 py-2 text-sm text-gray-500"
3500
3501
  }) {
3501
3502
  const [isOpen, setIsOpen] = React.useState(false);
3502
3503
  const [searchTerm, setSearchTerm] = React.useState("");
@@ -3577,7 +3578,7 @@ function SingleSelectDropdown({
3577
3578
  minSearchLength >= 3 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-400 mt-1", children: "Search from large dataset" })
3578
3579
  ] });
3579
3580
  }
3580
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-2 text-sm text-gray-500", children: !isLoading && options.length === 0 && emptyMessage });
3581
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: emptyMessageClass, children: !isLoading && options.length === 0 && emptyMessage });
3581
3582
  };
3582
3583
  const handleClickOutside = (event) => {
3583
3584
  if (dropdownRef.current && !dropdownRef.current.contains(event.target) && portalRef.current && !portalRef.current.contains(event.target)) {
@@ -3739,9 +3740,11 @@ function SingleSelectDropdown({
3739
3740
  {
3740
3741
  className: tailwindMerge.twMerge(
3741
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" : "",
3742
3744
  displayItemClass
3743
3745
  ),
3744
3746
  onClick: () => {
3747
+ if (opt.isDisabled) return;
3745
3748
  onChange(opt.id);
3746
3749
  setIsOpen(false);
3747
3750
  if (uniqueSearch) {