-
-
Notifications
You must be signed in to change notification settings - Fork 141
Expand file tree
/
Copy pathindex.js
More file actions
46 lines (37 loc) · 1.1 KB
/
index.js
File metadata and controls
46 lines (37 loc) · 1.1 KB
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
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { or } from '@ember/object/computed';
import { capitalize } from '../../../utils/string';
import { memberFilter } from '../../../utils/computed';
import { addonDocsConfig } from 'ember-cli-addon-docs/-private/config';
export default class XClass extends Component {
@addonDocsConfig config;
@tracked showInherited = false;
@tracked showProtected = false;
@tracked showPrivate = false;
@tracked showDeprecated = false;
@memberFilter('args.class', 'accessors')
accessors;
@memberFilter('args.class', 'methods')
methods;
@memberFilter('args.class', 'fields')
fields;
@or(
'component.hasInherited',
'component.hasProtected',
'component.hasPrivate',
'component.hasDeprecated',
)
hasToggles;
get hasContents() {
let klass = this.args.class;
return (
klass.allFields.length > 0 ||
klass.allAccessors.length > 0 ||
klass.allMethods.length > 0
);
}
updateFilter(filter, { target: { checked } }) {
this[`show${capitalize(filter)}`] = checked;
}
}