File tree Expand file tree Collapse file tree 4 files changed +24
-8
lines changed
polaris-react/src/components Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' polaris-glints ' : minor
3+ ---
4+
5+ update index table checkbox type
Original file line number Diff line number Diff line change @@ -7,14 +7,18 @@ import type {IndexTableHeadingCheckbox} from '../IndexTable';
77
88import styles from './CheckableButton.scss' ;
99
10+ export interface CheckboxProps
11+ extends Omit < IndexTableHeadingCheckbox , 'checked' > {
12+ checked ?: boolean | 'indeterminate' ;
13+ }
1014export interface CheckableButtonProps {
1115 accessibilityLabel ?: string ;
1216 label ?: string ;
1317 selected ?: boolean | 'indeterminate' ;
1418 disabled ?: boolean ;
1519 onToggleAll ?( ) : void ;
1620 ariaLive ?: 'off' | 'polite' ;
17- checkbox ?: ( props : IndexTableHeadingCheckbox ) => React . ReactNode ;
21+ checkbox ?: ( props : CheckboxProps ) => React . ReactNode ;
1822}
1923
2024export const CheckableButton = forwardRef ( function CheckableButton (
Original file line number Diff line number Diff line change @@ -62,11 +62,19 @@ interface IndexTableSortToggleLabels {
6262 [ key : number ] : IndexTableSortToggleLabel ;
6363}
6464
65- export interface IndexTableHeadingCheckbox {
65+ export interface IndexTableHeadingCheckbox
66+ extends Omit <
67+ React . InputHTMLAttributes < HTMLInputElement > ,
68+ 'type' | 'onChange'
69+ > {
70+ id ?: string ;
6671 label ?: string ;
67- onChange ?: ( checked : boolean ) => unknown ;
68- checked ?: boolean | 'indeterminate' ;
72+ hasError ?: boolean ;
6973 indeterminate ?: boolean ;
74+ checked ?: boolean ;
75+ disabled ?: boolean ;
76+ helpText ?: string ;
77+ onChange ?( newChecked : boolean , id : string ) : void ;
7078}
7179
7280export interface IndexTableBaseProps {
@@ -766,7 +774,7 @@ function IndexTableBase({
766774 { checkbox ?.( {
767775 label : selectAllLabel ,
768776 onChange : handleSelectPage ,
769- checked : bulkSelectState ,
777+ checked : Boolean ( bulkSelectState ) ,
770778 } ) }
771779 </ div >
772780 ) ;
Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ import {Transition} from 'react-transition-group';
44import { classNames } from '../../utilities/css' ;
55import type { Action } from '../../types' ;
66import { UnstyledButton } from '../UnstyledButton' ;
7- import { CheckableButton } from '../CheckableButton' ;
8- import type { IndexTableHeadingCheckbox } from '../IndexTable' ;
7+ import { CheckableButton , CheckboxProps } from '../CheckableButton' ;
98
109import styles from './SelectAllActions.scss' ;
1110
@@ -29,7 +28,7 @@ export interface SelectAllActionsProps {
2928 disabled ?: boolean ;
3029 /** Callback when the select all checkbox is clicked */
3130 onToggleAll ?( ) : void ;
32- checkbox ?: ( props : IndexTableHeadingCheckbox ) => React . ReactNode ;
31+ checkbox ?: ( props : CheckboxProps ) => React . ReactNode ;
3332}
3433
3534export const SelectAllActions = forwardRef ( function SelectAllActions (
You can’t perform that action at this time.
0 commit comments