@bsol-oss/react-datatable5 12.0.0-beta.85 → 12.0.0-beta.86

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
@@ -4250,7 +4250,7 @@ const EnumPicker = ({ column, isMultiple = false, schema, prefix, showTotalAndLi
4250
4250
  }) })), jsxRuntime.jsxs(react.Combobox.Root, { collection: collection, value: currentValue, onValueChange: handleValueChange, onInputValueChange: handleInputValueChange, multiple: isMultiple, closeOnSelect: !isMultiple, openOnClick: true, invalid: !!errors[colLabel], width: "100%", children: [jsxRuntime.jsxs(react.Combobox.Control, { children: [jsxRuntime.jsx(react.Combobox.Input, { placeholder: enumPickerLabels?.typeToSearch ?? formI18n.t('type_to_search') }), jsxRuntime.jsxs(react.Combobox.IndicatorGroup, { children: [!isMultiple && currentValue.length > 0 && (jsxRuntime.jsx(react.Combobox.ClearTrigger, { onClick: () => {
4251
4251
  setValue(colLabel, '');
4252
4252
  } })), jsxRuntime.jsx(react.Combobox.Trigger, {})] })] }), jsxRuntime.jsx(react.Portal, { children: jsxRuntime.jsx(react.Combobox.Positioner, { children: jsxRuntime.jsxs(react.Combobox.Content, { children: [showTotalAndLimit && (jsxRuntime.jsx(react.Text, { p: 2, fontSize: "sm", color: "fg.muted", children: `${enumPickerLabels?.total ?? formI18n.t('total')}: ${collection.items.length}` })), collection.items.length === 0 ? (jsxRuntime.jsx(react.Combobox.Empty, { children: enumPickerLabels?.emptySearchResult ??
4253
- formI18n.t('empty_search_result') })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: collection.items.map((item) => (jsxRuntime.jsxs(react.Combobox.Item, { item: item, children: [jsxRuntime.jsx(react.Combobox.ItemText, { children: item.label }), jsxRuntime.jsx(react.Combobox.ItemIndicator, {})] }, item.value))) }))] }) }) })] })] }));
4253
+ formI18n.t('empty_search_result') })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: collection.items.map((item, index) => (jsxRuntime.jsxs(react.Combobox.Item, { item: item, children: [jsxRuntime.jsx(react.Combobox.ItemText, { children: item.label }), jsxRuntime.jsx(react.Combobox.ItemIndicator, {})] }, item.value ?? `item-${index}`))) }))] }) }) })] })] }));
4254
4254
  };
4255
4255
 
