npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

abstract-component-node

v0.6.29

Published

Abstract vue node component lib. compatibility vue first.

Downloads

14

Readme

virtual-component-node

NPM Version NPM Downloads

npm install abstract-component-node

Provides Classes

ComponentNode

ComponentNode follows Vue's element creation field structure

MetaNode

The MetaNode does not follow any structure.

The structure of the data structure and its fields is your freedom

However, you should be aware that the children field is re created as a child of Node.

And of the JSON fields

__initialKeys
__location
__parent
 
_initialKeys
_location
_parent

These six are reserved, so avoid using them as JSON fields.

Directive

I think this may be useless to you.

Examples

// ComponentNode
import ComponentNode from 'abstract-component-node';

let node = ComponentNode.importFromJSON(JSON, NodeLocationString = '0', ParentNode = null)
// MetaNode
import {MetaNode} from 'abstract-component-node';

let node = MetaNode.importFromJSON(JSON, NodeLocationString = '0', ParentNode = null)

API

ComponentNode

static importFromJSON(JSONObject, NodeLocationString = '0', ParentNode = null) : Node

Deep copy

static importFromHTMLElementNode(HTMLElement, NodeLocationString = '0', ParentNode = null) : Node

static exportToJSON() : JSONObject

Deep copied

strideUpBloodLine(function(Node))

Run the function while climbing the genealogy.

getLinealDescentList() : Array

findByLocation(Location) : Node

visitChildren(function) : Node

Stop visiting and return that node if returned true.

visitRecursive(function) : Boolean

Stop visiting if returned true.

include self to visit target.

appendChild(Node || JSON)

prependChild(Node || JSON)

updateLocationFromMe()

appendChildBefore(Int childIndex, Node || JSON)

appendChildAfter(Int childIndex, Node || JSON)

removeChild(String location) : bool

get location : location string

get parent : parentNode

get children : Node Array

Info : importFromJSON (deep copy) Info : exportToJSON (deep copy)

MetaNode (Extendable)

static importFromJSON(JSONObject, NodeLocationString = '0', ParentNode = null) : Node

Deep Copy

static exportToJSON() : JSONObject

Deep copied

getLinealDescentList() : Array

findByLocation(Location) : Node

visitChildren(function(Node)) : Node

Stop visiting and return that node if returned true.

visitRecursive(function(Node)) : Boolean

Stop visiting if returned true.

include self to visit target.

strideUpBloodLine(function(Node))

Run the function while climbing the genealogy.

appendChild(Node || JSON)

prependChild(Node || JSON)

updateLocationFromMe()

setData(key, data)

appendChildBefore(Int childIndex, Node || JSON)

appendChildAfter(Int childIndex, Node || JSON)

removeChild(String location) : bool

get _location : location string

get _parent : location string

get _children : Node Array

ComponentNode JSON Properties

tag : String
children : [JSONObject...]

classes : { className... : true }
style : { styleName : ... }
attrs,
props,
domProps,
on,
nativeOn,
directives,
scopedSlots,
slot,
nodeValue,

key,
ref,

ComponentNode JSON Sample


{
  "tag" : "_system-grid_",
  "classes" : {
    "test":true
  },
  "props" : {

  },
  "children" : [
    {
      "tag" : "_system-row_",
      "props" : {

      },
      "children" : [
        {
          "tag" : "_system-column_",
          "props": {
            "xs" : 6,
            "sm" : 4
          },
          "classes" : {

          },
          "children" : [

          ]
        },

        {
          "tag" : "_system-column_",
          "props": {
            "xs" : 6,
            "sm" : 8
          },
          "children" : [

          ]
        },

        {
          "tag" : "_system-layer_",
          "props" : {

          },
          "children" : [

          ]
        }
      ]
    },
    {
      "tag" : "_system-row_",
      "props" : {

      },
      "children" : [
        {
          "tag" : "_system-column_",
          "props": {
            "xs" : 12,
            "sm" : 6
          },
          "classes" : {

          },
          "children" : [

          ]
        },

        {
          "tag" : "_system-column_",
          "props": {
            "xs" : 12,
            "sm" : 6
          },
          "children" : [

          ]
        }
      ]
    },

    {
      "tag" : "_system-row_",
      "props" : {

      },
      "children" : [

      ]
    },

    {
      "tag" : "div",
      "props" : {

      },
      "children" : [

      ]
    }
  ]
}

Author

Jinwoong Han ( [email protected] )

License

MIT