Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: minor ui fixes tree search #340

Merged
merged 2 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addon/components/data-table.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="uk-flex uk-flex-right uk-width-1">
<form
class="uk-search uk-search-default uk-width-1-3 search-input-form"
class="uk-search uk-search-default uk-width-1-3@m uk-width-2-3@s search-input-form"
{{on "submit" this.updateSearch}}
{{on "reset" this.resetSearch}}
>
Expand Down
2 changes: 1 addition & 1 deletion addon/components/tree-node.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<li class="{{if (and (not @flat) @item.children.length 0) 'childless'}}">
<li class="{{if (and (not @flat) (lt @item.children.length 1)) 'childless'}}">
{{#if (and (not @flat) @item.children)}}
<UkButton class="tree-node-icon" @color="link" {{on "click" this.toggle}}>
<UkIcon @icon={{if this.expanded "chevron-down" "chevron-right"}} />
Expand Down
22 changes: 12 additions & 10 deletions addon/components/tree.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
{{on "input" this.filter}}
/>
</div>
<ul class="tree">
{{#each (sort-by "name" this.items) as |item|}}
<TreeNode
@item={{item}}
@itemRoute={{@itemRoute}}
@activeItem={{@activeItem}}
@expandedItems={{this.expandedItems}}
@flat={{this.hasFilter}}/>
{{/each}}
</ul>
{{#if this.items}}
<ul class="tree">
{{#each (sort-by "name" this.items) as |item|}}
<TreeNode
@item={{item}}
@itemRoute={{@itemRoute}}
@activeItem={{@activeItem}}
@expandedItems={{this.expandedItems}}
@flat={{this.hasFilter}}/>
{{/each}}
</ul>
{{/if}}
</div>
2 changes: 1 addition & 1 deletion addon/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="uk-padding uk-overflow-auto">
<div class="uk-padding-small uk-overflow-auto">
<Nav>
<Nav::Item @route="users" data-test-nav-users>
{{t "emeis.users.title"}}
Expand Down
5 changes: 3 additions & 2 deletions addon/templates/scopes.hbs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<SectionTitle @model="scopes" />

<div class="uk-grid">
<div class="uk-width-1-4 uk-first-column emeis-border-right">
<div class="uk-width-xlarge@l uk-width-1-3@m uk-width-1-2@s uk-first-column tree-border-right">
<Tree
class="uk-margin-small-left"
@items={{this.rootScopes}}
@itemRoute={{this.itemRoute}}
@activeItem={{this.activeScope}}
/>
<hr class="uk-hidden@s uk-margin-small-bottom"/>
</div>
<div class="uk-width-3-4">
<div class="uk-width-expand">
{{outlet}}
</div>
</div>
50 changes: 35 additions & 15 deletions app/styles/ember-emeis.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
@import "ember-uikit/variables-theme";

// you can use the uikit SCSS variables here

$ember-power-select-default-border-radius: 0;
$ember-power-select-border-color: $global-border;
@import "ember-power-select";

/* GENERAL INPUTS */
[class*="uk-width-"] {
transition: width 0.3s ease-out;
}

[class*="uk-search-icon"] {
&:focus,
&:hover {
Expand All @@ -10,6 +18,15 @@
border: solid 1px $global-border;
}

[class*="search-reset-icon"] {
&:focus,
&:hover {
background: $global-muted-background;
}
border: solid 1px $global-border;
border-left-color: transparent;
}

.no-style-button {
background: none;
border: none;
Expand Down Expand Up @@ -38,46 +55,48 @@
left: unset;
}

button.uk-search-icon {
border-right-color: transparent;
}

input.uk-search-input {
padding: 0 40px;
}

input:focus ~ button.uk-search-icon {
border-color: #1e87f0;
border-color: $global-primary-background;
border-right-color: transparent;
}

input:focus ~ button.search-reset-icon {
border-color: #1e87f0;
border-color: $global-primary-background;
border-left-color: transparent;
}
}
/* END GENERAL INPUTS*/

$ember-power-select-default-border-radius: 0;
$ember-power-select-border-color: $global-border;
@import "ember-power-select";

.emeis-border-right {
border-right: solid 1px $global-border;
/* TREE VIEW */
@media screen and (min-width: 640px) {
.tree-border-right {
border-right: solid 1px $global-border;
}
}

$tree_node_height: 1.9em;
$tree_indicator_width: 0.6em;
$tree_indicator_height: 0.6em;
$tree_indicator_height: $tree_node_height/2;
$tree_node_icon_margin: $tree_indicator_height/2;

.tree-wrapper {
display: flex;
flex-direction: column;

padding-right: $tree_indicator_width;
padding-right: $tree_node_icon_margin;
position: relative;
max-height: 100%;

.tree {
overflow-y: auto;

a {
line-height: $tree_node_height;
}
}
}

Expand Down Expand Up @@ -134,3 +153,4 @@ ul.tree li:last-child:before {
ul.tree li button.tree-node-icon {
margin: 0 -0.25em 0.25em -0.25em;
}
/* END TREE VIEW */