Skip to content

Commit

Permalink
Merge pull request #25 from pennions/flightkit/add-deselect-option
Browse files Browse the repository at this point in the history
Flightkit/add deselect option
  • Loading branch information
jelmerveen authored Jul 8, 2024
2 parents 88dbc15 + f6bce7d commit 1f5091a
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,6 @@
return parsedSvg.documentElement;
}

// import JOQ from '@pennions/joq';

class FlightkitTable extends HTMLElement {
base;
/** to render */
Expand Down Expand Up @@ -1414,6 +1412,15 @@
this.base.addEvent('.flk-branch', 'click', this.emitNodeToggle);
}

deselectTree() {
if (this.selectedElements.length) {
for (const selectedElement of this.selectedElements) {
selectedElement.classList.remove('font-weight-bold');
delete selectedElement.dataset.selected;
}
}
}

emitNodeToggle(event) {
event.stopPropagation();

Expand Down Expand Up @@ -1462,11 +1469,7 @@
while (!leafKey)

if (flkElement.selectedElements.length) {
for (const selectedElement of flkElement.selectedElements) {
selectedElement.classList.remove('font-weight-bold');
delete selectedElement.dataset.selected;

}
flkElement.deselectTree();
}

// flkElement.previousElements = flkElement.selectedElements;
Expand Down

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/cdn/ibiss-v0.0.8/avian.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/cdn/ibiss-v0.0.8/flightkit.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/cdn/ibiss-v0.0.8/htmx-ibiss-ui.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/cdn/ibiss-v0.0.8/rocket.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/js/flightkit.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions documentation/public/cdn/ibiss-v0.0.8/avian.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions documentation/public/cdn/ibiss-v0.0.8/flightkit.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions documentation/public/cdn/ibiss-v0.0.8/htmx-ibiss-ui.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions documentation/public/cdn/ibiss-v0.0.8/rocket.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion documentation/public/js/flightkit.min.js

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions flightkit/components/tree-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ export class FlightkitTreeNavigation extends HTMLElement {
this.base.addEvent('.flk-branch', 'click', this.emitNodeToggle);
}

deselectTree() {
if (this.selectedElements.length) {
for (const selectedElement of this.selectedElements) {
selectedElement.classList.remove('font-weight-bold');
delete selectedElement.dataset.selected;
}
}
}

emitNodeToggle(event) {
event.stopPropagation();

Expand Down Expand Up @@ -103,11 +112,7 @@ export class FlightkitTreeNavigation extends HTMLElement {
while (!leafKey)

if (flkElement.selectedElements.length) {
for (const selectedElement of flkElement.selectedElements) {
selectedElement.classList.remove('font-weight-bold');
delete selectedElement.dataset.selected;

}
flkElement.deselectTree();
}

// flkElement.previousElements = flkElement.selectedElements;
Expand Down
9 changes: 6 additions & 3 deletions flightkit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@

<flk-tree-nav id="tree-nav" e-tree-click="clicky"></flk-tree-nav>
<div>
<button class="bg-gray-light" type="button" id="deselect">Deselect database tree</button>

<input id="search" class="m-2" type="text" placeholder="search" />
<flk-tree-nav id="db-nav" class="mt-5" icon-set="database" e-tree-click="clicky" max-depth="4"></flk-tree-nav>
</div>

<hr />

<flk-tree-nav id="databases" icon-set="database" max-depth="3" e-tree-click="clicky"> </flk-tree-nav>

<code>
Expand Down Expand Up @@ -74,7 +73,7 @@
databasesNav.setContents(window.databaseSet);

databasesNav.init();
const dbTable = document.getElementById("db-table")
const dbTable = document.getElementById("db-table")
dbTable.setContents(window.databaseSet.database1.table1);
dbTable.init();

Expand All @@ -90,6 +89,10 @@
})

})

document.getElementById('deselect').addEventListener('click', () => {
myDbNav.deselectTree();
})
};
</script>
</body>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@pennions/ibiss",
"version": "0.0.7",
"version": "0.0.8",
"avian_version": "0.0.2",
"flightkit_version": "0.0.7",
"flightkit_version": "0.0.8",
"htmx_plugin_version": "0.0.1",
"rocketjs_version": "0.0.1",
"description": "Frontend library of Pennions",
Expand Down

0 comments on commit 1f5091a

Please sign in to comment.