Skip to content

Picker selection control bar and toggle all items functionality #3557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3fe8e8d
Picker selection control bar and toggle all items functionality
adids1221 Mar 6, 2025
c0c0abd
Merge branch 'master' into feat/Picker_selection_control_bar
M-i-k-e-l Mar 11, 2025
81ee794
Refactor PickerScreen layout
adids1221 Mar 17, 2025
fb6f149
Rename PickerSelectionControlBar to PickerSelectionStatusToolbar and …
adids1221 Mar 17, 2025
557cc54
Enhance selection status label functionality in PickerSelectionStatus…
adids1221 Mar 17, 2025
fa26403
Refactor PickerSelectionStatusToolbar and types for improved selectio…
adids1221 Mar 17, 2025
ed00693
Remove 'none' option from select all types in Picker and update relat…
adids1221 Mar 17, 2025
f589ba1
Fix types issue in PickerItemsList
adids1221 Mar 17, 2025
c612817
Refactor toggleAllItemsSelection and availableItems usage
adids1221 Mar 17, 2025
24e1569
Remove customLabel prop from PickerSelectionStatusProps
adids1221 Mar 17, 2025
a07a980
Add renderTopCustomElement and renderBottomCustomElement props to Pic…
adids1221 Mar 17, 2025
2b71bbb
Rename getLabel prop to getSelectionStatusLabe and update related usages
adids1221 Mar 18, 2025
a87e350
Refactor selectionStatus handling in PickerItemsList
adids1221 Mar 18, 2025
3c4dc79
Remove unnecessary null return in renderLabel
adids1221 Mar 18, 2025
23f0fec
Remove renderTopCustomElement prop
adids1221 Mar 18, 2025
59af447
Rename _onSegmentChange to onSegmentChange
adids1221 Mar 18, 2025
171e20b
Fix TypeScript ignore directive for selectAllType in Picker
adids1221 Mar 18, 2025
2d4d7d4
Update buttonProps onPress parameter to use selectionValue and set de…
adids1221 Mar 18, 2025
cdb80a2
Refactor Picker selection logic to use areAllItemsSelected and simpli…
adids1221 Mar 18, 2025
91aa052
Rename getSelectionStatusLabel to getLabel and update type definition…
adids1221 Mar 20, 2025
f76d7f8
Remove renderBottomCustomElement prop and add divider in PickerSelect…
adids1221 Mar 20, 2025
a93f066
Refactor Picker component to remove PickerSelectAllType enum
adids1221 Mar 20, 2025
9d75b2b
Refactor PickerSelectionStatusToolbar to simplify props and selection…
adids1221 Mar 20, 2025
f0ef350
Rename PickerSelectionStatusToolbar to PickerSelectionStatusBar and u…
adids1221 Mar 20, 2025
7d2086d
Update buttonProps onPress to use customValue instead of selectionVal…
adids1221 Mar 20, 2025
de9f42f
Add selectAllType prop to PickerSelectionStatusBar for flexible selec…
adids1221 Mar 20, 2025
45bca54
Refactor PickerSelectionStatusBar to remove selectAllType prop and si…
adids1221 Mar 20, 2025
0b584ff
Fix type assertion for value in PickerSelectionStatusBar to ensure co…
adids1221 Mar 20, 2025
dafe4f0
Refactor renderSelectionStatus, fix when showLabel is false
adids1221 Mar 20, 2025
34d7710
Add PickerSelectionStatusProps import to PickerScreen and index files
adids1221 Mar 23, 2025
5735e78
Remove unused setMultiFinalValue from usePickerSelection hook
adids1221 Mar 23, 2025
4abcfd7
Remove value from PickerSelectionStatusLabelData
adids1221 Mar 23, 2025
373e9d4
selectedCount moved to usePickerSelection
adids1221 Mar 24, 2025
40790cd
PickerSelectionStatusBar simplify selectedCount
adids1221 Mar 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update buttonProps onPress parameter to use selectionValue and set de…
…fault selectAllType to 'button'
  • Loading branch information
adids1221 committed Mar 18, 2025
commit 2d4d7d4304474fa0c9d364673fd27c7100a44df8
2 changes: 1 addition & 1 deletion demo/src/screens/componentScreens/PickerScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const dropdownIcon = <Icon source={dropdown} tintColor={Colors.$iconDefault}/>;
const selectAllSegment = [{label: Picker.selectAllType.button}, {label: Picker.selectAllType.checkbox}];

const buttonProps = {
onPress: (items: any) => console.log('onPress', items)
onPress: (selectionValue: any) => console.log('onPress', selectionValue)
};

const checkboxProps = {
Expand Down
4 changes: 2 additions & 2 deletions src/components/picker/PickerSelectionStatusToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function PickerSelectionStatusToolbar(props: PickerSelectionStatu
containerStyle,
getSelectionStatusLabel,
availableItems = [],
selectAllType = 'none',
selectAllType = 'button',
showLabel = true,
toggleAllItemsSelection,
value = [],
Expand Down Expand Up @@ -54,7 +54,7 @@ export default function PickerSelectionStatusToolbar(props: PickerSelectionStatu
const handlePress = useCallback(() => {
const newSelectionState = !isAllSelected;
toggleAllItemsSelection?.(newSelectionState);
buttonProps?.onPress?.(availableItems);
buttonProps?.onPress?.({selectionValue: newSelectionState});
checkboxProps?.onValueChange?.(newSelectionState);
}, [isAllSelected, toggleAllItemsSelection, availableItems, buttonProps, checkboxProps]);

Expand Down