This commit is contained in:
2022-07-21 03:28:35 +00:00
parent d7c883d6df
commit 51b34b0e1d
30103 changed files with 4152204 additions and 23 deletions
+115
View File
@@ -0,0 +1,115 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
require("../../../src/components/VCheckbox/VCheckbox.sass");
require("../../../src/styles/components/_selection-controls.sass");
var _VIcon = _interopRequireDefault(require("../VIcon"));
var _VInput = _interopRequireDefault(require("../VInput"));
var _selectable = _interopRequireDefault(require("../../mixins/selectable"));
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 = _selectable.default.extend({
name: 'v-checkbox',
props: {
indeterminate: Boolean,
indeterminateIcon: {
type: String,
default: '$checkboxIndeterminate'
},
offIcon: {
type: String,
default: '$checkboxOff'
},
onIcon: {
type: String,
default: '$checkboxOn'
}
},
data: function data() {
return {
inputIndeterminate: this.indeterminate
};
},
computed: {
classes: function classes() {
return _objectSpread({}, _VInput.default.options.computed.classes.call(this), {
'v-input--selection-controls': true,
'v-input--checkbox': true,
'v-input--indeterminate': this.inputIndeterminate
});
},
computedIcon: function computedIcon() {
if (this.inputIndeterminate) {
return this.indeterminateIcon;
} else if (this.isActive) {
return this.onIcon;
} else {
return this.offIcon;
}
},
// Do not return undefined if disabled,
// according to spec, should still show
// a color when disabled and active
validationState: function validationState() {
if (this.isDisabled && !this.inputIndeterminate) return undefined;
if (this.hasError && this.shouldValidate) return 'error';
if (this.hasSuccess) return 'success';
if (this.hasColor !== null) return this.computedColor;
return undefined;
}
},
watch: {
indeterminate: function indeterminate(val) {
var _this = this;
// https://github.com/vuetifyjs/vuetify/issues/8270
this.$nextTick(function () {
return _this.inputIndeterminate = val;
});
},
inputIndeterminate: function inputIndeterminate(val) {
this.$emit('update:indeterminate', val);
},
isActive: function isActive() {
if (!this.indeterminate) return;
this.inputIndeterminate = false;
}
},
methods: {
genCheckbox: function genCheckbox() {
return this.$createElement('div', {
staticClass: 'v-input--selection-controls__input'
}, [this.$createElement(_VIcon.default, this.setTextColor(this.validationState, {
props: {
dense: this.dense,
dark: this.dark,
light: this.light
}
}), this.computedIcon), this.genInput('checkbox', _objectSpread({}, this.attrs$, {
'aria-checked': this.inputIndeterminate ? 'mixed' : this.isActive.toString()
})), this.genRipple(this.setTextColor(this.rippleState))]);
},
genDefaultSlot: function genDefaultSlot() {
return [this.genCheckbox(), this.genLabel()];
}
}
});
exports.default = _default;
//# sourceMappingURL=VCheckbox.js.map
File diff suppressed because one or more lines are too long
+110
View File
@@ -0,0 +1,110 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
require("../../../src/components/VCheckbox/VSimpleCheckbox.sass");
var _ripple2 = _interopRequireDefault(require("../../directives/ripple"));
var _vue = _interopRequireDefault(require("vue"));
var _VIcon = require("../VIcon");
var _colorable = _interopRequireDefault(require("../../mixins/colorable"));
var _themeable = _interopRequireDefault(require("../../mixins/themeable"));
var _mergeData = require("../../util/mergeData");
var _helpers = require("../../util/helpers");
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; }
var _default = _vue.default.extend({
name: 'v-simple-checkbox',
functional: true,
directives: {
ripple: _ripple2.default
},
props: _objectSpread({}, _colorable.default.options.props, {}, _themeable.default.options.props, {
disabled: Boolean,
ripple: {
type: Boolean,
default: true
},
value: Boolean,
indeterminate: Boolean,
indeterminateIcon: {
type: String,
default: '$checkboxIndeterminate'
},
onIcon: {
type: String,
default: '$checkboxOn'
},
offIcon: {
type: String,
default: '$checkboxOff'
}
}),
render: function render(h, _ref) {
var props = _ref.props,
data = _ref.data,
listeners = _ref.listeners;
var children = [];
if (props.ripple && !props.disabled) {
var _ripple = h('div', _colorable.default.options.methods.setTextColor(props.color, {
staticClass: 'v-input--selection-controls__ripple',
directives: [{
name: 'ripple',
value: {
center: true
}
}]
}));
children.push(_ripple);
}
var icon = props.offIcon;
if (props.indeterminate) icon = props.indeterminateIcon;else if (props.value) icon = props.onIcon;
children.push(h(_VIcon.VIcon, _colorable.default.options.methods.setTextColor(props.value && props.color, {
props: {
disabled: props.disabled,
dark: props.dark,
light: props.light
}
}), icon));
var classes = {
'v-simple-checkbox': true,
'v-simple-checkbox--disabled': props.disabled
};
return h('div', _objectSpread({}, data, {
class: classes,
on: (0, _mergeData.mergeListeners)({
click: function click(e) {
e.stopPropagation();
if (data.on && data.on.input && !props.disabled) {
(0, _helpers.wrapInArray)(data.on.input).forEach(function (f) {
return f(!props.value);
});
}
}
}, listeners)
}), children);
}
});
exports.default = _default;
//# sourceMappingURL=VSimpleCheckbox.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/components/VCheckbox/VSimpleCheckbox.ts"],"names":[],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AACA;;AAGA;;AACA;;AAGA;;AACA;;;;;;;;;;eAEe,aAAI,MAAJ,CAAW;AACxB,EAAA,IAAI,EAAE,mBADkB;AAGxB,EAAA,UAAU,EAAE,IAHY;AAKxB,EAAA,UAAU,EAAE;AACV,IAAA,MAAM,EAAN;AADU,GALY;AASxB,EAAA,KAAK,oBACA,mBAAU,OAAV,CAAkB,KADlB,MAEA,mBAAU,OAAV,CAAkB,KAFlB;AAGH,IAAA,QAAQ,EAAE,OAHP;AAIH,IAAA,MAAM,EAAE;AACN,MAAA,IAAI,EAAE,OADA;AAEN,MAAA,OAAO,EAAE;AAFH,KAJL;AAQH,IAAA,KAAK,EAAE,OARJ;AASH,IAAA,aAAa,EAAE,OATZ;AAUH,IAAA,iBAAiB,EAAE;AACjB,MAAA,IAAI,EAAE,MADW;AAEjB,MAAA,OAAO,EAAE;AAFQ,KAVhB;AAcH,IAAA,MAAM,EAAE;AACN,MAAA,IAAI,EAAE,MADA;AAEN,MAAA,OAAO,EAAE;AAFH,KAdL;AAkBH,IAAA,OAAO,EAAE;AACP,MAAA,IAAI,EAAE,MADC;AAEP,MAAA,OAAO,EAAE;AAFF;AAlBN,IATmB;AAiCxB,EAAA,MAjCwB,kBAiChB,CAjCgB,QAiCa;AAAA,QAAxB,KAAwB,QAAxB,KAAwB;AAAA,QAAjB,IAAiB,QAAjB,IAAiB;AAAA,QAAX,SAAW,QAAX,SAAW;AACnC,QAAM,QAAQ,GAAG,EAAjB;;AAEA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AI,CAAC,EAAL,IAAW,IAAI,CAAC,EAAL,CAAQ,KAAnB,IAA4B,CAAC,KAAK,CAAC,QAAvC,EAAiD;AAC/C,sCAAY,IAAI,CAAC,EAAL,CAAQ,KAApB,EAA2B,OAA3B,CAAmC,UAAA,CAAC;AAAA,qBAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAR,CAAL;AAAA,aAApC;AACD;AACF;AAPgB,OAAf,EAQD,SARC;AAHE,QAYL,QAZK,CAAR;AAaD;AA9EuB,CAAX,C","sourcesContent":["import './VSimpleCheckbox.sass'\n\nimport ripple from '../../directives/ripple'\n\nimport Vue, { VNode, VNodeDirective } from 'vue'\nimport { VIcon } from '../VIcon'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport Themeable from '../../mixins/themeable'\n\n// Utilities\nimport { mergeListeners } from '../../util/mergeData'\nimport { wrapInArray } from '../../util/helpers'\n\nexport default Vue.extend({\n name: 'v-simple-checkbox',\n\n functional: true,\n\n directives: {\n ripple,\n },\n\n props: {\n ...Colorable.options.props,\n ...Themeable.options.props,\n disabled: Boolean,\n ripple: {\n type: Boolean,\n default: true,\n },\n value: Boolean,\n indeterminate: Boolean,\n indeterminateIcon: {\n type: String,\n default: '$checkboxIndeterminate',\n },\n onIcon: {\n type: String,\n default: '$checkboxOn',\n },\n offIcon: {\n type: String,\n default: '$checkboxOff',\n },\n },\n\n render (h, { props, data, listeners }): VNode {\n const children = []\n\n if (props.ripple && !props.disabled) {\n const ripple = h('div', Colorable.options.methods.setTextColor(props.color, {\n staticClass: 'v-input--selection-controls__ripple',\n directives: [{\n name: 'ripple',\n value: { center: true },\n }] as VNodeDirective[],\n }))\n\n children.push(ripple)\n }\n\n let icon = props.offIcon\n if (props.indeterminate) icon = props.indeterminateIcon\n else if (props.value) icon = props.onIcon\n\n children.push(h(VIcon, Colorable.options.methods.setTextColor(props.value && props.color, {\n props: {\n disabled: props.disabled,\n dark: props.dark,\n light: props.light,\n },\n }), icon))\n\n const classes = {\n 'v-simple-checkbox': true,\n 'v-simple-checkbox--disabled': props.disabled,\n }\n\n return h('div', {\n ...data,\n class: classes,\n on: mergeListeners({\n click: (e: MouseEvent) => {\n e.stopPropagation()\n\n if (data.on && data.on.input && !props.disabled) {\n wrapInArray(data.on.input).forEach(f => f(!props.value))\n }\n },\n }, listeners),\n }, children)\n },\n})\n"],"sourceRoot":"","file":"VSimpleCheckbox.js"}
+33
View File
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "VCheckbox", {
enumerable: true,
get: function get() {
return _VCheckbox.default;
}
});
Object.defineProperty(exports, "VSimpleCheckbox", {
enumerable: true,
get: function get() {
return _VSimpleCheckbox.default;
}
});
exports.default = void 0;
var _VCheckbox = _interopRequireDefault(require("./VCheckbox"));
var _VSimpleCheckbox = _interopRequireDefault(require("./VSimpleCheckbox"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = {
$_vuetify_subcomponents: {
VCheckbox: _VCheckbox.default,
VSimpleCheckbox: _VSimpleCheckbox.default
}
};
exports.default = _default;
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/components/VCheckbox/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;eAGe;AACb,EAAA,uBAAuB,EAAE;AACvB,IAAA,SAAS,EAAT,kBADuB;AAEvB,IAAA,eAAe,EAAf;AAFuB;AADZ,C","sourcesContent":["import VCheckbox from './VCheckbox'\nimport VSimpleCheckbox from './VSimpleCheckbox'\n\nexport { VCheckbox, VSimpleCheckbox }\nexport default {\n $_vuetify_subcomponents: {\n VCheckbox,\n VSimpleCheckbox,\n },\n}\n"],"sourceRoot":"","file":"index.js"}