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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
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; }
var _default = {
name: 'PlxCheckbox',
props: {
value: Boolean,
indeterminate: Boolean,
title: [String, Number],
disabled: Boolean,
name: String,
size: String
},
computed: {
vSize: function vSize() {
return this.size || this.$parent.size || this.$parent.vSize;
}
},
render: function render(h) {
var _ref,
_this = this;
var disabled = this.disabled,
title = this.title,
vSize = this.vSize,
indeterminate = this.indeterminate,
value = this.value;
var attrs = {};
if (title) {
attrs.title = title;
}
return h('label', {
class: ['plx-checkbox', (_ref = {}, _defineProperty(_ref, "size--".concat(vSize), vSize), _defineProperty(_ref, 'is--indeterminate', indeterminate), _defineProperty(_ref, 'is--disabled', disabled), _ref)],
attrs: attrs
}, [h('input', {
attrs: {
type: 'checkbox',
disabled: disabled
},
domProps: {
checked: value
},
on: {
change: function change(evnt) {
if (!_this.disabled) {
var checked = evnt.target.checked;
_this.$emit('input', checked);
_this.$emit('change', checked, evnt);
}
}
}
}), h('span', {
class: 'plx-checkbox--icon'
}), this.$slots.default ? h('span', {
class: 'plx-checkbox--label'
}, this.$slots.default) : null]);
}
};
exports.default = _default;