4256
4256
  function isEnteringWindow(_ref) {
@@ -5045,6 +5045,7 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5045
5045
  const isRequired = required?.some((columnId) => columnId === column);
5046
5046
  const { table, column: column_ref, display_column, customQueryFn, } = foreign_key;
5047
5047
  const [searchText, setSearchText] = React.useState('');
5048
+ const [debouncedSearchText, setDebouncedSearchText] = React.useState('');
5048
5049
  const [limit] = React.useState(50); // Increased limit for combobox
5049
5050
  const colLabel = formI18n.colLabel;
5050
5051
  const watchedValue = watch(colLabel);
@@ -5070,13 +5071,20 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5070
5071
  : currentId
5071
5072
  ? [currentId]
5072
5073
  : [];
5074
+ // Debounce search text to avoid too many API calls
5075
+ React.useEffect(() => {
5076
+ const timer = setTimeout(() => {
5077
+ setDebouncedSearchText(searchText);
5078
+ }, 300);
5079
+ return () => clearTimeout(timer);
5080
+ }, [searchText]);
5073
5081
  // Query for search results (async loading)
5074
5082
  const query = reactQuery.useQuery({
5075
- queryKey: [`idpicker`, { column, searchText, limit }],
5083
+ queryKey: [`idpicker`, { column, searchText: debouncedSearchText, limit }],
5076
5084
  queryFn: async () => {
5077
5085
  if (customQueryFn) {
5078
5086
  const { data, idMap } = await customQueryFn({
5079
- searching: searchText ?? '',
5087
+ searching: debouncedSearchText ?? '',
5080
5088
  limit: limit,
5081
5089
  offset: 0,
5082
5090
  });
@@ -5087,7 +5095,7 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5087
5095
  }
5088
5096
  const data = await getTableData({
5089
5097
  serverUrl,
5090
- searching: searchText ?? '',
5098
+ searching: debouncedSearchText ?? '',
5091
5099
  in_table: table,
5092
5100
  limit: limit,
5093
5101
  offset: 0,
@@ -5109,6 +5117,7 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5109
5117
  staleTime: 300000,
5110
5118
  });
5111
5119
  // Query for currently selected items (to display them properly)
5120
+ // This query is needed for side effects (populating idMap) even though the result isn't directly used
5112
5121
  reactQuery.useQuery({
5113
5122
  queryKey: [
5114
5123
  `idpicker-default`,
@@ -5163,6 +5172,8 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5163
5172
  });
5164
5173
  const { isLoading, isFetching, data, isPending, isError } = query;
5165
5174
  const dataList = data?.data ?? [];
5175
+ // Check if we're currently searching (user typed but debounce hasn't fired yet)
5176
+ const isSearching = searchText !== debouncedSearchText;
5166
5177
  // Transform data for combobox collection
5167
5178
  const comboboxItems = React.useMemo(() => {
5168
5179
  return dataList.map((item) => ({
@@ -5196,25 +5207,19 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5196
5207
  setValue(colLabel, details.value[0] || '');
5197
5208
  }
5198
5209
  };
5199
- // Debounce search to avoid too many API calls and update collection after data loads
5200
- React.useEffect(() => {
5201
- const timer = setTimeout(() => {
5202
- if (searchText !== undefined) {
5203
- query.refetch();
5204
- }
5205
- }, 300);
5206
- return () => clearTimeout(timer);
5207
- }, [searchText, query]);
5208
5210
  // Update collection and filter when data changes
5209
5211
  React.useEffect(() => {
5210
- if (dataList.length > 0) {
5212
+ if (dataList.length > 0 && comboboxItems.length > 0) {
5211
5213
  set(comboboxItems);
5212
- // Apply filter to the collection
5214
+ // Apply filter to the collection using the immediate searchText for UI responsiveness
5213
5215
  if (searchText) {
5214
5216
  filter(searchText);
5215
5217
  }
5216
5218
  }
5217
- }, [dataList, comboboxItems, set, filter, searchText]);
5219
+ // Only depend on dataList and searchText, not comboboxItems (which is derived from dataList)
5220
+ // set and filter are stable functions from useListCollection
5221
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5222
+ }, [dataList, searchText]);
5218
5223
  return (jsxRuntime.jsxs(Field, { label: formI18n.label(), required: isRequired, alignItems: 'stretch', gridColumn,
5219
5224
  gridRow, errorText: errors[`${colLabel}`] ? formI18n.required() : undefined, invalid: !!errors[colLabel], children: [isMultiple && currentValue.length > 0 && (jsxRuntime.jsx(react.Flex, { flexFlow: 'wrap', gap: 1, mb: 2, children: currentValue.map((id) => {
5220
5225
  const item = idMap[id];
@@ -5227,14 +5232,15 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5227
5232
  }, children: !!renderDisplay === true
5228
5233
  ? renderDisplay(item)
5229
5234
  : item[display_column] }, id));
5230
- }) })), jsxRuntime.jsxs(react.Combobox.Root, { collection: collection, value: currentValue, onValueChange: handleValueChange, onInputValueChange: handleInputValueChange, multiple: isMultiple, closeOnSelect: !isMultiple, openOnClick: true, invalid: !!errors[colLabel], width: "100%", children: [jsxRuntime.jsxs(react.Combobox.Control, { children: [jsxRuntime.jsx(react.Combobox.Input, { placeholder: idPickerLabels?.typeToSearch ?? formI18n.t('type_to_search') }), jsxRuntime.jsxs(react.Combobox.IndicatorGroup, { children: [(isFetching || isLoading || isPending) && (jsxRuntime.jsx(react.Spinner, { size: "xs" })), isError && (jsxRuntime.jsx(react.Icon, { color: "fg.error", children: jsxRuntime.jsx(bi.BiError, {}) })), !isMultiple && currentValue.length > 0 && (jsxRuntime.jsx(react.Combobox.ClearTrigger, { onClick: () => {
5235
+ }) })), jsxRuntime.jsxs(react.Combobox.Root, { collection: collection, value: currentValue, onValueChange: handleValueChange, onInputValueChange: handleInputValueChange, multiple: isMultiple, closeOnSelect: !isMultiple, openOnClick: true, invalid: !!errors[colLabel], width: "100%", children: [jsxRuntime.jsxs(react.Combobox.Control, { children: [jsxRuntime.jsx(react.Combobox.Input, { placeholder: idPickerLabels?.typeToSearch ?? formI18n.t('type_to_search') }), jsxRuntime.jsxs(react.Combobox.IndicatorGroup, { children: [(isFetching || isLoading || isPending) && jsxRuntime.jsx(react.Spinner, { size: "xs" }), isError && (jsxRuntime.jsx(react.Icon, { color: "fg.error", children: jsxRuntime.jsx(bi.BiError, {}) })), !isMultiple && currentValue.length > 0 && (jsxRuntime.jsx(react.Combobox.ClearTrigger, { onClick: () => {
5231
5236
  setValue(colLabel, '');
5232
- } })), jsxRuntime.jsx(react.Combobox.Trigger, {})] })] }), jsxRuntime.jsx(react.Portal, { children: jsxRuntime.jsx(react.Combobox.Positioner, { children: jsxRuntime.jsx(react.Combobox.Content, { children: isFetching || isLoading || isPending ? (jsxRuntime.jsxs(react.HStack, { p: 2, justify: "center", children: [jsxRuntime.jsx(react.Spinner, { size: "xs" }), jsxRuntime.jsx(react.Text, { fontSize: "sm", children: idPickerLabels?.loading ?? formI18n.t('loading') })] })) : isError ? (jsxRuntime.jsx(react.Text, { p: 2, color: "fg.error", fontSize: "sm", children: idPickerLabels?.loadingFailed ??
5233
- formI18n.t('loading_failed') })) : collection.items.length === 0 ? (jsxRuntime.jsx(react.Combobox.Empty, { children: searchText
5237
+ } })), jsxRuntime.jsx(react.Combobox.Trigger, {})] })] }), jsxRuntime.jsx(react.Portal, { children: jsxRuntime.jsx(react.Combobox.Positioner, { children: jsxRuntime.jsx(react.Combobox.Content, { children: isError ? (jsxRuntime.jsx(react.Text, { p: 2, color: "fg.error", fontSize: "sm", children: formI18n.t('loading_failed') })) : isFetching || isLoading || isPending || isSearching ? (
5238
+ // Show skeleton items to prevent UI shift
5239
+ jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from({ length: 5 }).map((_, index) => (jsxRuntime.jsx(react.Flex, { p: 2, align: "center", gap: 2, children: jsxRuntime.jsx(react.Skeleton, { height: "20px", flex: "1" }) }, `skeleton-${index}`))) })) : collection.items.length === 0 ? (jsxRuntime.jsx(react.Combobox.Empty, { children: searchText
5234
5240
  ? idPickerLabels?.emptySearchResult ??
5235
5241
  formI18n.t('empty_search_result')
5236
5242
  : idPickerLabels?.initialResults ??
5237
- formI18n.t('initial_results') })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: collection.items.map((item) => (jsxRuntime.jsxs(react.Combobox.Item, { item: item, children: [jsxRuntime.jsx(react.Combobox.ItemText, { children: item.label }), jsxRuntime.jsx(react.Combobox.ItemIndicator, {})] }, item.value))) })) }) }) })] })] }));
5243
+ formI18n.t('initial_results') })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: collection.items.map((item, index) => (jsxRuntime.jsxs(react.Combobox.Item, { item: item, children: [jsxRuntime.jsx(react.Combobox.ItemText, { children: item.label }), jsxRuntime.jsx(react.Combobox.ItemIndicator, {})] }, item.value ?? `item-${index}`))) })) }) }) })] })] }));
5238
5244
  };
