Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flat-tree-builder

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flat-tree-builder

A package for building tree structures from postgres ltree data

  • 1.5.28
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Classifier

Only for es module, only for Postgres ltree data

Testing

npm i
npm t

Integration

Download

npm i flat-tree-builder

html

  • Create an element on the page where the element will be embedded, assign an id to the element

js

  • Import the Classifier class from classifier.js
  • Create an instance of the Classifier class, where the first parameter is the item id and the second parameter is the object with the parameters

css

  • Connect the classifier.css file
  • Connect bootstrap

Params object

  • getUrl: url for get
  • postClassifierUrl: url for post
  • delUrl: url for delete, default: postClassifierUrl
  • selectedIds: array of id's to be drawn initially
  • path: tree line, default: 'tree_path'
  • search: if the classifier is used for searching, type: Boolean, default: false
  • test: run with test data, type: Boolean, default: false
  • draggable: ability to drag and drop list items, type: Boolean, default: false
  • isRootSelectable: ability to select a root classifier, type: Boolean, default: true

Example


<link
  rel="stylesheet"
  href="./node_modules/bootstrap/dist/css/bootstrap.min.css"
/>
<link rel="stylesheet" href="./node_modules/flat-tree-builder/classifier.css" />

<div id="test"></div>
import Classifier from "flat-tree-builder";

const classifier = new Classifier("#test", {
  test: true,
  search: true,
});

API

  • toggleManual(id) - open or close the classifier with the passed id
  • fillModalForm(text) - fill the field in the modal window with text from the parameters
  • clickModalBtn() - simulates clicking the send button in a modal window
  • getModalFormValue() - gets a string from a form in a modal window
  • findById(id) - returns html element bound to id

FAQs

Package last updated on 11 Jun 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc