This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/lib/components/VExpansionPanel/VExpansionPanel.js

86 lines
1.9 KiB
JavaScript
Raw Permalink Normal View History

2019-08-11 18:48:02 +00:00
// Mixins
import { factory as GroupableFactory } from '../../mixins/groupable';
import { provide as RegistrableProvide } from '../../mixins/registrable'; // Utilities
import { getSlot } from '../../util/helpers';
import mixins from '../../util/mixins';
export default mixins(GroupableFactory('expansionPanels', 'v-expansion-panel', 'v-expansion-panels'), RegistrableProvide('expansionPanel', true)
/* @vue/component */
).extend({
name: 'v-expansion-panel',
props: {
disabled: Boolean,
readonly: Boolean
},
data() {
return {
content: null,
header: null,
nextIsActive: false
};
},
computed: {
classes() {
return {
'v-expansion-panel--active': this.isActive,
'v-expansion-panel--next-active': this.nextIsActive,
'v-expansion-panel--disabled': this.isDisabled,
...this.groupClasses
};
},
isDisabled() {
return this.expansionPanels.disabled || this.disabled;
},
isReadonly() {
return this.expansionPanels.readonly || this.readonly;
}
},
methods: {
registerContent(vm) {
this.content = vm;
},
unregisterContent() {
this.content = null;
},
registerHeader(vm) {
this.header = vm;
vm.$on('click', this.onClick);
},
unregisterHeader() {
this.header = null;
},
onClick(e) {
if (e.detail) this.header.$el.blur();
this.$emit('click', e);
this.isReadonly || this.isDisabled || this.toggle();
},
toggle() {
/* istanbul ignore else */
if (this.content) this.content.isBooted = true;
this.$nextTick(() => this.$emit('change'));
}
},
render(h) {
return h('div', {
staticClass: 'v-expansion-panel',
class: this.classes,
attrs: {
'aria-expanded': String(this.isActive)
}
}, getSlot(this));
}
});
//# sourceMappingURL=VExpansionPanel.js.map