124 lines
No EOL
4 KiB
JavaScript
124 lines
No EOL
4 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
|
|
require("../../../src/components/VList/VList.sass");
|
|
|
|
var _VSheet = _interopRequireDefault(require("../VSheet/VSheet"));
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
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; }
|
|
|
|
/* @vue/component */
|
|
var _default = _VSheet.default.extend().extend({
|
|
name: 'v-list',
|
|
provide: function provide() {
|
|
return {
|
|
isInList: true,
|
|
list: this
|
|
};
|
|
},
|
|
inject: {
|
|
isInMenu: {
|
|
default: false
|
|
},
|
|
isInNav: {
|
|
default: false
|
|
}
|
|
},
|
|
props: {
|
|
dense: Boolean,
|
|
disabled: Boolean,
|
|
expand: Boolean,
|
|
flat: Boolean,
|
|
nav: Boolean,
|
|
rounded: Boolean,
|
|
shaped: Boolean,
|
|
subheader: Boolean,
|
|
threeLine: Boolean,
|
|
tile: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
twoLine: Boolean
|
|
},
|
|
data: function data() {
|
|
return {
|
|
groups: []
|
|
};
|
|
},
|
|
computed: {
|
|
classes: function classes() {
|
|
return _objectSpread({}, _VSheet.default.options.computed.classes.call(this), {
|
|
'v-list--dense': this.dense,
|
|
'v-list--disabled': this.disabled,
|
|
'v-list--flat': this.flat,
|
|
'v-list--nav': this.nav,
|
|
'v-list--rounded': this.rounded,
|
|
'v-list--shaped': this.shaped,
|
|
'v-list--subheader': this.subheader,
|
|
'v-list--two-line': this.twoLine,
|
|
'v-list--three-line': this.threeLine
|
|
});
|
|
}
|
|
},
|
|
methods: {
|
|
register: function register(content) {
|
|
this.groups.push(content);
|
|
},
|
|
unregister: function unregister(content) {
|
|
var index = this.groups.findIndex(function (g) {
|
|
return g._uid === content._uid;
|
|
});
|
|
if (index > -1) this.groups.splice(index, 1);
|
|
},
|
|
listClick: function listClick(uid) {
|
|
if (this.expand) return;
|
|
var _iteratorNormalCompletion = true;
|
|
var _didIteratorError = false;
|
|
var _iteratorError = undefined;
|
|
|
|
try {
|
|
for (var _iterator = this.groups[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
var group = _step.value;
|
|
group.toggle(uid);
|
|
}
|
|
} catch (err) {
|
|
_didIteratorError = true;
|
|
_iteratorError = err;
|
|
} finally {
|
|
try {
|
|
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
_iterator.return();
|
|
}
|
|
} finally {
|
|
if (_didIteratorError) {
|
|
throw _iteratorError;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
render: function render(h) {
|
|
var data = {
|
|
staticClass: 'v-list',
|
|
class: this.classes,
|
|
style: this.styles,
|
|
attrs: _objectSpread({
|
|
role: this.isInNav || this.isInMenu ? undefined : 'list'
|
|
}, this.$attrs)
|
|
};
|
|
return h('div', this.setBackgroundColor(this.color, data), [this.$slots.default]);
|
|
}
|
|
});
|
|
|
|
exports.default = _default;
|
|
//# sourceMappingURL=VList.js.map
|