freemium-ui 2.0.0-beta.22 → 2.0.0-beta.23
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/index.cjs.js +1 -1
- package/index.d.ts +8 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -3634,7 +3634,7 @@ className:"SelectScrollButton"},e.createElement(rr,{fill:n.colors.text.primary
|
|
|
3634
3634
|
})))))),w&&z&&e.createElement(vc,null,z))
|
|
3635
3635
|
},rm=({itemIdentifier:t="id",label:n,id:r,items:a=[],placeholder:o,readOnly:i=!1,disabled:l=!1,isRequired:c=!1,hideClear:s=!1,itemToString:u,name:d,filterKey:h,width:p,customValues:f,onCustomValueAdd:m,itemComponent:v,emptyItemsText:g,getCustomMessage:y,onChange:b,useComboboxProps:w,isErrored:C,errorText:z,defaultSelectedItem:M,isMenuLoading:x})=>{
|
|
3636
3636
|
const E=qt(),[S,_]=e.useState(a),{isOpen:H,selectedItem:D,getToggleButtonProps:L,getLabelProps:V,getMenuProps:A,openMenu:k,highlightedIndex:T,setHighlightedIndex:R,setInputValue:P,inputValue:I,getItemProps:O,getInputProps:N}=ff({
|
|
3637
|
-
selectedItem:M,items:S,
|
|
3637
|
+
selectedItem:M,items:S,onSelectedItemChange:({selectedItem:e})=>{
|
|
3638
3638
|
console.log("onSelectedItemChange",{sI:e}),b?.(e??null)},
|
|
3639
3639
|
onIsOpenChange:({isOpen:e})=>{
|
|
3640
3640
|
if(e&&(""===I||D&&h&&(I||"").toLowerCase()===`${D?.[h||t]||""}`.toLowerCase()))_(a),
|
package/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { PopperContentProps } from '@radix-ui/react-popover';
|
|
|
6
6
|
import { RadioGroupProps as RadioGroupProps$1, RadioGroupContextValue } from '@radix-ui/react-radio-group';
|
|
7
7
|
import { CheckboxProps as CheckboxProps$1 } from '@radix-ui/react-checkbox';
|
|
8
8
|
import * as Select from '@radix-ui/react-select';
|
|
9
|
-
import { SelectProps } from '@radix-ui/react-select';
|
|
9
|
+
import { SelectProps, SelectItemProps } from '@radix-ui/react-select';
|
|
10
10
|
export { Item as RadixSelectItem } from '@radix-ui/react-select';
|
|
11
11
|
import * as styled_components from 'styled-components';
|
|
12
12
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
@@ -355,6 +355,9 @@ type StyledListItemType = {
|
|
|
355
355
|
isSelected?: boolean;
|
|
356
356
|
isHilighted?: boolean;
|
|
357
357
|
};
|
|
358
|
+
type DropdownInputItemProps = React.LiHTMLAttributes<HTMLLIElement> & StyledListItemType & {
|
|
359
|
+
key: string;
|
|
360
|
+
};
|
|
358
361
|
type PickedSelectProps = Pick<SelectProps, 'name' | 'disabled' | 'value'>;
|
|
359
362
|
interface DropdownProps<T extends DefaultDropdownItem = DefaultDropdownItem> extends PickedSelectProps {
|
|
360
363
|
/**
|
|
@@ -466,7 +469,11 @@ interface DropdownProps<T extends DefaultDropdownItem = DefaultDropdownItem> ext
|
|
|
466
469
|
*
|
|
467
470
|
*/
|
|
468
471
|
useComboboxProps?: UseComboboxProps<T>;
|
|
472
|
+
itemComponent?: (item: T, props?: DropdownItemProps | DropdownInputItemProps) => React.ReactNode | string;
|
|
469
473
|
}
|
|
474
|
+
type DropdownItemProps = SelectItemProps & {
|
|
475
|
+
showTick: boolean;
|
|
476
|
+
};
|
|
470
477
|
|
|
471
478
|
declare const ListItem: styled_components.IStyledComponent<"web", styled_components_dist_types.Substitute<react.DetailedHTMLProps<react.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, StyledListItemType>>;
|
|
472
479
|
|
package/index.js
CHANGED
|
@@ -3624,7 +3624,7 @@ className:"SelectScrollButton"},t.createElement(xr,{fill:n.colors.text.primary
|
|
|
3624
3624
|
})))))),w&&z&&t.createElement(Oc,null,z))
|
|
3625
3625
|
},Dm=({itemIdentifier:e="id",label:n,id:r,items:a=[],placeholder:o,readOnly:i=!1,disabled:l=!1,isRequired:c=!1,hideClear:s=!1,itemToString:u,name:d,filterKey:h,width:p,customValues:f,onCustomValueAdd:m,itemComponent:v,emptyItemsText:g,getCustomMessage:y,onChange:b,useComboboxProps:w,isErrored:C,errorText:z,defaultSelectedItem:M,isMenuLoading:x})=>{
|
|
3626
3626
|
const S=vn(),[E,_]=t.useState(a),{isOpen:H,selectedItem:D,getToggleButtonProps:L,getLabelProps:V,getMenuProps:A,openMenu:k,highlightedIndex:T,setHighlightedIndex:P,setInputValue:I,inputValue:R,getItemProps:O,getInputProps:N}=Nf({
|
|
3627
|
-
selectedItem:M,items:E,
|
|
3627
|
+
selectedItem:M,items:E,onSelectedItemChange:({selectedItem:e})=>{
|
|
3628
3628
|
console.log("onSelectedItemChange",{sI:e}),b?.(e??null)},
|
|
3629
3629
|
onIsOpenChange:({isOpen:t})=>{
|
|
3630
3630
|
if(t&&(""===R||D&&h&&(R||"").toLowerCase()===`${D?.[h||e]||""}`.toLowerCase()))_(a),
|