New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

filtex-ui

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filtex-ui

The Filtex library is a versatile tool designed to filtering data across various sources like PostgreSQL, MongoDB, and in-memory datasets. This library empowers developers to create complex queries using both JSON and text formats, generating expressions

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Filtex

The Filtex library is a versatile tool designed to filtering data across various sources like PostgreSQL, MongoDB, and in-memory datasets. This library empowers developers to create complex queries using both JSON and text formats, generating expressions compatible with the target data sources.

It allows to configure your dataset with some options and provides a metadata model to be able to use in UI components and then it accepts the query that is generated by UI and generates query for data sources like Postgres, Mongo etc.

Check the packages for other platforms.

  • filtex-go
  • filtex-net
  • filtex-js

Setup

npm install filtex-ui

Usage

Configure

const [themes, setThemes] = useState([]);
const [theme, setTheme] = useState('dark');
const [modes, setModes] = useState(['text', 'tree']);
const [mode, setMode] = useState('text');
const [value, setValue] = useState(null);
const [metadata, setMetadata] = useState(null);
const [data, setData] = useState([]);

// Fetch metadata model from backend
useEffect(() => {
    const data = await fetch('/metadata');
    setMetadata(data);
}, []);

// Send query to backend
const handleSubmit = (value) => {
    const data = await fetch('/filter?query=' + value.text);
    setData(data);
};

Render

import { Filtex } from 'filtex-ui';

<Filtex
    metadata={metadata}
    themes={themes}
    theme={theme}
    modes={modes}
    mode={mode}
    hideMenuButton={false}
    hideSubmitButton={false}
    hideResetButton={false}
    hideSwitchButton={false}
    autoSubmitEnabled={true}
    value={value}
    onSubmit={handleSubmit} />

{JSON.stringify(data, null, 4)}

License

This library is licensed under the MIT License.

FAQs

Package last updated on 08 Jan 2024

Did you know?

Socket

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.

Install

Related posts