-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(table-header): custom icon components (#489)
* feat(custom-icons): base files * fix(column-base): sort icon displayed with sortable:false * feat(dummy): cookbook for custom-sort-icon * loosen ember-one-way-controls version requirement * yarn.lock updates * [BUGFIX release]: Added check for target column is droppable (#496) * [chore]: Update ember-truth-helpers to latest version. (#497) * [BUGFIX release]: Ensure the drop target remains properly identified (#418) * fix(feedback): iconComponent comments, iconComponent test * fix(feedback-v2): iconComponent comments, iconComponent test
- Loading branch information
1 parent
2096d95
commit e16af17
Showing
12 changed files
with
139 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
34 changes: 34 additions & 0 deletions
34
tests/dummy/app/components/cookbook/custom-sort-icon-table.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// BEGIN-SNIPPET custom-sort-icon-table | ||
import Component from '@ember/component'; | ||
import TableCommon from '../../mixins/table-common'; | ||
import { computed } from '@ember/object'; | ||
|
||
export default Component.extend(TableCommon, { | ||
columns: computed(function() { | ||
return [{ | ||
label: 'Avatar', | ||
valuePath: 'avatar', | ||
width: '60px', | ||
sortable: false, | ||
cellComponent: 'user-avatar' | ||
}, { | ||
label: 'First Name', | ||
valuePath: 'firstName', | ||
width: '150px' | ||
}, { | ||
label: 'Last Name', | ||
valuePath: 'lastName', | ||
width: '150px' | ||
}, { | ||
label: 'Address', | ||
valuePath: 'address' | ||
}, { | ||
label: 'State', | ||
valuePath: 'state' | ||
}, { | ||
label: 'Country', | ||
valuePath: 'country' | ||
}]; | ||
}) | ||
}); | ||
// END-SNIPPET |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// BEGIN-SNIPPET materialize-icon | ||
import Component from '@ember/component'; | ||
import layout from '../templates/components/materialize-icon'; | ||
|
||
export default Component.extend({ | ||
tagName: 'span', | ||
layout | ||
}); | ||
// END-SNIPPET |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from '../table-route'; |
This file contains 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
26 changes: 26 additions & 0 deletions
26
tests/dummy/app/templates/components/cookbook/custom-sort-icon-table.hbs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{{!-- BEGIN-SNIPPET custom-sort-icon-table --}} | ||
{{#light-table table height='65vh' as |t|}} | ||
|
||
{{t.head | ||
onColumnClick=(action 'onColumnClick') | ||
iconSortable='unfold_more' | ||
iconAscending='keyboard_arrow_up' | ||
iconDescending='keyboard_arrow_down' | ||
iconComponent='materialize-icon' | ||
fixed=true | ||
}} | ||
|
||
{{#t.body | ||
canSelect=false | ||
onScrolledToBottom=(action 'onScrolledToBottom') | ||
as |body| | ||
}} | ||
{{#if isLoading}} | ||
{{#body.loader}} | ||
{{table-loader}} | ||
{{/body.loader}} | ||
{{/if}} | ||
{{/t.body}} | ||
|
||
{{/light-table}} | ||
{{!-- END-SNIPPET --}} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{!-- BEGIN-SNIPPET materialize-icon --}} | ||
<i class="lt-sort-icon material-icons" style="height:0px;">{{get sortIcons sortIconProperty}}</i> | ||
{{!-- END-SNIPPET --}} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{#code-panel | ||
title="Custom Sort Icon" | ||
snippets=(array | ||
"custom-sort-icon-table.js" | ||
"table-common.js" | ||
"custom-sort-icon-table.hbs" | ||
"user-avatar.hbs" | ||
"table-loader.hbs" | ||
"materialize-icon.hbs" | ||
)}} | ||
{{cookbook/custom-sort-icon-table model=model}} | ||
{{/code-panel}} |
This file contains 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