
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
react-rsql-query-builder
Advanced tools
Component for create rsql filters.
Basic sample.
import React from 'react'
import 'react-rsql-query-builder/styles.css'
import ReactRsqlFilterBuilder, { Field } from 'react-rsql-query-builder'
const Filter: React.FC = () => {
const [search, setSearch] = useState<ExpressionNode | undefined>(undefined)
const fields: Field[] = [
{ selector: 'name', label: 'Name', type: 'string' },
{ selector: 'age', label: 'Age', type: 'number' },
{
selector: 'status',
label: 'Status',
type: 'array',
options: [
{ label: 'Active', value: 'active' },
{ label: 'Deactivate', value: 'deactivate' },
{ label: 'Pending', value: 'pending' }
]
}
]
return (
<ReactRsqlFilterBuilder
search={search}
setSearch={setSearch}
fields={fields}
language="en"
/>
)
}
Props
ExpressionNode | undefined
from lib @rsql/ast.(search?: ExpressionNode) => undefined
.string
).string
).equals
, notEquals
, contains
, notContains
, moreThan
, moreThanOrEqual
, lessThan
, lessThanOrEqual
, in
, out
.string
, number
, date
, boolean
, array
.type
is array
, not necessary if type
is other value.
string
).T
default string
).string
default en
).ButtonHTMLAttributes<HTMLButtonElement>
is optional, you can use your component button of your library.InputHTMLAttributes<HTMLInputElement>
is optional, you can use your component input of your library.InputHTMLAttributes<HTMLInputElement>
is optional, you can use your component checkbox of your library.SelectProps<T = string>
is optional, you can use your component select of your library.
Option<T = string> = { label: string; value: T }
).Option
).items
(type (value: T) => void
).string
).The library also supports a composition pattern approach, which gives you more flexibility and control over the component structure. This is an alternative way to use the library, and you can choose either this approach or the basic usage shown above.
import React from 'react'
import 'react-rsql-query-builder/styles.css'
import {
FilterRoot,
FilterTriggerContent,
FilterTrigger,
AppliedFiltersList,
type FilterProps
} from 'react-rsql-query-builder'
const Filter: React.FC<FilterProps> = (props) => (
<FilterRoot {...props}>
<section className="rsql-main" data-testid="filter-main-section">
<FilterTriggerContent>
<FilterTrigger />
</FilterTriggerContent>
<AppliedFiltersList />
</section>
</FilterRoot>
)
// Then use it like this:
const MyComponent: React.FC = () => {
const [search, setSearch] = useState<ExpressionNode | undefined>(undefined)
const fields: Field[] = [
{ selector: 'name', label: 'Name', type: 'string' },
{ selector: 'age', label: 'Age', type: 'number' }
// ...other fields
]
return (
<Filter
search={search}
setSearch={setSearch}
fields={fields}
language="en"
/>
)
}
Composition Components:
Using the composition pattern allows you to:
For default library have three languages english (en), portuguese (ptBr) and spanish (es), you can specify language do you want with prop language
and you can customize or add language with prop i18n
(Use english translation as example).
Show components.
npm run storybook
FAQs
Customizable RSQL front-end lib for React
We found that react-rsql-query-builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.