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

Make light-table tagless #805

Merged
merged 1 commit into from
Jul 21, 2022
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
67 changes: 37 additions & 30 deletions addon/components/light-table.hbs
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
{{yield
(hash
head=(component
'lt-head'
tableId=this.elementId
table=this.table
tableActions=this.tableActions
extra=this.extra
tableClassNames=this.tableClassNames
sharedOptions=this.sharedOptions
<div
class="ember-light-table {{if this.occlusion "occlusion"}}"
id={{or this.attrs.id this.tableId}}
style={{this.style}}
...attributes
>
{{yield
(hash
head=(component
"lt-head"
tableId=(or this.attrs.id this.tableId)
table=this.table
tableActions=this.tableActions
extra=this.extra
tableClassNames=this.tableClassNames
sharedOptions=this.sharedOptions
)
body=(component
"lt-body"
tableId=(or this.attrs.id this.tableId)
table=this.table
tableActions=this.tableActions
extra=this.extra
tableClassNames=this.tableClassNames
sharedOptions=this.sharedOptions
)
foot=(component
"lt-foot"
tableId=(or this.attrs.id this.tableId)
table=this.table
tableActions=this.tableActions
extra=this.extra
tableClassNames=this.tableClassNames
sharedOptions=this.sharedOptions
)
)
body=(component
'lt-body'
tableId=this.elementId
table=this.table
tableActions=this.tableActions
extra=this.extra
tableClassNames=this.tableClassNames
sharedOptions=this.sharedOptions
)
foot=(component
'lt-foot'
tableId=this.elementId
table=this.table
tableActions=this.tableActions
extra=this.extra
tableClassNames=this.tableClassNames
sharedOptions=this.sharedOptions
)
)
}}
}}
</div>
6 changes: 4 additions & 2 deletions addon/components/light-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { A as emberArray } from '@ember/array';
import Component from '@ember/component';
import { computed, observer } from '@ember/object';
import { readOnly } from '@ember/object/computed';
import { guidFor } from '@ember/object/internals';
import { isEmpty, isNone } from '@ember/utils';
import { assert } from '@ember/debug';
import { inject as service } from '@ember/service';
Expand Down Expand Up @@ -36,8 +37,7 @@ function intersections(array1, array2) {
*/

const LightTable = Component.extend({
classNameBindings: [':ember-light-table', 'occlusion'],
attributeBindings: ['style'],
tagName: '',

media: service(),
scrollbarThickness: service(),
Expand Down Expand Up @@ -294,6 +294,8 @@ const LightTable = Component.extend({
table instanceof Table
);

this.set('tableId', guidFor(this));

if (isNone(this.media)) {
this.set('responsive', false);
} else {
Expand Down