-
Notifications
You must be signed in to change notification settings - Fork 355
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
[guides] Finalize Guides for v2.0.0-beta.1 #549
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,48 +4,76 @@ import { htmlSafe } from '@ember/string'; | |
import { action, computed } from '@ember-decorators/object'; | ||
import { readOnly, equal } from '@ember-decorators/object/computed'; | ||
import { tagName, attribute, className } from '@ember-decorators/component'; | ||
import { service } from '@ember-decorators/service'; | ||
import { argument } from '@ember-decorators/argument'; | ||
import { type, optional } from '@ember-decorators/argument/type'; | ||
import { Action } from '@ember-decorators/argument/types'; | ||
|
||
import layout from './template'; | ||
import { SELECT_MODE } from '../../-private/collapse-tree'; | ||
|
||
/** | ||
The table cell component. This component manages cell level concerns, yields | ||
the cell value, column value, row value, and all of their associated meta | ||
objects. | ||
|
||
```hbs | ||
<EmberTable as |t|> | ||
<t.head @columns={{columns}} /> | ||
|
||
<t.body @rows={{rows}} as |b|> | ||
<b.row as |r|> | ||
<r.cell as |cellValue columnValue rowValue cellMeta columnMeta rowMeta|> | ||
|
||
</r.cell> | ||
</b.row> | ||
</t.body> | ||
</EmberTable> | ||
``` | ||
|
||
@yield {any} cellValue - The value of the cell | ||
@yield {object} columnValue - The column definition | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was there discussions to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we ever discussed it. I would be open to that, but I'd like to get this published first and come back to it if we find it's unintuitive. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's fine. |
||
@yield {object} rowValue - The row definition | ||
|
||
@yield {object} cellMeta - The meta object associated with the cell | ||
@yield {object} columnMeta - The meta object associated with the column | ||
@yield {object} rowMeta - The meta object associated with the row | ||
*/ | ||
@tagName('td') | ||
export default class EmberTd extends Component { | ||
layout = layout; | ||
|
||
@service fastboot; | ||
|
||
/** | ||
The API object passed in by the table row | ||
*/ | ||
@argument | ||
@type('object') | ||
api; | ||
|
||
/** | ||
Action sent when the user clicks this element | ||
*/ | ||
@argument | ||
@type(optional(Action)) | ||
onClick; | ||
|
||
/** | ||
Action sent when the user double clicks this element | ||
*/ | ||
@argument | ||
@type(optional(Action)) | ||
onDoubleClick; | ||
|
||
@computed('api.api') | ||
get unwrappedApi() { | ||
return this.get('api.api') || this.get('api'); | ||
} | ||
|
||
@readOnly('unwrappedApi.cellValue') cellValue; | ||
@readOnly('unwrappedApi.cellMeta') cellMeta; | ||
@readOnly('api.cellValue') cellValue; | ||
@readOnly('api.cellMeta') cellMeta; | ||
|
||
@readOnly('unwrappedApi.columnValue') columnValue; | ||
@readOnly('unwrappedApi.columnMeta') columnMeta; | ||
@readOnly('api.columnValue') columnValue; | ||
@readOnly('api.columnMeta') columnMeta; | ||
|
||
@readOnly('unwrappedApi.rowValue') rowValue; | ||
@readOnly('unwrappedApi.rowMeta') rowMeta; | ||
@readOnly('api.rowValue') rowValue; | ||
@readOnly('api.rowMeta') rowMeta; | ||
|
||
@readOnly('unwrappedApi.rowSelectionMode') rowSelectionMode; | ||
@readOnly('unwrappedApi.checkboxSelectionMode') checkboxSelectionMode; | ||
@readOnly('api.rowSelectionMode') rowSelectionMode; | ||
@readOnly('api.checkboxSelectionMode') checkboxSelectionMode; | ||
|
||
@className | ||
@equal('columnMeta.index', 0) | ||
|
@@ -100,7 +128,7 @@ export default class EmberTd extends Component { | |
style += `right: ${Math.round(this.get('columnMeta.offsetRight'))}px;`; | ||
} | ||
|
||
if (!this.get('fastboot.isFastBoot') && this.element) { | ||
if (typeof FastBoot === 'undefined' && this.element) { | ||
// Keep any styling added by the Sticky polyfill | ||
style += `position: ${this.element.style.position};`; | ||
style += `top: ${this.element.style.top};`; | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we ever teardown the cache properly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is torn down by the owner which is the
tbody
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/Addepar/ember-table/blob/master/addon/components/ember-tbody/component.js#L249-L256
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my C++ days make me always worried to not see a corresponding
destroy
to acreate