@carto/ps-react-ui 4.14.0 → 4.14.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/ps-react-ui",
3
- "version": "4.14.0",
3
+ "version": "4.14.1",
4
4
  "description": "CARTO's Professional Service React Material library",
5
5
  "type": "module",
6
6
  "devDependencies": {
@@ -83,6 +83,19 @@ describe('LassoLayerFiltersUI', () => {
83
83
  ).toBeDefined()
84
84
  })
85
85
 
86
+ it('hides "All selected" while searching', () => {
87
+ setup()
88
+ expect(
89
+ within(dialog()).getByRole('checkbox', { name: 'All selected' }),
90
+ ).toBeDefined()
91
+ fireEvent.change(within(dialog()).getByRole('textbox'), {
92
+ target: { value: 'road' },
93
+ })
94
+ expect(
95
+ within(dialog()).queryByRole('checkbox', { name: 'All selected' }),
96
+ ).toBeNull()
97
+ })
98
+
86
99
  it('does not render when closed', () => {
87
100
  setup({ open: false })
88
101
  expect(screen.queryByRole('dialog')).toBeNull()
@@ -166,25 +166,31 @@ export function LassoLayerFiltersUI({
166
166
  '& .MuiDivider-root': { my: 0 },
167
167
  }}
168
168
  >
169
- <ListItemButton dense sx={rowSx} onClick={toggleAll}>
170
- <ListItemIcon sx={checkboxSlotSx}>
171
- <Checkbox
172
- edge='start'
173
- tabIndex={-1}
174
- disableRipple
175
- sx={{ p: 0.5 }}
176
- checked={allChecked}
177
- indeterminate={!allChecked && someChecked}
178
- inputProps={{ 'aria-labelledby': `${labelId}-all` }}
179
- />
180
- </ListItemIcon>
181
- <ListItemText
182
- id={`${labelId}-all`}
183
- primary={allSelectedLabel}
184
- primaryTypographyProps={{ variant: 'body2' }}
185
- />
186
- </ListItemButton>
187
- <Divider />
169
+ {/* "All selected" master row only makes sense over the full
170
+ list — hide it while a search is narrowing the results. */}
171
+ {!normalized && (
172
+ <>
173
+ <ListItemButton dense sx={rowSx} onClick={toggleAll}>
174
+ <ListItemIcon sx={checkboxSlotSx}>
175
+ <Checkbox
176
+ edge='start'
177
+ tabIndex={-1}
178
+ disableRipple
179
+ sx={{ p: 0.5 }}
180
+ checked={allChecked}
181
+ indeterminate={!allChecked && someChecked}
182
+ inputProps={{ 'aria-labelledby': `${labelId}-all` }}
183
+ />
184
+ </ListItemIcon>
185
+ <ListItemText
186
+ id={`${labelId}-all`}
187
+ primary={allSelectedLabel}
188
+ primaryTypographyProps={{ variant: 'body2' }}
189
+ />
190
+ </ListItemButton>
191
+ <Divider />
192
+ </>
193
+ )}
188
194
  {filtered.length === 0 ? (
189
195
  <Typography variant='body2' color='text.secondary' sx={{ p: 2 }}>
190
196
  {empty}