@nextcloud/vue
Version:
Nextcloud vue components
22 lines (21 loc) • 1.78 kB
JavaScript
import "../assets/index38.css";
import { A as a } from "../chunks/actionGlobal-cda46023.mjs";
import { G as s } from "../chunks/GenRandomId-1e1b509a.mjs";
import { n as i } from "../chunks/_plugin-vue2_normalizer-5b4c43a4.mjs";
const l = { name: "NcActionCheckbox", mixins: [a], props: { id: { type: String, default: () => "action-" + s(), validator: (e) => e.trim() !== "" }, checked: { type: Boolean, default: !1 }, value: { type: [String, Number], default: "" }, disabled: { type: Boolean, default: !1 } }, emits: ["change", "check", "uncheck", "update:checked"], computed: { isFocusable() {
return !this.disabled;
} }, methods: { checkInput(e) {
this.$refs.label.click();
}, onChange(e) {
this.$emit("update:checked", this.$refs.checkbox.checked), this.$emit("change", e), this.$refs.checkbox.checked ? this.$emit("check") : this.$emit("uncheck");
} } };
var o = function() {
var e = this, c = e._self._c;
return c("li", { staticClass: "action", class: { "action--disabled": e.disabled } }, [c("span", { staticClass: "action-checkbox" }, [c("input", { ref: "checkbox", staticClass: "checkbox action-checkbox__checkbox", class: { focusable: e.isFocusable }, attrs: { id: e.id, disabled: e.disabled, type: "checkbox" }, domProps: { checked: e.checked, value: e.value }, on: { keydown: function(t) {
return !t.type.indexOf("key") && e._k(t.keyCode, "enter", 13, t.key, "Enter") || t.ctrlKey || t.shiftKey || t.altKey || t.metaKey ? null : (t.preventDefault(), e.checkInput.apply(null, arguments));
}, change: e.onChange } }), c("label", { ref: "label", staticClass: "action-checkbox__label", attrs: { for: e.id } }, [e._v(e._s(e.text))]), e._e()], 2)]);
}, n = [], h = i(l, o, n, !1, null, "1aa9466c", null, null);
const p = h.exports;
export {
p as default
};