-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Description
Enhancement: Allow String Arrays as Values in Solo Feature
Summary
Currently, the solo prop accepts an object where each property can only have a single string value for filtering. This enhancement request proposes extending the Solo Feature to support string arrays as property values, enabling multi-value filtering within a single solo object.
Current Behavior
The solo parameter currently accepts:
- Type:
object - Description: item that should be displayed solo
- Default:
null
Current Usage:
// Only single values supported per property
solo={{ firstName: 'John', state: 'NY' }}Proposed Enhancement
Extend the solo object properties to accept both single strings and string arrays:
Single Value (Current - Maintained)
solo={{
firstName: 'John',
state: 'NY'
}}Array Values (New Feature)
solo={{
firstName: ['John', 'Jane', 'Bob'],
state: ['NY', 'CA']
}}Mixed Values (New Capability)
solo={{
firstName: ['John', 'Jane'], // Multiple values
department: 'Engineering', // Single value
state: ['NY', 'CA', 'TX'] // Multiple values
}}Use Cases
This enhancement would be valuable for:
- Multi-Value Filtering: Display rows matching any of several values for a given property
- Category Analysis: Filter by multiple dimensions simultaneously
- Flexible Data Exploration: Allow users to select multiple filter values without complex query building
- Comparative Analysis: Compare data across multiple related values (e.g., different product categories)
Technical Implementation
Filtering Logic
The enhancement would apply OR logic within each property's array:
// This solo configuration:
solo={{
state: ['NY', 'CA'],
department: ['Sales', 'Marketing']
}}
// Would match rows where:
// (state === 'NY' OR state === 'CA') AND (department === 'Sales' OR department === 'Marketing')Benefits
- Enhanced Flexibility: Support complex filtering scenarios with simple configuration
- Improved User Experience: Enable multi-select filtering without complex UI components
- Backward Compatibility: Zero breaking changes for existing implementations
- Intuitive API: Natural extension of the current solo object structure
- Performance: Efficient filtering without multiple component re-renders
Implementation Considerations
Array Handling
- Empty arrays should be treated as "match nothing" for that property
- Single-item arrays should behave identically to single string values
- Mixed data types within arrays should be handled gracefully (convert to strings)
Edge Cases
solo={{ state: [] }}- should filter out all rowssolo={{ state: [''] }}- should match rows with empty/null state valuessolo={{ state: null }}- should be ignored (current behavior)
This enhancement maintains the simplicity of the current Solo Feature while significantly expanding its filtering capabilities through intuitive array support.
Metadata
Metadata
Assignees
Labels
No labels