Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
821851e1ed chore(deps): bump @hapi/hoek from 8.5.0 to 8.5.1
Bumps [@hapi/hoek](https://github.com/hapijs/hoek) from 8.5.0 to 8.5.1.
- [Release notes](https://github.com/hapijs/hoek/releases)
- [Commits](https://github.com/hapijs/hoek/compare/v8.5.0...v8.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-05 03:09:10 +00:00
15 changed files with 15137 additions and 16248 deletions

2
.commitlintrc.yml Normal file
View File

@@ -0,0 +1,2 @@
extends:
- "@commitlint/config-conventional"

3
.czrc Normal file
View File

@@ -0,0 +1,3 @@
{
"path": "cz-conventional-changelog"
}

23
.gitignore vendored
View File

@@ -21,26 +21,3 @@ yarn-error.log*
*.sw?
coverage
# Created by https://www.toptal.com/developers/gitignore/api/yarn
# Edit at https://www.toptal.com/developers/gitignore?templates=yarn
### yarn ###
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.yarn/*
!.yarn/releases
!.yarn/patches
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
# if you are NOT using Zero-installs, then:
# comment the following lines
#!.yarn/cache
# and uncomment the following lines
.pnp.*
# End of https://www.toptal.com/developers/gitignore/api/yarn

3
.huskyrc.yml Normal file
View File

@@ -0,0 +1,3 @@
hooks:
pre-commit: npm run lint-staged
commit-msg: commitlint -E HUSKY_GIT_PARAMS

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +0,0 @@
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
yarnPath: .yarn/releases/yarn-3.2.0.cjs

15112
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "vue-tree-list",
"version": "1.5.0",
"version": "1.4.6",
"description": "A vue component for tree structure. Support adding treenode/leafnode, editing node's name and dragging.",
"author": "ayou",
"scripts": {
@@ -10,9 +10,11 @@
"test:coverage": "vue-cli-service test:unit --coverage",
"lint": "vue-cli-service lint",
"lint-staged": "lint-staged",
"commit": "npx git-cz",
"prepublish": "npm run build"
},
"main": "dist/vue-tree-list.umd.min.js",
"dependencies": {},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
@@ -25,6 +27,7 @@
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-vue": "^5.0.0",
"husky": "^4.2.1",
"jest-serializer-vue": "^2.0.2",
"less": "^3.10.3",
"less-loader": "^5.0.0",
@@ -55,6 +58,5 @@
"repository": {
"type": "git",
"url": "git+https://github.com/ParadeTo/vue-tree-list.git"
},
"packageManager": "yarn@3.2.0"
}
}

View File

@@ -219,7 +219,7 @@ Or just register locally like the example below.
| name | params | description |
| :---------: | :--------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| click | TreeNode | Trigger when clicking a tree node. You can call `toggle` of `TreeNode` to toggle the folder node. |
| click | TreeNode | Trigger when clicking a tree node |
| change-name | {'id', 'oldName', 'newName'} | Trigger after changing a node's name |
| delete-node | TreeNode | Trigger when clicking `delNode` button. You can call `remove` of `TreeNode` to remove the node. |
| add-node | TreeNode | Trigger after adding a new node |

View File

@@ -58,7 +58,7 @@
/>
<div class="vtl-operation" v-show="isHover">
<span
:title="defaultAddTreeNodeTitle"
title="add tree node"
@click.stop.prevent="addChild(false)"
v-if="!model.isLeaf && !model.addTreeNodeDisabled"
>
@@ -67,7 +67,7 @@
</slot>
</span>
<span
:title="defaultAddLeafNodeTitle"
title="add leaf node"
@click.stop.prevent="addChild(true)"
v-if="!model.isLeaf && !model.addLeafNodeDisabled"
>
@@ -162,19 +162,11 @@ export default {
},
defaultLeafNodeName: {
type: String,
default: 'Leaf Node'
default: 'New leaf node'
},
defaultTreeNodeName: {
type: String,
default: 'Tree Node'
},
defaultAddTreeNodeTitle: {
type: String,
default: 'Add Tree Node'
},
defaultAddLeafNodeTitle: {
type: String,
default: 'Add Leaf Node'
default: 'New tree node'
},
defaultExpanded: {
type: Boolean,
@@ -280,10 +272,7 @@ export default {
},
click() {
this.rootNode.$emit('click', {
toggle: this.toggle,
...this.model
})
this.rootNode.$emit('click', this.model)
},
addChild(isLeaf) {

View File

@@ -47,7 +47,7 @@ exports[`Render render correctly 1`] = `
<div class="vtl-node-content">
Node 2
</div>
<div class="vtl-operation" style="display: none;"><span title="Add Tree Node"><i class="vtl-icon vtl-icon-folder-plus-e"></i></span> <span title="Add Leaf Node"><i class="vtl-icon vtl-icon-plus"></i></span> <span title="edit"><i class="vtl-icon vtl-icon-edit"></i></span> <span title="delete"><i class="vtl-icon vtl-icon-trash"></i></span></div>
<div class="vtl-operation" style="display: none;"><span title="add tree node"><i class="vtl-icon vtl-icon-folder-plus-e"></i></span> <span title="add leaf node"><i class="vtl-icon vtl-icon-plus"></i></span> <span title="edit"><i class="vtl-icon vtl-icon-edit"></i></span> <span title="delete"><i class="vtl-icon vtl-icon-trash"></i></span></div>
</div>
<!---->
</div>
@@ -61,7 +61,7 @@ exports[`Render render correctly 1`] = `
<div class="vtl-node-content">
Node 3
</div>
<div class="vtl-operation" style="display: none;"><span title="Add Tree Node"><i class="vtl-icon vtl-icon-folder-plus-e"></i></span> <span title="Add Leaf Node"><i class="vtl-icon vtl-icon-plus"></i></span> <span title="edit"><i class="vtl-icon vtl-icon-edit"></i></span> <span title="delete"><i class="vtl-icon vtl-icon-trash"></i></span></div>
<div class="vtl-operation" style="display: none;"><span title="add tree node"><i class="vtl-icon vtl-icon-folder-plus-e"></i></span> <span title="add leaf node"><i class="vtl-icon vtl-icon-plus"></i></span> <span title="edit"><i class="vtl-icon vtl-icon-edit"></i></span> <span title="delete"><i class="vtl-icon vtl-icon-trash"></i></span></div>
</div>
<!---->
</div>

View File

@@ -11,7 +11,7 @@ exports[`Slot render slot correctly 1`] = `
<div class="vtl-node-content">
Node 1
</div>
<div class="vtl-operation" style="display: none;"><span title="Add Tree Node"><span class="add-tree-node-icon">📂</span></span> <span title="Add Leaf Node"><span class="icon"></span></span> <span title="edit"><span class="icon">📃</span></span> <span title="delete"><span></span></span></div>
<div class="vtl-operation" style="display: none;"><span title="add tree node"><span class="add-tree-node-icon">📂</span></span> <span title="add leaf node"><span class="icon"></span></span> <span title="edit"><span class="icon">📃</span></span> <span title="delete"><span></span></span></div>
</div>
<div class="vtl-border vtl-bottom"></div>
</div>
@@ -42,7 +42,7 @@ exports[`Slot render slot correctly 1`] = `
<div class="vtl-node-content">
Node 2
</div>
<div class="vtl-operation" style="display: none;"><span title="Add Tree Node"><span class="add-tree-node-icon">📂</span></span> <span title="Add Leaf Node"><span class="icon"></span></span> <span title="edit"><span class="icon">📃</span></span> <span title="delete"><span class="del-node-icon">✂️</span></span></div>
<div class="vtl-operation" style="display: none;"><span title="add tree node"><span class="add-tree-node-icon">📂</span></span> <span title="add leaf node"><span class="icon"></span></span> <span title="edit"><span class="icon">📃</span></span> <span title="delete"><span class="del-node-icon">✂️</span></span></div>
</div>
<!---->
</div>

View File

@@ -51,7 +51,7 @@ describe('Operation', () => {
})
it('add leaf node', done => {
const $node1AddLeafNode = wrapper.find('#t1 [title="Add Leaf Node"]')
const $node1AddLeafNode = wrapper.find('#t1 [title="add leaf node"]')
$node1AddLeafNode.trigger('click')
Vue.nextTick(() => {
expect(wrapper.findAll('.vtl-leaf-node').length).toBe(2)
@@ -60,7 +60,7 @@ describe('Operation', () => {
})
it('add tree node', done => {
const $node1AddTreeNode = wrapper.find('#t1 [title="Add Tree Node"]')
const $node1AddTreeNode = wrapper.find('#t1 [title="add tree node"]')
$node1AddTreeNode.trigger('click')
Vue.nextTick(() => {
expect(wrapper.findAll('.vtl-tree-node').length).toBe(3)

14861
yarn.lock

File diff suppressed because it is too large Load Diff