File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
pluggableWidgets/datagrid-web/src/features
shared/pluggable-widgets-commons/src/selection Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ const defaultProps: SelectActionProps = {
1717 isSelected : ( ) => false
1818} ;
1919
20- export function useOnSelectProps ( selection : SelectionHelper ) : SelectActionProps {
20+ export function useOnSelectProps ( selection : SelectionHelper | undefined ) : SelectActionProps {
2121 return useMemo ( ( ) => {
2222 if ( ! selection ) {
2323 return defaultProps ;
@@ -59,7 +59,7 @@ type SelectionSettings = {
5959 selectionMethod : SelectionMethod ;
6060} ;
6161
62- export function selectionSettings ( props : SelectionProps , helper : SelectionHelper ) : SelectionSettings {
62+ export function selectionSettings ( props : SelectionProps , helper : SelectionHelper | undefined ) : SelectionSettings {
6363 const { itemSelection, itemSelectionMethod, showSelectAllToggle } = props ;
6464 const isDesignMode = typeof itemSelection === "string" ;
6565 const selectionOn = itemSelection !== undefined && itemSelection !== "None" ;
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export function useSelectionHelper(
6565 selection : SelectionSingleValue | SelectionMultiValue | undefined ,
6666 dataSource : ListValue ,
6767 onSelectionChange : ActionValue | undefined
68- ) : SelectionHelper {
68+ ) : SelectionHelper | undefined {
6969 const firstLoadDone = useRef ( false ) ;
7070 useEffect ( ( ) => {
7171 if ( firstLoadDone . current ) {
@@ -78,7 +78,7 @@ export function useSelectionHelper(
7878 }
7979 } , [ dataSource ?. status ] ) ;
8080
81- const selectionHelper = useRef < SelectionHelper > ( undefined ) ;
81+ const selectionHelper = useRef < SelectionHelper | undefined > ( undefined ) ;
8282
8383 if ( selection !== undefined ) {
8484 if ( selection . type === "Single" ) {
@@ -101,5 +101,5 @@ export function useSelectionHelper(
101101
102102export type { SingleSelectionHelper } ;
103103export type { MultiSelectionHelper } ;
104- export type SelectionHelper = SingleSelectionHelper | MultiSelectionHelper | undefined ;
104+ export type SelectionHelper = SingleSelectionHelper | MultiSelectionHelper ;
105105export type MultiSelectionStatus = "none" | "all" | "some" ;
You can’t perform that action at this time.
0 commit comments