5239
5245
 
5240
5246
  const NumberInputRoot = React__namespace.forwardRef(function NumberInput(props, ref) {
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { Button as Button$1, AbsoluteCenter, Spinner, Span, IconButton, Portal, Dialog, Flex, Text, useDisclosure, DialogBackdrop, RadioGroup as RadioGroup$1, Grid, Box, Slider as Slider$1, HStack, For, Tag as Tag$1, Input, Menu, createRecipeContext, createContext as createContext$1, Pagination as Pagination$1, usePaginationContext, CheckboxCard as CheckboxCard$1, Tooltip as Tooltip$1, Group, InputElement, Icon, EmptyState as EmptyState$2, VStack, List, Table as Table$1, Checkbox as Checkbox$1, Card, MenuRoot as MenuRoot$1, MenuTrigger as MenuTrigger$1, Image, Alert, Field as Field$1, Popover, useFilter, useListCollection, Combobox, Tabs, NumberInput, Show, RadioCard, CheckboxGroup, Center, Heading, Skeleton } from '@chakra-ui/react';
2
+ import { Button as Button$1, AbsoluteCenter, Spinner, Span, IconButton, Portal, Dialog, Flex, Text, useDisclosure, DialogBackdrop, RadioGroup as RadioGroup$1, Grid, Box, Slider as Slider$1, HStack, For, Tag as Tag$1, Input, Menu, createRecipeContext, createContext as createContext$1, Pagination as Pagination$1, usePaginationContext, CheckboxCard as CheckboxCard$1, Tooltip as Tooltip$1, Group, InputElement, Icon, EmptyState as EmptyState$2, VStack, List, Table as Table$1, Checkbox as Checkbox$1, Card, MenuRoot as MenuRoot$1, MenuTrigger as MenuTrigger$1, Image, Alert, Field as Field$1, Popover, useFilter, useListCollection, Combobox, Tabs, Skeleton, NumberInput, Show, RadioCard, CheckboxGroup, Center, Heading } from '@chakra-ui/react';
3
3
  import { AiOutlineColumnWidth } from 'react-icons/ai';
4
4
  import * as React from 'react';
5
5
  import React__default, { createContext, useContext, useState, useEffect, useRef, useMemo, forwardRef } from 'react';
@@ -4230,7 +4230,7 @@ const EnumPicker = ({ column, isMultiple = false, schema, prefix, showTotalAndLi
4230
4230
  }) })), jsxs(Combobox.Root, { collection: collection, value: currentValue, onValueChange: handleValueChange, onInputValueChange: handleInputValueChange, multiple: isMultiple, closeOnSelect: !isMultiple, openOnClick: true, invalid: !!errors[colLabel], width: "100%", children: [jsxs(Combobox.Control, { children: [jsx(Combobox.Input, { placeholder: enumPickerLabels?.typeToSearch ?? formI18n.t('type_to_search') }), jsxs(Combobox.IndicatorGroup, { children: [!isMultiple && currentValue.length > 0 && (jsx(Combobox.ClearTrigger, { onClick: () => {
4231
4231
  setValue(colLabel, '');
4232
4232
  } })), jsx(Combobox.Trigger, {})] })] }), jsx(Portal, { children: jsx(Combobox.Positioner, { children: jsxs(Combobox.Content, { children: [showTotalAndLimit && (jsx(Text, { p: 2, fontSize: "sm", color: "fg.muted", children: `${enumPickerLabels?.total ?? formI18n.t('total')}: ${collection.items.length}` })), collection.items.length === 0 ? (jsx(Combobox.Empty, { children: enumPickerLabels?.emptySearchResult ??
4233
- formI18n.t('empty_search_result') })) : (jsx(Fragment, { children: collection.items.map((item) => (jsxs(Combobox.Item, { item: item, children: [jsx(Combobox.ItemText, { children: item.label }), jsx(Combobox.ItemIndicator, {})] }, item.value))) }))] }) }) })] })] }));
4233
+ formI18n.t('empty_search_result') })) : (jsx(Fragment, { children: collection.items.map((item, index) => (jsxs(Combobox.Item, { item: item, children: [jsx(Combobox.ItemText, { children: item.label }), jsx(Combobox.ItemIndicator, {})] }, item.value ?? `item-${index}`))) }))] }) }) })] })] }));
4234
4234
  };
