
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@stenajs-webui/filter
Advanced tools
This package contains components and functionality that makes it easy to create custom filters in a drawer, and an overview row containing chips.
This package is alpha. API:s will most likely change, and more features added. If you use it, be ready for breaking changes.
A section is one expandable part of the filter. The filter can consist of many sections. Each section can how none, one or many chips.
The filter components access state, dispatch and actions. These are fetched from context, so any filter components must be wrapped with
<SearchFilterContext actions={actions} state={state} dispatch={dispatch}>
<SearchFilterButton/>
<SearchFilterChips>
<SectionChips {...stuff} />
</SearchFilterChips>
<SearchFilterDrawer>
... sections
</SearchFilterDrawer>
If you are only using local state (no Redux, persistence, etc),
you can use SearchFilterLocalStateContext
.
It will automatically setup actions, state and dispatch.
<SearchFilterLocalStateContext<FormModel>
initialFormModel={{ startDate: undefined, endDate: undefined }}
>
... same as above
</SearchFilterLocalStateContext>
If you use SearchFilterLocalStateContext
, you can use this to access filter state.
const state = useSearchFilterState();
You can create custom sections easily.
const MySection = (...props) => (
<SearchFilterSection sectionId={sectionId} loading={loading} error={error}>
<ChipMultiSelect
options={filteredOptions}
value={listValue}
onValueChange={onValueChangeInternal}
inputValue={text}
onInputChange={setText}
/>
</SearchFilterSection>
);
See source code for examples.
There are sections available ready to use.
More will be made available as the filter
package matures.
Add the section to the drawer.
<DateRangeCalendarSection
sectionId={"comparisonDate"}
{...createDateRangeSectionProps(state.formModel, "startDate", "endDate")}
/>
And add the chips.
<SectionChips
sectionId={"comparisonDate"}
emptyChipLabel={"No dates"}
{...createChipsPropsForDateRange(state.formModel, "startDate", "endDate")}
/>
Add the section to the drawer. This section does not have a helper method for creating props.
They must be specified manually. This might change.
<ChipMultiSelectSection
sectionId={"divisions"}
loading={false}
options={divisionOptions}
value={state.formModel.divisions}
onValueChange={(divisions) =>
dispatch(actions.setFormModelFields({ divisions }))
}
/>
And add the chips.
<SectionChips
sectionId={"divisions"}
emptyChipLabel={"All division"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"divisions",
divisionOptions
)}
/>
In this example, state.formModel.divisions
must be a BooleanRecord
.
Another section for BooleanRecord
is SimpleCheckboxListSection
.
They are API compatible and are interchangeable.
<SimpleCheckboxListSection
sectionId={"divisions"}
loading={false}
options={divisionOptions}
value={state.formModel.divisions}
onValueChange={(divisions) =>
dispatch(actions.setFormModelFields({ divisions }))
}
/>
You can add all chips for a section using the SectionChips
component.
<SectionChips
sectionId={"divisions"}
emptyChipLabel={"All division"}
{...createChipsPropsForBooleanRecord(
state.formModel,
"divisions",
divisionOptions
)}
/>
If you need more manual control over each chip, you can add them individually.
{
myList.map(({ value, label }) => (
<SearchFilterChip
key={value}
label={label ?? sectionId}
sectionId={sectionId}
onClickRemove={onClickRemoveOnChip}
value={value}
/>
));
}
If you need a chip to indicate no selection, you can use EmptyChip
.
<EmptyChip sectionId={sectionId} label={emptyChipLabel} />
v21.24.0 (Wed Nov 27 2024)
@stenajs-webui/modal
FAQs
Unknown package
The npm package @stenajs-webui/filter receives a total of 114 weekly downloads. As such, @stenajs-webui/filter popularity was classified as not popular.
We found that @stenajs-webui/filter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.