Skip to content

Commit

Permalink
Merge pull request #69 from eidng8/dev
Browse files Browse the repository at this point in the history
fix #68
  • Loading branch information
eidng8 committed May 15, 2020
2 parents fea527f + 909e43f commit 1fb1e66
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 29 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- stage: test
os: linux
env:
- secure: JZhvhE5uAXC1+WL47BFXREtbRJgaBSs7970cs1kSkpFv3cJ7SBGirjCg6xYmFvbqf3xmOYNbrd/iBt5Dyqs074cGxxccOpdwNgGF23euG3YgWzxcP7VUq1RrnxLALRtDRobxveNB7DctCPHxWuKlZgsZSAThEHUCdazH68/bCpBMAMaf/JO+MK/EndcDYWCGqY6TIeDAsmtNVNUI6pVnXkYJakiYODVEyzuSstT44eD8mZ3BXu36NN62d+uvSEw2+JVmC1yTHLgYllM5tiS4ScBaBq7/ih6cZunscZJSNaLBV9ifUeRlUyGTvt2GWBSuWuQMqxZldr5RqU6/APfhDNSzXROXy7hUCYXjgi6xbrHQPFc2yXLYxHX060NklhYn9+6UaPJig23MH2DY/lUjSOrec/jvPXSZ7F83DQwDlz9m1lWSWykO+PCodKBnRb9+75u4/I6h25ycgJ7iHHlCPMBCdiejajCfKgumS24bgN7/GKZHuo8XOlTzxg7wlt2fzO0Pmw79/+94vKMAPh8OrW1/L8zIzbLpfN7/y9MpKmoyMSJ4VSuq4Sp8cfPm3g6yfr9J0klZjX/ARG/dux6Yi650XsiUpZPsyT8YF9QdM/9Z76IvcfP/02RMSjg14tWn84jgtQ23kbAtsU4YtySG3OKNoJRDrMh+NSQxlHKlLs0=
secure: JZhvhE5uAXC1+WL47BFXREtbRJgaBSs7970cs1kSkpFv3cJ7SBGirjCg6xYmFvbqf3xmOYNbrd/iBt5Dyqs074cGxxccOpdwNgGF23euG3YgWzxcP7VUq1RrnxLALRtDRobxveNB7DctCPHxWuKlZgsZSAThEHUCdazH68/bCpBMAMaf/JO+MK/EndcDYWCGqY6TIeDAsmtNVNUI6pVnXkYJakiYODVEyzuSstT44eD8mZ3BXu36NN62d+uvSEw2+JVmC1yTHLgYllM5tiS4ScBaBq7/ih6cZunscZJSNaLBV9ifUeRlUyGTvt2GWBSuWuQMqxZldr5RqU6/APfhDNSzXROXy7hUCYXjgi6xbrHQPFc2yXLYxHX060NklhYn9+6UaPJig23MH2DY/lUjSOrec/jvPXSZ7F83DQwDlz9m1lWSWykO+PCodKBnRb9+75u4/I6h25ycgJ7iHHlCPMBCdiejajCfKgumS24bgN7/GKZHuo8XOlTzxg7wlt2fzO0Pmw79/+94vKMAPh8OrW1/L8zIzbLpfN7/y9MpKmoyMSJ4VSuq4Sp8cfPm3g6yfr9J0klZjX/ARG/dux6Yi650XsiUpZPsyT8YF9QdM/9Z76IvcfP/02RMSjg14tWn84jgtQ23kbAtsU4YtySG3OKNoJRDrMh+NSQxlHKlLs0=
addons:
chrome: stable
install:
Expand All @@ -55,8 +55,6 @@ jobs:

