Code Monkey home page Code Monkey logo

vue-tree's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vue-tree's Issues

Convert docs to use pandoc

Pandoc may need:

For Github:

  • Add an output directory inside docs
  • Add .nojekyll in the output directory
  • Add output content to .gitignore, except for .nojekyll
  • Add an npm task to build the docs
  • Update sources to work with pandoc
  • Add npm task usage to appveyor.yaml, and have it merge master into gh-pages on releases after docs build
  • Possibly have a default index.html that auto-redirects to the latest version?

Improve documentation

This should include:

  • Proofread, clarify, and get feedback on the main documentation index
  • Add a left nav to the docs to make it easier to find examples/demos
  • Restructure the pandoc template used for the documentation
  • If it makes sense, break down the main doc to separate pages
  • Rework the CSS (something like Jest's docs for code samples)
  • Expand the demos, and possibly unify the demos?

Improve documentation generation

The main issues with documentation are:

  1. Local documentation builds link to the most recent published version of the component instead of the locally built version which (in most cases) you're trying to document
  2. Docs built when a package is published also link to the most recent published version of the component instead of the published version that matches the documentation's version

Child node model not passed correctly to the treeViewNodeAdd event

When emitting treeViewNodeAdd, the TreeViewNode component passes this.childModel instead of just childModel, resulting in a null value always getting passed to the event in $_treeViewNode_onAddChild.

this.$emit('treeViewNodeAdd', this.childModel, this.model, event);

should be

this.$emit('treeViewNodeAdd', childModel, this.model, event);

Allow the name of the property used for a node's children to be specified

Is your feature request related to a problem? Please describe.
Allowing the user to specify which property to use as the child nodes obviates the need to pre-format node data a certain very specific way.

Describe the solution you'd like
Pass in new prop. Handle it.

Describe alternatives you've considered
None.

Additional context
None.

Refactor how radio button groups are handled

Radio button group initialization (basically the selection of a single radio button from a group) is currently done through a hacky radioGroupValues property on the tree. Internally it's fine, but it's not a great UX for anyone who wants to initialize radio button group selection, and there's no external need for it beyond that since the tree exposes a getCheckedRadioButons method.

A new value should be accepted on the tree view spec for a node to indicate it should be initially selected. This will simplify the prop surface of the TreeView component, and hopefully make tree view radio button initialization more intuitive.

IE - click events fail to fire

        if (!event.target.matches("input, .tree-view-node-self-expander, .tree-view-node-self-action")) {
          this.$emit('treeViewNodeClick', this.model, event);
        }

In IE, event.target does not have matches. Fix it.

Add modelDefaults prop to set default values for tree view node model properties

Adding a prop to the treeview that lets a user specify default node values once for all nodes can cut down on the amount of model data creation the user needs to do to populate the treeview. For instance, in a treeview that is all enabled, collapsed, unchecked checkboxes the user could use a modelDefaults of

{
  expandable: true,
  selectable: true,
  input: {
    type: 'checkbox',
  },
  state: {
    expanded: false,
    selected: false,
    input: {
      value: false,
      disabled: false
    }
  }
}

Admittedly. some of this would be handled by the defaults in the treeview implementation itself. However, this would let a user make these explicit without repetition, as well as setting non-default values only once.

A single node model that specifies any of these values would override the defaults provided here.

Allow filtering

Nodes can be searched using the getMatching method on the tree view, but it would be good to have a convenient way to filter the visibility of nodes. This would probably require:

  • A way to set a node's visibility as part of the treeNodeSpec
  • A method to go through the tree nodes (at the TreeView level) to set that visibility based on a provided method

Debouncing of the filtering would be outside the scope of the treeview and would be the responsibility of the caller.

Change tree model so it does not directly modify the user's model

In 1.x the treeview directly manipulates the data model handed in by the user. Clearly this isn't ideal.
The tree data can be made to wrap the user's data and maintain reactivity. Similar to the improvements made in 1.x, properties from the data used in the tree will be specified in the tree/node data.

Something like the following structure may work for a node:

{
  childrenProperty: 'tickets', // See description below
  idProperty: 'guid' , // See description below
  labelProperty: 'text', // See description below
  expandable: true,
  selectable: true,
  ...
  input: {
    type: 'checkbox',
    name: 'checkbox1'
  },
  state: {
    expanded: false,
    selected: false,
    input: {
      value: false,
      disabled: false
    }
  },
  data: { // THIS IS THE USER'S OBJECT
    text: 'Text and words',
    guid: '00000000-0000-0000-0000-00000000',
    tickets: [...],
    ...
  }
},

Each xyzProperty property's value is the name of the prop from data that contains a value to use in the tree. For instance, childrenProperty set to 'tickets' means this node's children are contained in the data.tickets (which must be an array).

The tree can have new props (something like xyzPropertyResolver) that takes a function used to resolve what the prop should be at the time a node's created handler is called if a xyzProperty is not specified for that node. Something like:

(data) => data.text ? 'text' : 'label'

If neither of these are specified, then a default value is used (e.g., 'children').

Create a CONTRIBUTING.md

This basic document should lay out a reasonable blueprint for anyone wishing to contribute to the project, with the expectation that it will be a living document.

Allow the name of the property used as the ID and label to be specified

Is your feature request related to a problem? Please describe.
Allowing the user to specify which properties to use as the label and ID obviates the need to pre-format node data a certain very specific way.

Describe the solution you'd like
Pass in new props. Handle them.

Describe alternatives you've considered
None.

Additional context
None.

Tree steals the focus when mounted

When the treeview is mounted, the watcher for the tree view node's model.treeNodeSpec.focusable fires. This handler actually causes the node to gain focus immediately, which is not what we want when the mount logic is initializing the tree's focused node.

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.