@chekinapp/ui 0.0.118 → 0.0.119

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.cts CHANGED
@@ -3081,6 +3081,7 @@ type BaseSelectProps<T, V extends SelectValue$1, L extends ReactNode> = {
3081
3081
  onMenuScrollToBottom?: (event: React$1.UIEvent<HTMLDivElement>) => void;
3082
3082
  leftIcon?: React$1.ReactNode;
3083
3083
  formatGroupLabel?: SelectFormatGroupLabel<T, V, L>;
3084
+ onReset?: () => void;
3084
3085
  };
3085
3086
  type SingleSelectProps<T, V extends SelectValue$1, L extends ReactNode> = BaseSelectProps<T, V, L> & {
3086
3087
  isMulti?: false;
@@ -3104,7 +3105,6 @@ type SearchingSelectTriggerRenderer = (isOpen: boolean, toggle: () => void) => R
3104
3105
  type SearchingSelectBaseProps<T, V extends SelectValue$1, L extends ReactNode> = Omit<SingleSelectProps<T, V, L>, 'isMulti' | 'searchPosition' | 'components'> & {
3105
3106
  trigger?: SearchingSelectTriggerRenderer;
3106
3107
  components?: SelectComponents<T, V, L>;
3107
- searchPlaceholder?: string;
3108
3108
  /** Hide the in-menu search input (default: true). */
3109
3109
  searchable?: boolean;
3110
3110
  };
package/dist/index.d.ts CHANGED
@@ -3081,6 +3081,7 @@ type BaseSelectProps<T, V extends SelectValue$1, L extends ReactNode> = {
3081
3081
  onMenuScrollToBottom?: (event: React$1.UIEvent<HTMLDivElement>) => void;
3082
3082
  leftIcon?: React$1.ReactNode;
3083
3083
  formatGroupLabel?: SelectFormatGroupLabel<T, V, L>;
3084
+ onReset?: () => void;
3084
3085
  };
3085
3086
  type SingleSelectProps<T, V extends SelectValue$1, L extends ReactNode> = BaseSelectProps<T, V, L> & {
3086
3087
  isMulti?: false;
@@ -3104,7 +3105,6 @@ type SearchingSelectTriggerRenderer = (isOpen: boolean, toggle: () => void) => R
3104
3105
  type SearchingSelectBaseProps<T, V extends SelectValue$1, L extends ReactNode> = Omit<SingleSelectProps<T, V, L>, 'isMulti' | 'searchPosition' | 'components'> & {
3105
3106
  trigger?: SearchingSelectTriggerRenderer;
3106
3107
  components?: SelectComponents<T, V, L>;
3107
- searchPlaceholder?: string;
3108
3108
  /** Hide the in-menu search input (default: true). */
3109
3109
  searchable?: boolean;
3110
3110
  };
package/dist/index.js CHANGED
@@ -13842,7 +13842,8 @@ function SelectInternal(props, ref) {
13842
13842
  menuHeader,
13843
13843
  onMenuScrollToBottom,
13844
13844
  leftIcon,
13845
- formatGroupLabel
13845
+ formatGroupLabel,
13846
+ onReset
13846
13847
  } = props;
13847
13848
  const isSearchInDropdown = searchPosition === "dropdown";
13848
13849
  const isMulti = props.isMulti === true;
@@ -13909,7 +13910,10 @@ function SelectInternal(props, ref) {
13909
13910
  const resolvedLabel = label ?? placeholder;
13910
13911
  const hasInvalidState = state.hasInvalidState || Boolean(invalid);
13911
13912
  const hiddenValue = isMulti ? selectedOptions.map((item) => String(item.value)).join(",") : selectedOptions[0] ? String(selectedOptions[0].value) : "";
13912
- const handleClear = (event) => state.clearSelection(event);
13913
+ const handleClear = (event) => {
13914
+ state.clearSelection(event);
13915
+ onReset?.();
13916
+ };
13913
13917
  const { Control, MenuList, CreateOption } = components;
13914
13918
  return /* @__PURE__ */ jsxs99(
13915
13919
  SelectFieldShell,
@@ -14141,7 +14145,14 @@ function VirtualMenuList(props) {
14141
14145
  if (lastLoadMoreOptionsLengthRef.current === options.length) return;
14142
14146
  lastLoadMoreOptionsLengthRef.current = options.length;
14143
14147
  loadMoreItems();
14144
- }, [virtualItems, options.length]);
14148
+ }, [
14149
+ virtualItems,
14150
+ options.length,
14151
+ canLoadMore,
14152
+ isLoadingMore,
14153
+ loadMoreItems,
14154
+ loadMoreThreshold
14155
+ ]);
14145
14156
  React51.useEffect(() => {
14146
14157
  const changed = previousHighlightedIndexRef.current !== highlightedIndex;
14147
14158
  previousHighlightedIndexRef.current = highlightedIndex;
@@ -14317,14 +14328,7 @@ function InfiniteScrollSelectInternal(props, ref) {
14317
14328
  if (synthetic) list = [synthetic, ...list];
14318
14329
  }
14319
14330
  return list;
14320
- }, [
14321
- rawOptions,
14322
- inputValue,
14323
- filterOption,
14324
- getFullSearchOption,
14325
- rest.getValueLabel,
14326
- props
14327
- ]);
14331
+ }, [rawOptions, inputValue, filterOption, getFullSearchOption, props, rest]);
14328
14332
  const contextValue = React52.useMemo(
14329
14333
  () => ({
14330
14334
  canLoadMore,
@@ -14388,13 +14392,7 @@ function hasPaginationProps(props) {
14388
14392
  return props.canLoadMore !== void 0 || props.isLoadingMore !== void 0 || props.loadMoreItems !== void 0 || props.onSearchChange !== void 0 || props.getFullSearchOption !== void 0;
14389
14393
  }
14390
14394
  function SearchingSelectInternal(props, ref) {
14391
- const {
14392
- trigger,
14393
- components: userComponents,
14394
- searchPlaceholder,
14395
- searchable = true,
14396
- ...rest
14397
- } = props;
14395
+ const { trigger, components: userComponents, searchable = true, ...rest } = props;
14398
14396
  const Control = React53.useMemo(() => {
14399
14397
  if (trigger) return makeTriggerSlot(trigger);
14400
14398
  return StaticControl;
@@ -14861,7 +14859,7 @@ function SelectCheckboxesInternal(props, ref) {
14861
14859
  paginationAndRest
14862
14860
  );
14863
14861
  const [inputValue, setInputValue] = React59.useState("");
14864
- const selected = value ?? [];
14862
+ const selected = React59.useMemo(() => value ?? [], [value]);
14865
14863
  const flatRawOptions = React59.useMemo(
14866
14864
  () => flattenGroupedOptions(rawOptions),
14867
14865
  [rawOptions]
@@ -15931,7 +15929,7 @@ var Datepicker = React63.forwardRef(
15931
15929
  React63.useImperativeHandle(
15932
15930
  ref,
15933
15931
  () => dayInputRef.current ?? mobileTriggerRef.current,
15934
- [isMobile3]
15932
+ []
15935
15933
  );
15936
15934
  React63.useEffect(() => {
15937
15935
  if (!isControlled) return;