- stage: deploy
os: linux
env:
- secure: sjd+Ru89jESG+RV8nEhl6ZmhgkdPsImFdW5uNuwrC3rCJXqjLATe1cJxUWDv4MIE3AOb0y5RisqtsRBbk8v9INJtuhZU3fLqbVOOfQXZz/FXynrM/vhRSrbeLTbiHRd/kqmyb/hQgqeoK8ZBjfDsGTz/w9eECLA98e2wOM2j2FLXAUm3jS1YR5rjUvAJuG8IYf0N+srlzpjKS7HE171BxRa7lrhNXUYxpP97XkDqHTxXbb1edGiLTesR+MG9x/yao4AT0lbuGVmFdf2xkib3uTlWX/FlZK3jCYivd2xuiBDhBNc0+g4azThSNwruxMng6pkna1Z9XNl6BF9bFJiU2/VTajMSE18zjJM6HHgvh/G6DINNkAejcNtHAAVoiX5Br54KC4LVnD5ZQkVrStyJTgAsz+Kquwc0Zb9PZMmKzLKAjlSZAQksj2F2XX+PDhEqAhmQZcCU2ln4yDIJrAzODYIZIYwS4J8vtiOkrLfiiHQQNLB69TB6/dOD5Byyvf1UMdbA62VC2mXto5osATZOIQP9hHoWuvFWXFSHh+WBghHXc4HeYMvefUV4BsJ+mKLLhBq07DEml5+YF63psp++MtgZAixdGP8pSe36R2UWC5MwP8m1XI9x+OEmb589gaJv+gd3dIx9l6wbWan6YKaXlhRgv+OLCWLYdlmMG2g1Brc=
script: skip
before_deploy:
- npm install
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"vue-property-decorator": "^8.4.1"
},
"devDependencies": {
"@bundle-analyzer/webpack-plugin": "^0.5.1",
"@types/jest": "^24.0.19",
"@types/nightwatch": "^1.1.3",
"@typescript-eslint/eslint-plugin": "^2.18.0",
Expand Down
38 changes: 19 additions & 19 deletions src/components/G8VueTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<li
:id="item[itemId]"
class="g8-tree__node"
:class="{ 'g8-tree__node--expended': expanded }"
:class="{ 'g8-tree__node--expended': hasChild && expanded }"
>
<div
class="g8-tree__node__entry"
Expand Down Expand Up @@ -86,44 +86,44 @@ export default class G8VueTree extends Vue {
/**
* Key of the field in `item` to be used as element's `id` attribute.
*/
@Prop({ default: 'id' }) itemId!: string;
@Prop({ default: 'id' }) private itemId!: string;
/**
* Key of the field in `item` that holds node label.
*/
@Prop({ default: 'name' }) itemLabel!: string;
@Prop({ default: 'name' }) private itemLabel!: string;
/**
* Key of the field in `item` that holds tags array.
*/
@Prop({ default: 'tags' }) tagsKey!: string;
@Prop({ default: 'tags' }) private tagsKey!: string;
/**
* Key of the field in `item` that holds child nodes array.
*/
@Prop({ default: 'children' }) childrenKey!: string;
@Prop({ default: 'children' }) private childrenKey!: string;
/**
* Key of the field in tags list of `item` to be used as tag element's `id`
* attribute.
*/
@Prop({ default: 'id' }) tagId!: string;
@Prop({ default: 'id' }) private tagId!: string;
/**
* Key of the field in tags list of `item` that holds tag label.
*/
@Prop({ default: 'label' }) tagLabel!: string;
@Prop({ default: 'label' }) private tagLabel!: string;
/**
* Key of the field in tags list of `item` that holds tag tooltip.
*/
@Prop({ default: 'hint' }) tagHint!: string;
@Prop({ default: 'hint' }) private tagHint!: string;
/**
* Whether to add a checkbox before each item, allowing multiple nodes to
* be checked.
*/
@Prop({ default: false }) checker!: boolean;
@Prop({ default: false }) private checker!: boolean;
/**
* The tree data to be rendered. Please note that data passed ***may*** be
Expand All @@ -134,39 +134,39 @@ export default class G8VueTree extends Vue {
* - intermediate
* - rendered
*/
@Prop() item!: G8TreeItem;
@Prop() private item!: G8TreeItem;
/**
* Whether the node is expanded.
*/
expanded = false;
private expanded = false;
/**
* Whether the node is checked. This must be a member field in order for
* binding to work.
*/
checked = false;
private checked = false;
/**
* Intermediate check box state. Active while some of the children were
* checked, but not all were checked. This must be a member field in order for
* binding to work.
*/
intermediate = false;
private intermediate = false;
/**
* Whether the current node has any child.
*/
get hasChild(): boolean {
private get hasChild(): boolean {
const children = this.item[this.childrenKey] as G8TreeItem[] | null;
return children != null && children.length > 0;
}
// noinspection JSUnusedGlobalSymbols
// noinspection JSUnusedLocalSymbols
/**
* Vue life cycle hook {@link https://vuejs.org/v2/api/#created}.
*/
created() {
private created() {
this.checked = this.item.checked as boolean;
this.intermediate = this.item.intermediate as boolean;
}
Expand All @@ -177,7 +177,7 @@ export default class G8VueTree extends Vue {
* This method emits the `state-changed` event.
* @param state
*/
setState(state: boolean) {
private setState(state: boolean) {
this.checked = this.item.checked = state;
if (this.$children && this.$children.length) {
// descend to all descendant sub-components and update their states,
Expand Down Expand Up @@ -207,7 +207,7 @@ export default class G8VueTree extends Vue {
* Handles click event of nodes, expanding/collapsing sub-tree if
* applicable. This method emits the `click` event.
*/
clicked(event: G8ClickEvent) {
private clicked(event: G8ClickEvent) {
if (this.hasChild) {
this.item.rendered = true;
this.expanded = !this.expanded;
Expand All @@ -226,7 +226,7 @@ export default class G8VueTree extends Vue {
* `state-changed` event.
* @param node
*/
childrenStateChanged(node: G8TreeItem) {
private childrenStateChanged(node: G8TreeItem) {
let checked = 0;
const children: G8TreeItem[] = this.item[this.childrenKey] as G8TreeItem[];
for (const child of children) {
Expand Down
6 changes: 0 additions & 6 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Author: eidng8
*/

const BundleAnalyzerPlugin = require('@bundle-analyzer/webpack-plugin');
const WBA = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = {
Expand All @@ -15,10 +14,5 @@ module.exports = {
if (process.env.WBA) {
config.plugins.push(new WBA({ analyzerMode: 'static' }));
}
if (process.env.BUNDLE_ANALYZER_TOKEN) {
config.plugins.push(
new BundleAnalyzerPlugin({ token: process.env.BUNDLE_ANALYZER_TOKEN }),
);
}
},
};

0 comments on commit 1fb1e66

Please sign in to comment.