4235
4235
 
4236
4236
  function isEnteringWindow(_ref) {
@@ -5025,6 +5025,7 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5025
5025
  const isRequired = required?.some((columnId) => columnId === column);
5026
5026
  const { table, column: column_ref, display_column, customQueryFn, } = foreign_key;
5027
5027
  const [searchText, setSearchText] = useState('');
5028
+ const [debouncedSearchText, setDebouncedSearchText] = useState('');
5028
5029
  const [limit] = useState(50); // Increased limit for combobox
5029
5030
  const colLabel = formI18n.colLabel;
5030
5031
  const watchedValue = watch(colLabel);
@@ -5050,13 +5051,20 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5050
5051
  : currentId
5051
5052
  ? [currentId]
5052
5053
  : [];
5054
+ // Debounce search text to avoid too many API calls
5055
+ useEffect(() => {
5056
+ const timer = setTimeout(() => {
5057
+ setDebouncedSearchText(searchText);
5058
+ }, 300);
5059
+ return () => clearTimeout(timer);
5060
+ }, [searchText]);
5053
5061
  // Query for search results (async loading)
5054
5062
  const query = useQuery({
5055
- queryKey: [`idpicker`, { column, searchText, limit }],
5063
+ queryKey: [`idpicker`, { column, searchText: debouncedSearchText, limit }],
5056
5064
  queryFn: async () => {
5057
5065
  if (customQueryFn) {
5058
5066
  const { data, idMap } = await customQueryFn({
5059
- searching: searchText ?? '',
5067
+ searching: debouncedSearchText ?? '',
5060
5068
  limit: limit,
5061
5069
  offset: 0,
5062
5070
  });
@@ -5067,7 +5075,7 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5067
5075
  }
5068
5076
  const data = await getTableData({
5069
5077
  serverUrl,
5070
- searching: searchText ?? '',
5078
+ searching: debouncedSearchText ?? '',
5071
5079
  in_table: table,
5072
5080
  limit: limit,
5073
5081
  offset: 0,
@@ -5089,6 +5097,7 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5089
5097
  staleTime: 300000,
5090
5098
  });
5091
5099
  // Query for currently selected items (to display them properly)
5100
+ // This query is needed for side effects (populating idMap) even though the result isn't directly used
5092
5101
  useQuery({
5093
5102
  queryKey: [
5094
5103
  `idpicker-default`,
@@ -5143,6 +5152,8 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5143
5152
  });
5144
5153
  const { isLoading, isFetching, data, isPending, isError } = query;
5145
5154
  const dataList = data?.data ?? [];
5155
+ // Check if we're currently searching (user typed but debounce hasn't fired yet)
5156
+ const isSearching = searchText !== debouncedSearchText;
5146
5157
  // Transform data for combobox collection
5147
5158
  const comboboxItems = useMemo(() => {
5148
5159
  return dataList.map((item) => ({
@@ -5176,25 +5187,19 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5176
5187
  setValue(colLabel, details.value[0] || '');
5177
5188
  }
5178
5189
  };
5179
- // Debounce search to avoid too many API calls and update collection after data loads
5180
- useEffect(() => {
5181
- const timer = setTimeout(() => {
5182
- if (searchText !== undefined) {
5183
- query.refetch();
5184
- }
5185
- }, 300);
5186
- return () => clearTimeout(timer);
5187
- }, [searchText, query]);
5188
5190
  // Update collection and filter when data changes
5189
5191
  useEffect(() => {
5190
- if (dataList.length > 0) {
5192
+ if (dataList.length > 0 && comboboxItems.length > 0) {
5191
5193
  set(comboboxItems);
5192
- // Apply filter to the collection
5194
+ // Apply filter to the collection using the immediate searchText for UI responsiveness
5193
5195
  if (searchText) {
5194
5196
  filter(searchText);
5195
5197
  }
5196
5198
  }
5197
- }, [dataList, comboboxItems, set, filter, searchText]);
5199
+ // Only depend on dataList and searchText, not comboboxItems (which is derived from dataList)
5200
+ // set and filter are stable functions from useListCollection
5201
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5202
+ }, [dataList, searchText]);
5198
5203
  return (jsxs(Field, { label: formI18n.label(), required: isRequired, alignItems: 'stretch', gridColumn,
5199
5204
  gridRow, errorText: errors[`${colLabel}`] ? formI18n.required() : undefined, invalid: !!errors[colLabel], children: [isMultiple && currentValue.length > 0 && (jsx(Flex, { flexFlow: 'wrap', gap: 1, mb: 2, children: currentValue.map((id) => {
5200
5205
  const item = idMap[id];
@@ -5207,14 +5212,15 @@ const IdPicker = ({ column, schema, prefix, isMultiple = false, }) => {
5207
5212
  }, children: !!renderDisplay === true
5208
5213
  ? renderDisplay(item)
5209
5214
  : item[display_column] }, id));
5210
- }) })), jsxs(Combobox.Root, { collection: collection, value: currentValue, onValueChange: handleValueChange, onInputValueChange: handleInputValueChange, multiple: isMultiple, closeOnSelect: !isMultiple, openOnClick: true, invalid: !!errors[colLabel], width: "100%", children: [jsxs(Combobox.Control, { children: [jsx(Combobox.Input, { placeholder: idPickerLabels?.typeToSearch ?? formI18n.t('type_to_search') }), jsxs(Combobox.IndicatorGroup, { children: [(isFetching || isLoading || isPending) && (jsx(Spinner, { size: "xs" })), isError && (jsx(Icon, { color: "fg.error", children: jsx(BiError, {}) })), !isMultiple && currentValue.length > 0 && (jsx(Combobox.ClearTrigger, { onClick: () => {
5215
+ }) })), jsxs(Combobox.Root, { collection: collection, value: currentValue, onValueChange: handleValueChange, onInputValueChange: handleInputValueChange, multiple: isMultiple, closeOnSelect: !isMultiple, openOnClick: true, invalid: !!errors[colLabel], width: "100%", children: [jsxs(Combobox.Control, { children: [jsx(Combobox.Input, { placeholder: idPickerLabels?.typeToSearch ?? formI18n.t('type_to_search') }), jsxs(Combobox.IndicatorGroup, { children: [(isFetching || isLoading || isPending) && jsx(Spinner, { size: "xs" }), isError && (jsx(Icon, { color: "fg.error", children: jsx(BiError, {}) })), !isMultiple && currentValue.length > 0 && (jsx(Combobox.ClearTrigger, { onClick: () => {
5211
5216
  setValue(colLabel, '');
5212
- } })), jsx(Combobox.Trigger, {})] })] }), jsx(Portal, { children: jsx(Combobox.Positioner, { children: jsx(Combobox.Content, { children: isFetching || isLoading || isPending ? (jsxs(HStack, { p: 2, justify: "center", children: [jsx(Spinner, { size: "xs" }), jsx(Text, { fontSize: "sm", children: idPickerLabels?.loading ?? formI18n.t('loading') })] })) : isError ? (jsx(Text, { p: 2, color: "fg.error", fontSize: "sm", children: idPickerLabels?.loadingFailed ??
5213
- formI18n.t('loading_failed') })) : collection.items.length === 0 ? (jsx(Combobox.Empty, { children: searchText
5217
+ } })), jsx(Combobox.Trigger, {})] })] }), jsx(Portal, { children: jsx(Combobox.Positioner, { children: jsx(Combobox.Content, { children: isError ? (jsx(Text, { p: 2, color: "fg.error", fontSize: "sm", children: formI18n.t('loading_failed') })) : isFetching || isLoading || isPending || isSearching ? (
5218
+ // Show skeleton items to prevent UI shift
5219
+ jsx(Fragment, { children: Array.from({ length: 5 }).map((_, index) => (jsx(Flex, { p: 2, align: "center", gap: 2, children: jsx(Skeleton, { height: "20px", flex: "1" }) }, `skeleton-${index}`))) })) : collection.items.length === 0 ? (jsx(Combobox.Empty, { children: searchText
5214
5220
  ? idPickerLabels?.emptySearchResult ??
5215
5221
  formI18n.t('empty_search_result')
5216
5222
  : idPickerLabels?.initialResults ??
5217
- formI18n.t('initial_results') })) : (jsx(Fragment, { children: collection.items.map((item) => (jsxs(Combobox.Item, { item: item, children: [jsx(Combobox.ItemText, { children: item.label }), jsx(Combobox.ItemIndicator, {})] }, item.value))) })) }) }) })] })] }));
5223
+ formI18n.t('initial_results') })) : (jsx(Fragment, { children: collection.items.map((item, index) => (jsxs(Combobox.Item, { item: item, children: [jsx(Combobox.ItemText, { children: item.label }), jsx(Combobox.ItemIndicator, {})] }, item.value ?? `item-${index}`))) })) }) }) })] })] }));
5218
5224
  };
