Compare commits

..

5 Commits

Author SHA1 Message Date
995cea4b0d removed husky and git-cz 2022-04-07 02:26:44 +02:00
440d2782a1 upgrade to yarn 2 2022-04-07 02:21:54 +02:00
youxingzhi
7b677a6589 1.5.0 2020-11-28 22:11:56 +08:00
youxingzhi
a21f4b8adf chore: 🤖 rm npx 2020-11-28 22:11:42 +08:00
youxingzhi
5b2fea32ad feat: 🎸 #84, add default title props 2020-11-28 22:11:42 +08:00
14 changed files with 16243 additions and 15132 deletions

View File

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

3
.czrc
View File

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

23
.gitignore vendored
View File

@@ -21,3 +21,26 @@ 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

View File

@@ -1,3 +0,0 @@
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

785
.yarn/releases/yarn-3.2.0.cjs vendored Executable file

File diff suppressed because one or more lines are too long

7
.yarnrc.yml Normal file
View File

@@ -0,0 +1,7 @@
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

15109
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "vue-tree-list",
"version": "1.4.6",
"version": "1.5.0",
"description": "A vue component for tree structure. Support adding treenode/leafnode, editing node's name and dragging.",
"author": "ayou",
"scripts": {
@@ -10,11 +10,9 @@
"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",
@@ -27,7 +25,6 @@
"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",
@@ -58,5 +55,6 @@
"repository": {
"type": "git",
"url": "git+https://github.com/ParadeTo/vue-tree-list.git"
}
},
"packageManager": "yarn@3.2.0"
}

View File

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

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 Normal file

File diff suppressed because it is too large Load Diff