2019-04-17 15:58:15 +02:00
|
|
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
|
|
// Mixins
|
|
|
|
import { inject as RegistrableInject } from './registrable';
|
|
|
|
export function factory(namespace, child, parent) {
|
|
|
|
return RegistrableInject(namespace, child, parent).extend({
|
|
|
|
name: 'groupable',
|
|
|
|
props: {
|
|
|
|
activeClass: {
|
|
|
|
type: String,
|
|
|
|
default: function _default() {
|
|
|
|
if (!this[namespace]) return undefined;
|
|
|
|
return this[namespace].activeClass;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
disabled: Boolean
|
|
|
|
},
|
|
|
|
data: function data() {
|
|
|
|
return {
|
|
|
|
isActive: false
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
groupClasses: function groupClasses() {
|
|
|
|
if (!this.activeClass) return {};
|
|
|
|
return _defineProperty({}, this.activeClass, this.isActive);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created: function created() {
|
|
|
|
this[namespace] && this[namespace].register(this);
|
|
|
|
},
|
|
|
|
beforeDestroy: function beforeDestroy() {
|
|
|
|
this[namespace] && this[namespace].unregister(this);
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
toggle: function toggle() {
|
|
|
|
this.$emit('change');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
/* eslint-disable-next-line no-redeclare */
|
|
|
|
var Groupable = factory('itemGroup');
|
|
|
|
export default Groupable;
|
2019-06-04 14:29:48 +02:00
|
|
|
//# sourceMappingURL=groupable.js.map
|