Last active
October 24, 2019 18:03
-
-
Save joshuaogle/3a7686164f0d5454c52c81f079720aac to your computer and use it in GitHub Desktop.
Structure Tree View
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"; | |
| }) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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-" : ""; | |
| }) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Component.extend({ | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| } | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | |
| } | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| export default Ember.Route.extend({ | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "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