@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
|
@@ -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
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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}
|