-
Notifications
You must be signed in to change notification settings - Fork 134
/
expand-all-toggle.ts
50 lines (48 loc) · 1.1 KB
/
expand-all-toggle.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { type ExpandAllToggleSignature } from '../../../../interfaces/components/models-table/themes/default/expand-all-toggle-signature.interface';
/**
* Component to expand or collapse all rows
*
* Usage example:
*
* ```js
* const columns = [
* {
* component: 'models-table/themes/default/expand-toggle',
* componentForFilterCell: 'models-table/expand-all-toggle',
* mayBeHidden: false
* },
* {propertyName: 'firstName'},
* {propertyName: 'lastName'}
* ];
*
* const data = [ ... ];
* ```
*
* ```html
* <ModelsTable
* @data={{this.data}}
* @columns={{this.columns}}
* @multipleExpand={{true}}
* />
* ```
*/
export default class ExpandAllToggle extends Component<ExpandAllToggleSignature> {
/**
* @event doCollapseAllRows
*/
@action
protected doCollapseAllRows(): boolean {
this.args.collapseAllRows();
return false;
}
/**
* @event doExpandAllRows
*/
@action
protected doExpandAllRows(): boolean {
this.args.expandAllRows();
return false;
}
}