@nextcloud/vue
Version:
Nextcloud vue components
22 lines (21 loc) • 1.71 kB
JavaScript
import "../assets/index36.css";
import { A as i } from "../chunks/actionGlobal-cda46023.mjs";
import { G as s } from "../chunks/GenRandomId-1e1b509a.mjs";
import { n as l } from "../chunks/_plugin-vue2_normalizer-5b4c43a4.mjs";
const n = { name: "NcActionRadio", mixins: [i], props: { id: { type: String, default: () => "action-" + s(), validator: (e) => e.trim() !== "" }, checked: { type: Boolean, default: !1 }, name: { type: String, required: !0 }, value: { type: [String, Number], default: "" }, disabled: { type: Boolean, default: !1 } }, emits: ["update:checked", "change"], computed: { isFocusable() {
return !this.disabled;
} }, methods: { toggleInput(e) {
this.$refs.label.click();
}, onChange(e) {
this.$emit("update:checked", this.$refs.radio.checked), this.$emit("change", e);
} } };
var o = function() {
var e = this, a = e._self._c;
return a("li", { staticClass: "action", class: { "action--disabled": e.disabled } }, [a("span", { staticClass: "action-radio" }, [a("input", { ref: "radio", staticClass: "radio action-radio__radio", class: { focusable: e.isFocusable }, attrs: { id: e.id, disabled: e.disabled, name: e.name, type: "radio" }, 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.toggleInput.apply(null, arguments));
}, change: e.onChange } }), a("label", { ref: "label", staticClass: "action-radio__label", attrs: { for: e.id } }, [e._v(e._s(e.text))]), e._e()], 2)]);
}, r = [], d = l(n, o, r, !1, null, "b5f9046e", null, null);
const f = d.exports;
export {
f as default
};