5219
5225
 
5220
5226
  const NumberInputRoot = React.forwardRef(function NumberInput$1(props, ref) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsol-oss/react-datatable5",
3
- "version": "12.0.0-beta.85",
3
+ "version": "12.0.0-beta.86",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -62,10 +62,10 @@
62
62
  "@rollup/plugin-typescript": "^11.1.6",
63
63
  "@storybook/addon-essentials": "^8.4.7",
64
64
  "@storybook/addon-interactions": "^8.4.7",
65
- "@storybook/addon-onboarding": "^8.4.7",
65
+ "@storybook/addon-onboarding": "^10.0.7",
66
66
  "@storybook/blocks": "^8.4.7",
67
- "@storybook/react": "^8.4.7",
68
- "@storybook/react-vite": "^8.4.7",
67
+ "@storybook/react": "^10.0.7",
68
+ "@storybook/react-vite": "^10.0.7",
69
69
  "@storybook/test": "^8.4.7",
70
70
  "@types/ajv-errors": "^2.0.0",
71
71
  "@types/json-schema": "^7.0.15",
@@ -81,12 +81,12 @@
81
81
  "eslint": "^8.57.0",
82
82
  "eslint-plugin-react-hooks": "^4.6.0",
83
83
  "eslint-plugin-react-refresh": "^0.4.6",
84
- "eslint-plugin-storybook": "^0.8.0",
84
+ "eslint-plugin-storybook": "^10.0.7",
85
85
  "husky": "^9.1.7",
86
86
  "lint-staged": "^16.2.5",
87
87
  "prettier": "3.2.5",
88
88
  "rollup-plugin-dts": "^6.1.0",
89
- "storybook": "^8.4.7",
89
+ "storybook": "^10.0.7",
90
90
  "typescript": "^5.2.2",
91
91
  "vite": "^5.2.0"
92
92
  },