Skip to content

Commit

Permalink
Merge pull request #3 from Charmedme/2.0.4
Browse files Browse the repository at this point in the history
Fix an alignment issue when item has no children
  • Loading branch information
Charmedme authored Aug 6, 2022
2 parents 8029930 + 749304e commit 9da36f2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@charmedme/ngx-treeview",
"version": "2.0.3",
"version": "2.0.4",
"license": "MIT",
"contributors": [
"Charmedme"
],
"description": "An Angular treeview component with checkbox",
"description": "An Angular Boostrap treeview component with checkboxes",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand Down
4 changes: 2 additions & 2 deletions projects/ngx-treeview/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@charmedme/ngx-treeview",
"version": "2.0.3",
"version": "2.0.4",
"license": "MIT",
"contributors": [
"Charmedme"
],
"description": "An Angular treeview component with checkbox",
"description": "An Angular Boostrap treeview component with checkboxes",
"keywords": [
"ng",
"ngx",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<ng-template #defaultItemTemplate let-item="item" let-onCollapseExpand="onCollapseExpand"
let-onCheckedChange="onCheckedChange">

<div class="row treeview-row">
<div class="col-auto treeview-col">
<i *ngIf="item.children" (click)="onCollapseExpand()" aria-hidden="true" [ngSwitch]="item.collapsed">
<div class="row treeview-row-item">
<div class="col-auto">
<i [ngClass]="{'visible': item.children, 'invisible': !item.children}" (click)="onCollapseExpand()" aria-hidden="true" [ngSwitch]="item.collapsed">
<svg *ngSwitchCase="true" width="0.8rem" height="0.8rem" viewBox="0 0 16 16" class="bi bi-caret-right-fill"
fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path
Expand All @@ -16,7 +16,7 @@
</svg>
</i>
</div>
<div class="col treeview-col">
<div class="col">
<div class="form-check">
<input type="checkbox" class="form-check-input" [(ngModel)]="item.checked" (ngModelChange)="onCheckedChange()"
[disabled]="item.disabled" [indeterminate]="item.indeterminate" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
margin-right: 0.3rem;
}
}
}

.treeview-row {
.treeview-col:last-child {
padding-left: 0;
.treeview-row-item {
.col {
padding-left: 0;
}
}
}
}
Expand All @@ -38,4 +38,4 @@
.treeview-text {
padding: 0.3rem 0;
white-space: nowrap;
}
}

0 comments on commit 9da36f2

Please sign in to comment.