Git Product home page Git Product logo

vanilla-fleet-tree's Introduction

vanilla-fleet-tree

Resources:

HTML:

<section class="widgetContainer">
  <header>
    <input type="search" id="txtSearchList" placeholder=" &#xF002; Search..." style="font-family:Arial, FontAwesome">
  </header>
  <section id="fleet-list-tree"></section>
  <footer>
    <button id="btnCollapse" title="Collapse all"><i class="fa fa-caret-right"></i> All</button>
    <button id="btnExpand" title="Expand all"><i class="fa fa-caret-down"></i> All</button>
    <button id="btnVisibility" title="Show/Hide nodes"><i class="fa fa-eye"></i></button>
  </footer>
</section>

CSS:

#container {
  overflow: auto;
}

SCHEMA:

{
  "schema": {
    "type": "object",
    "title": "Settings",
    "properties": {
      "templateSelector": {
        "type": "object",
        "title": "Template selector:",
        "properties": {
          "selector": {
            "title": "Set an attribute",
            "type": "string",
            "default": ""
          }
        }
      },
      "templates": {
        "type": "array",
        "title": "Template set",
        "minItems": 0,
        "items": {
          "title": " ",
          "type": "object",
          "properties": {
            "name": {
              "title": "Template name",
              "type": "string"
            },
            "function": {
              "title": "Template function for node: f(node)",
              "type": "string",
              "default": "return `\r\n<div class=\"search-clue\">\r\n\t${node.text.toLowerCase()} ${node.id.toLowerCase()}\r\n</div>\r\n<div>${node.text}</div>\r\n`;"
            }
          }
        }
      }
    }
  },
  "form": [
    "templateSelector",
    {
      "key": "templates",
      "items": [
        "templates[].name",
        {
          "key": "templates[].function",
          "type": "javascript"
        }
      ]
    }
  ]
}

JAVASCRIPT:

self.onInit = async function() {
  TwinDimensionTree.generate(self.ctx);
  self.onResize();
}

self.onDataUpdated = function() {
}

self.actionSources = function() {
  return {
    'folderNodeSelected': {
      name: 'widget-action.folder-node-selected',
      multiple: false
    },
    'leafNodeSelected': {
      name: 'widget-action.leaf-node-selected',
      multiple: false
    }
  };
}

self.onResize = function() {
}

self.onDestroy = function() {
}

vanilla-fleet-tree's People

Contributors

robertods avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.