refactor: 💡 convert dropdown components to nested structure
This commit is contained in:
7 files changed
+13
-32
No files matched your search
@@ -1,10 +0,0 @@
|
||||
import Component from '@ember/component';
|
||||
import layout from '../../../templates/components/rose/dropdown/button';
|
||||
|
||||
/**
|
||||
* A dropdown button component based on simplified rose/button
|
||||
*/
|
||||
export default Component.extend({
|
||||
layout,
|
||||
tagName: '',
|
||||
});
|
||||
File renamed without changes.
File renamed without changes.
+13
-12
@@ -1,16 +1,17 @@
|
||||
import Component from '@ember/component';
|
||||
import layout from '../../templates/components/rose/dropdown';
|
||||
import { action } from '@ember/object';
|
||||
import Component from '@glimmer/component';
|
||||
import { computed, action } from '@ember/object';
|
||||
|
||||
export default class RoseDropdownComponent extends Component {
|
||||
|
||||
/**
|
||||
* A dropdown component composed of HTML disclosure elements: details and summary
|
||||
*/
|
||||
export default Component.extend({
|
||||
// =attributes
|
||||
|
||||
layout,
|
||||
tagName: '',
|
||||
showCaret: true,
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
@computed('args.showCaret')
|
||||
get showCaret() {
|
||||
return this.args.showCaret ?? true;
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
@@ -26,5 +27,5 @@ export default Component.extend({
|
||||
close(element) {
|
||||
if (element.open) element.open = false;
|
||||
if (element.parentElement.open) element.parentElement.open = false;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
File renamed without changes.
@@ -1,10 +0,0 @@
|
||||
import Component from '@ember/component';
|
||||
import layout from '../../../templates/components/rose/dropdown/link';
|
||||
|
||||
/**
|
||||
* A dropdown link wrapper for LinkTo component.
|
||||
*/
|
||||
export default Component.extend({
|
||||
layout,
|
||||
tagName: '',
|
||||
});
|
||||
Reference in new issue
Block a user