Skip to content

Instantly share code, notes, and snippets.

@joshuaogle
Last active October 24, 2019 18:03
Show Gist options
  • Select an option

  • Save joshuaogle/3a7686164f0d5454c52c81f079720aac to your computer and use it in GitHub Desktop.

Select an option

Save joshuaogle/3a7686164f0d5454c52c81f079720aac to your computer and use it in GitHub Desktop.
Structure Tree View
import Ember from 'ember';
import EmberObject, { computed } from '@ember/object';
export default Ember.Component.extend({
isAWS: computed("icon", function() {
return this.get("icon") == "aws";
}),
isGCP: computed("icon", function() {
return this.get("icon") == "gcp";
})
});
import Ember from 'ember';
import EmberObject, { computed } from '@ember/object';
export default Ember.Component.extend({
value: computed("searchActive", function() {
return this.get("searchActive") ? "my-very-" : "";
})
});
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
import EmberObject, { computed } from '@ember/object';
export default Ember.Component.extend({
isOpen: computed("item", function() {
return this.get("item.hasCurrent") || false;
}),
isChecked: false,
isGroup: computed("item", function() {
return this.get("item.type") == "group";
}),
hasCurrent: computed("item", function() {
return !!this.get("item.hasCurrent");
}),
isCurrent: computed("item", function() {
return !!this.get("item.isCurrent");
}),
actions: {
toggleOpen() {
this.toggleProperty('isOpen');
},
toggleCheck() {
this.toggleProperty('isChecked');
var direction = this.get("isChecked") ? 1 : -1;
this.sendAction("incrementSelectedItems", direction);
}
}
});
import Ember from 'ember';
import EmberObject, { computed } from '@ember/object';
export default Ember.Controller.extend({
searchActive: false,
selectedItems: 0,
hasCheckboxes: computed("selectedDataOption", function() {
return this.get("selectedDataOption") != "Pages";
}),
selectedDataOption: "Simple",
selectedData: computed("selectedDataOption", function() {
let selectedDataOption = this.get("selectedDataOption");
let dataOptions = this.get("dataOptions");
let selectedData = dataOptions[selectedDataOption];
return selectedData;
}),
dataOptions: {
"Simple": [
{
type: "group",
label: "namespaceA",
children: [
{
type: "group",
label: "ns1"
},
{
type: "group",
label: 'ns2',
children: [
{
type: "item",
icon: "aws",
label: "aws"
},
{
type: "item",
icon: "aws",
label: "aws2"
},
{
type: "item",
icon: "gcp",
label: "gcp3"
}
]
},
{
type: "item",
icon: "gcp",
label: "gcp"
}
]
},
{
type: "group",
label: "namespaceB",
children: [
{
type: "item",
icon: "gcp",
label: "gcp"
}
]
},
{
type: "item",
icon: "aws",
label: "aws"
}
],
"Complex": [
{
type: "group",
label: "namespaceXL",
children: [
{
type: "group",
label: "ns1",
children: [
{
type: "group",
label: 'ns2',
children: [
{
type: "group",
label: "ns3",
children: [
{
type: "group",
label: "ns4",
children: [
{
type: "group",
label: 'ns5',
children: [
{
type: "group",
label: 'ns6',
children: [
{
type: "item",
icon: "aws",
label: "aws"
},
{
type: "item",
icon: "aws",
label: "aws2"
},
{
type: "item",
icon: "gcp",
label: "gcp3"
}
]
},
]
},
]
},
]
},
{
type: "item",
icon: "aws",
label: "aws2"
},
{
type: "item",
icon: "gcp",
label: "gcp3"
}
]
},
]
},
{
type: "item",
icon: "gcp",
label: "gcp"
}
]
},
{
type: "group",
label: "namespaceS",
children: [
{
type: "item",
icon: "aws",
label: "aws"
},
{
type: "item",
icon: "gcp",
label: "gcp"
},
{
type: "item",
icon: "gcp",
label: "gcp2"
},
{
type: "item",
icon: "gcp",
label: "gcp3"
}
]
},
{
type: "group",
label: "namespaceM",
children: [
{
type: "group",
label: "nsC1",
children: [
{
type: "item",
icon: "gcp",
label: "gcp"
},
{
type: "item",
icon: "gcp",
label: "gcp2"
},
{
type: "item",
icon: "gcp",
label: "gcp3"
}
]
},
{
type: "group",
label: "nsC2",
children: [
{
type: "item",
icon: "gcp",
label: "gcp"
},
{
type: "item",
icon: "gcp",
label: "gcp2"
},
{
type: "item",
icon: "gcp",
label: "gcp3"
}
]
},
{
type: "group",
label: "nsC3",
children: [
{
type: "item",
icon: "gcp",
label: "gcp"
},
{
type: "item",
icon: "gcp",
label: "gcp2"
},
{
type: "item",
icon: "gcp",
label: "gcp3"
}
]
}
]
},
{
type: "group",
label: "namespaceM",
children: [
{
type: "group",
label: "nsD1",
children: [
{
type: "item",
icon: "aws",
label: "aws"
},
{
type: "item",
icon: "aws",
label: "aws2"
},
{
type: "item",
icon: "aws",
label: "aws3"
}
]
},
{
type: "group",
label: "nsD2"
},
{
type: "group",
label: "nsD3"
},
{
type: "item",
icon: "aws",
label: "aws"
}
]
},
{
type: "item",
icon: "aws",
label: "aws"
},
{
type: "item",
icon: "aws",
label: "aws2"
},
{
type: "item",
icon: "gcp",
label: "gcp"
}
],
"Pages": [
{
type: "group",
label: "Folder",
children: [
{
type: "item",
label: "Page 1 Title"
},
{
type: "item",
label: "Page 2 Title"
}
]
},
{
type: "group",
label: "Folder",
children: [
{
type: "item",
label: "Page 1 Title"
},
{
type: "item",
label: "Page 2 Title"
},
{
type: "item",
label: "Page 3 Title"
},
{
type: "item",
label: "Page 4 Title"
}
]
},
{
type: "group",
label: "Folder",
hasCurrent: "true",
children: [
{
type: "item",
label: "Page 1 Title",
isCurrent: "true"
},
{
type: "item",
label: "Page 2 Title"
},
{
type: "item",
label: "Page 3 Title"
}
]
}
]
},
actions: {
setDataOption: function(value) {
this.set('selectedDataOption', value);
},
search: function() {
this.toggleProperty("searchActive");
},
incrementSelectedItems: function(i) {
const selectedItems = this.get("selectedItems");
this.set("selectedItems", selectedItems + i);
}
}
});
import Ember from 'ember';
export default Ember.Route.extend({
});
body {
background-color: #fafafa;
margin: 0 auto;
max-width: 800px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
font-size: 12pt;
padding: 16px;
}
* {
box-sizing: border-box;
}
h1 {
font-family: "Klavika Basic";
font-weight: 300;
margin-bottom: 12px;
}
p {
margin: 0 0 24px;
}
.page {
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
padding: 24px;
}
/* Toolbar */
.hcs-toolbar {
background-color: #fbfbfc;
border: 1px solid #f7f8fa;
border-bottom-color: #dce0e6;
border-top-color: #dce0e6;
padding: 2px 4px;
position: relative;
align-items: center;
display: flex;
height: 48px;
justify-content: space-between;
}
.hcs-toolbar .input,
.hcs-toolbar select {
min-width: 200px;
}
.hcs-toolbar-label {
margin-left: 4px;
color: $grey;
}
.hcs-toolbar-filters,
.hcs-toolbar-actions {
align-items: center;
display: flex;
flex: 1;
white-space: nowrap;
}
.hcs-toolbar-actions {
justify-content: flex-end;
}
/* Forms */
.input {
-moz-appearance: none;
-webkit-appearance: none;
align-items: center;
border: 1px solid transparent;
border-radius: 2px;
box-shadow: none;
display: inline-flex;
font-size: 1rem;
height: 2.25em;
justify-content: flex-start;
line-height: 1.5;
padding-bottom: calc(0.375em - 1px);
padding-left: calc(0.625em - 1px);
padding-right: calc(0.625em - 1px);
padding-top: calc(0.375em - 1px);
position: relative;
vertical-align: top;
background-color: white;
border-color: #6F7682;
color: #1f2124;
box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1);
max-width: 100%;
width: 100%;
}
.input,
.textarea,
.select select {
border-color: #dce0e6;
color: #333;
padding-left: 4px;
padding-right: 4px;
}
.input,
.select select,
.control.has-icons-left .icon,
.control.has-icons-right .icon {
height: 2.5rem;
}
.input,
.textarea {
box-shadow: inset 0 4px 1px rgba(10, 10, 10, 0.06);
}
.select {
display: inline-block;
max-width: 100%;
position: relative;
vertical-align: top;
}
.select:not(.is-multiple) {
height: 2.25em;
}
.select:not(.is-multiple)::after {
border: 1px solid #1563ff;
border-right: 0;
border-top: 0;
content: " ";
display: block;
height: 0.5em;
pointer-events: none;
position: absolute;
transform: rotate(-45deg);
width: 0.5em;
margin-top: -0.375em;
right: 1.125em;
top: 50%;
z-index: 4;
}
.select select {
-moz-appearance: none;
-webkit-appearance: none;
align-items: center;
border: 1px solid transparent;
border-radius: 2px;
box-shadow: none;
display: inline-flex;
font-size: 1rem;
height: 2.25em;
justify-content: flex-start;
line-height: 1.5;
padding-bottom: calc(0.375em - 1px);
padding-left: calc(0.625em - 1px);
padding-right: calc(0.625em - 1px);
padding-top: calc(0.375em - 1px);
position: relative;
vertical-align: top;
background-color: white;
border-color: #6F7682;
color: #1f2124;
cursor: pointer;
display: block;
font-size: 1em;
max-width: 100%;
outline: none;
}
.select select {
border-color: #BAC1CC;
color: #525761;
padding-left: 0.85714rem;
padding-right: 0.85714rem;
box-shadow: 0 3px 1px rgba(10, 10, 10, 0.12);
}
.select:not(.is-multiple)::after {
content: url("data:image/svg+xml;charset=utf8,%3Csvg width='24' height='24' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cpath d='M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z' fill='currentColor'/%3E%3C/svg%3E");
border: 0;
height: 24px;
margin: 0;
right: 8px;
transform: translateY(-50%);
width: 24px;
}
.data-option-select {
align-items: center;
display: flex;
}
.data-option-select label {
color: #6F7682;
margin-right: 12px;
}
.data-option-select .select, .data-option-select select {
width: 200px;
}
/* Tree View */
.hcs-tree-view {
padding: 4px 12px 12px;
}
.hcs-tree-view.has-checkboxes {
padding-left: 36px;
position: relative;
}
.hcs-tree-view.has-checkboxes::before {
background: #fbfbfc;
display: block;
content: "";
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 32px;
}
.hcs-tree-view-row-trigger:hover {
background-color: #F0F5FF;
border-radius: 4px;
}
.hcs-tree-view-row-label {
align-items: center;
display: flex;
height: 30px;
}
.hcs-tree-view-row-label label {
align-items: center;
display: flex;
font-size: 14px;
padding: 2px 4px;
}
.hcs-tree-view-row.is-group .hcs-tree-view-row-label:hover {
background-color: #fbfcff;
}
.hcs-tree-view-row.is-group .hcs-tree-view-row-label label:hover {
background-color: #fbfcff;
color: #0e40A3;
cursor: pointer;
text-decoration: underline;
}
.hcs-tree-view-row input[type="checkbox"] {
position: absolute;
left: 4px;
margin: 2px 6px;
}
.hcs-tree-view-row-trigger {
margin: 2px 0 0 0;
}
.hcs-tree-view-row-trigger::before {
content: url("data:image/svg+xml;charset=utf8,%3Csvg width='16' height='16' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cpolygon points='16.59 8.59 12 13.17 7.41 8.59 6 10 12 16 18 10 ' fill='%236F7682'/%3E%3C/svg%3E");
cursor: pointer;
display: block;
height: 16px;
width: 16px;
transform: rotate(-90deg);
transition: transform 75ms;
}
.hcs-tree-view-row.has-current > .hcs-tree-view-row-label > .hcs-tree-view-row-trigger::before {
content: url("data:image/svg+xml;charset=utf8,%3Csvg width='16' height='16' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cpolygon points='16.59 8.59 12 13.17 7.41 8.59 6 10 12 16 18 10 ' fill='%231563FF'/%3E%3C/svg%3E");
}
.hcs-tree-view-row.is-open > .hcs-tree-view-row-label > .hcs-tree-view-row-trigger::before {
transform: rotate(0deg);
}
.hcs-tree-view-row-nested {
border-left: 1px solid #DCE0E6;
margin-left: 22px;
padding-left: 4px;
}
.hcs-tree-view-icon {
vertical-align: -8px;
}
.hcs-tree-view-row.is-checked .hcs-tree-view-row-nested input[type="checkbox"]:not(:checked) {
content: url("data:image/svg+xml;charset=utf8,%3Csvg width='12' height='12' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cpath d='M10,0 C11.1045695,-2.02906125e-16 12,0.8954305 12,2 L12,10 C12,11.1045695 11.1045695,12 10,12 L2,12 C0.8954305,12 1.3527075e-16,11.1045695 0,10 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 L10,0 Z M8.48,2.4366036 L4.89216962,7.3 L3.21,5.6 L2.25,6.75 L5,9.5 L9.75,3.5 L8.48,2.4366036 Z' fill='%23DCE0E6'/%3E%3C/svg%3E");
height: 12px;
width: 12px;
-webkit-appearance: none;
}
.hcs-tree-view-row.has-current > .hcs-tree-view-row-label {
background-color: #F0F5FF;
border-right: 3px solid #1563ff;
}
.hcs-tree-view-row.has-current > .hcs-tree-view-row-label label,
.hcs-tree-view-row.is-current label {
color: #1563ff;
}
.hcs-tree-view-row.is-current .hcs-tree-view-row-label::before {
background-color: #1563ff;
border-radius: 100%;
content: "";
margin-right: -6px;
left: -4px;
position: relative;
height: 6px;
top: 1px;
transform: translateX(-50%);
width: 6px;
}
.hcs-tree-view.is-search-results .hcs-tree-view-row label {
color: #6F7682;
}
.hcs-tree-view.is-search-results .hcs-tree-view-row.is-search-match label {
color: #1563ff;
}
.hcs-tree-view-footer {
color: #6F7682;
font-size: 14px;
height: 36px;
padding-left: 8px;
}
.bugs-list {
color: #6F7682;
font-size: 12px;
margin-top: 48px;
}
<h1>Structure Tree View</h1>
<p>This is a proposal to use the existing "Tree View" from the Terraform Module Registry and adapt it for a use case in Vault where we need a checkbox for each item in the tree.</p>
<p>
<div class="data-option-select">
<label>Choose an example:</label>
<div class="select">
<select onChange={{action 'setDataOption' value="target.value"}} >
{{#each-in dataOptions as |option data|}}
<option value={{option}}>{{option}}</option>
{{/each-in}}
</select>
</div>
</div>
</p>
<div class="page">
<nav class="hcs-toolbar">
<div class="hcs-toolbar-filters">
{{search-input searchActive=searchActive onClick=(action "search")}}
</div>
<div class="hcs-toolbar-actions">
</div>
</nav>
{{#if searchActive}}
{{search-results}}
{{else}}
<div class="hcs-tree-view {{if hasCheckboxes " has-checkboxes"}}">
{{#each selectedData as |item|}}
{{tree-view-row item=item hasCheckboxes=hasCheckboxes incrementSelectedItems="incrementSelectedItems"}}
{{/each}}
</div>
{{/if}}
{{#if hasCheckboxes}}
{{tree-view-footer selectedItems=selectedItems}}
{{/if}}
</div>
<div class="bugs-list">
<h3>Known bugs</h3>
<ul>
<li>Selecting nesting items should increment the count in the footer</li>
<li>Searching from the Pages example should indicate the current page similar to the non-search mode</li>
</ul>
</div>
{{#if isAWS}}
<svg class="hcs-tree-view-icon" width="16" height="16" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M13.574 22.395c0 .588.063 1.065.174 1.414.127.35.286.731.509 1.145.08.127.111.254.111.365 0 .16-.095.318-.302.477l-1.001.668a.762.762 0 0 1-.413.143c-.16 0-.318-.08-.477-.223a4.917 4.917 0 0 1-.572-.747c-.16-.27-.318-.572-.493-.938-1.24 1.463-2.797 2.194-4.673 2.194-1.335 0-2.4-.382-3.179-1.145-.779-.763-1.176-1.78-1.176-3.051 0-1.351.477-2.448 1.446-3.274.97-.827 2.257-1.24 3.895-1.24.54 0 1.096.047 1.684.127.588.08 1.192.207 1.828.35V17.5c0-1.209-.254-2.051-.747-2.544-.509-.492-1.367-.73-2.59-.73-.557 0-1.13.063-1.717.206-.588.143-1.16.318-1.717.54a4.56 4.56 0 0 1-.556.207.975.975 0 0 1-.254.047c-.223 0-.334-.158-.334-.492v-.779c0-.254.032-.445.111-.556.08-.112.223-.223.445-.334.556-.286 1.224-.525 2.003-.715a9.636 9.636 0 0 1 2.48-.302c1.89 0 3.273.429 4.164 1.287.874.858 1.319 2.162 1.319 3.91v5.15h.032zM7.12 24.81c.524 0 1.064-.096 1.637-.286.572-.191 1.08-.54 1.51-1.018.254-.302.445-.635.54-1.017.095-.381.159-.842.159-1.383v-.667c-.461-.112-.954-.207-1.462-.27a11.976 11.976 0 0 0-1.494-.096c-1.065 0-1.844.207-2.369.636-.524.43-.778 1.033-.778 1.828 0 .747.19 1.303.588 1.685.381.397.937.588 1.669.588zm12.762 1.716c-.286 0-.476-.048-.604-.159-.127-.095-.238-.318-.333-.62L15.21 13.462c-.096-.318-.143-.524-.143-.636 0-.254.127-.397.381-.397h1.558c.302 0 .508.048.62.16.127.094.222.317.317.619l2.67 10.522 2.48-10.522c.08-.318.175-.525.302-.62.127-.095.35-.159.636-.159h1.271c.302 0 .509.048.636.16.127.094.238.317.302.619l2.511 10.649 2.75-10.65c.095-.317.207-.524.318-.619.127-.095.334-.159.62-.159h1.478c.254 0 .397.127.397.397 0 .08-.016.16-.032.255a2.261 2.261 0 0 1-.11.397l-3.831 12.286c-.096.318-.207.525-.334.62-.127.095-.334.159-.604.159h-1.367c-.302 0-.509-.048-.636-.159s-.238-.318-.302-.636l-2.463-10.251-2.448 10.235c-.08.318-.175.525-.302.636-.127.111-.35.16-.636.16h-1.367zm20.424.43c-.826 0-1.653-.096-2.447-.287-.795-.19-1.415-.397-1.828-.636-.255-.143-.43-.302-.493-.445a1.122 1.122 0 0 1-.095-.445v-.81c0-.334.127-.493.365-.493a.9.9 0 0 1 .286.048c.096.032.239.095.398.159.54.238 1.128.429 1.748.556.636.127 1.256.19 1.891.19 1.002 0 1.78-.174 2.321-.524.54-.35.826-.858.826-1.51 0-.445-.143-.81-.429-1.112-.286-.302-.826-.573-1.605-.827l-2.305-.715c-1.16-.366-2.018-.906-2.543-1.621-.524-.7-.794-1.478-.794-2.305 0-.667.143-1.255.429-1.764a4.087 4.087 0 0 1 1.144-1.303 5.045 5.045 0 0 1 1.653-.827 6.927 6.927 0 0 1 2.003-.27c.35 0 .715.016 1.065.063.365.048.699.112 1.033.175.318.08.62.16.906.255.286.095.508.19.667.286.223.127.382.254.477.397.095.127.143.302.143.525v.747c0 .333-.127.508-.365.508-.128 0-.334-.063-.604-.19-.906-.414-1.924-.62-3.052-.62-.906 0-1.621.143-2.114.445-.493.302-.747.763-.747 1.414 0 .445.159.827.477 1.129.318.302.906.604 1.748.874l2.257.715c1.145.366 1.971.874 2.464 1.526.492.652.73 1.399.73 2.225 0 .684-.142 1.303-.412 1.844a4.275 4.275 0 0 1-1.16 1.398c-.493.398-1.081.684-1.765.89a7.558 7.558 0 0 1-2.273.334z" fill="#252F3E" fill-rule="nonzero"/><path d="M43.311 34.68c-5.229 3.863-12.826 5.913-19.359 5.913-9.155 0-17.404-3.385-23.634-9.012-.493-.445-.048-1.049.54-.699 6.74 3.91 15.052 6.278 23.65 6.278 5.802 0 12.175-1.208 18.04-3.687.875-.398 1.622.572.763 1.208zm2.178-2.479c-.668-.858-4.419-.413-6.12-.206-.508.063-.588-.382-.127-.716 2.988-2.098 7.9-1.494 8.472-.794.572.715-.159 5.626-2.956 7.979-.43.365-.843.174-.652-.302.636-1.574 2.05-5.118 1.383-5.96z" fill="#F90"/></g></svg>
{{/if}}
{{#if isGCP}}
<svg class="hcs-tree-view-icon" width="16" height="16" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="nonzero"><path d="M29.218 15.807h1.213l3.454-3.454.17-1.467a15.527 15.527 0 0 0-25.26 7.576 1.879 1.879 0 0 1 1.211-.073l6.91-1.14s.351-.581.533-.545a8.618 8.618 0 0 1 11.794-.897h-.025z" fill="#EA4335"/><path d="M38.806 18.462a15.564 15.564 0 0 0-4.69-7.564l-4.849 4.849a8.618 8.618 0 0 1 3.164 6.836v.86a4.315 4.315 0 0 1 0 8.631H23.8l-.861.873v5.176l.86.86h8.63a11.224 11.224 0 0 0 6.376-20.521z" fill="#4285F4"/><path d="M15.158 38.935h8.63v-6.91h-8.63a4.29 4.29 0 0 1-1.782-.387l-1.212.375-3.479 3.455-.303 1.212a11.164 11.164 0 0 0 6.776 2.255z" fill="#34A853"/><path d="M15.158 16.523a11.224 11.224 0 0 0-6.776 20.12l5.006-5.005a4.315 4.315 0 1 1 5.71-5.71l5.005-5.005a11.212 11.212 0 0 0-8.945-4.4z" fill="#FBBC05"/></g></svg>
{{/if}}
<input
type="search"
class="input"
placeholder="Search"
onClick={{onClick}}
value={{if searchActive "my-very-" ""}}
/>
<div class="hcs-tree-view has-checkboxes is-search-results">
<div class="hcs-tree-view-row is-open">
<div class="hcs-tree-view-row-label">
<div class="hcs-tree-view-row-trigger" />
<input type="checkbox" />
<label>namespaceA</label>
</div>
<div class="hcs-tree-view-row-nested">
<div class="hcs-tree-view-row is-open">
<div class="hcs-tree-view-row-label">
<div class="hcs-tree-view-row-trigger" />
<input type="checkbox" />
<label>ns1</label>
</div>
<div class="hcs-tree-view-row-nested">
<div class="hcs-tree-view-row is-search-match">
<div class="hcs-tree-view-row-label">
<input type="checkbox" />
<label>my-very-special-item</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="hcs-tree-view-row is-open">
<div class="hcs-tree-view-row-label">
<div class="hcs-tree-view-row-trigger" />
<input type="checkbox" />
<label>namespaceB</label>
</div>
<div class="hcs-tree-view-row-nested">
<div class="hcs-tree-view-row is-search-match">
<div class="hcs-tree-view-row-label">
<div class="hcs-tree-view-row-trigger" />
<input type="checkbox" />
<label>my-very-also-matching-namespace</label>
</div>
</div>
</div>
</div>
</div>
<div
class="hcs-tree-view-row{{if isGroup " is-group"}}{{if isOpen " is-open"}}{{if isChecked " is-checked"}}{{if hasCurrent " has-current"}}{{if isCurrent " is-current"}}">
{{#if isGroup}}
<div class="hcs-tree-view-row-label">
<div class="hcs-tree-view-row-trigger" {{action "toggleOpen"}} />
{{#if hasCheckboxes}}
<input type="checkbox" onclick={{action "toggleCheck"}} />
{{/if}}
<label {{action "toggleOpen"}}>
{{item.label}}
</label>
</div>
{{#if isOpen}}
<div class="hcs-tree-view-row-nested">
{{#each item.children as |childItem|}}
{{tree-view-row item=childItem hasCheckboxes=hasCheckboxes}}
{{/each}}
</div>
{{/if}}
{{else}}
<div class="hcs-tree-view-row-label">
{{#if hasCheckboxes}}
{{mount-icon icon=item.icon}}
<input type="checkbox" />
{{/if}}
<label>
{{item.label}}
</label>
</div>
{{/if}}
</div>
{
"version": "0.11.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment