@nextcloud/vue
Version:
Nextcloud vue components
26 lines (25 loc) • 1.65 kB
JavaScript
import n from "./NcInputField.mjs";
import r from "vue-material-design-icons/Close.vue";
import o from "vue-material-design-icons/ArrowRight.vue";
import i from "vue-material-design-icons/UndoVariant.vue";
import { t as l } from "../chunks/l10n-9a5a6afc.mjs";
import { n as s } from "../chunks/_plugin-vue2_normalizer-5b4c43a4.mjs";
const u = { name: "NcTextField", components: { NcInputField: n, Close: r, ArrowRight: o, Undo: i }, inheritAttrs: !1, props: { ...n.props, trailingButtonIcon: { type: String, default: "close", validator: (t) => ["close", "arrowRight", "undo"].includes(t) } }, emits: ["update:value"], computed: { clearTextLabel() {
return this.trailingButtonLabel || l("Clear text");
} }, methods: { focus() {
this.$refs.inputField.focus();
}, select() {
this.$refs.inputField.select();
}, handleInput(t) {
this.$emit("update:value", t.target.value);
} } };
var a = function() {
var t = this, e = t._self._c;
return e("NcInputField", t._g(t._b({ ref: "inputField", attrs: { "trailing-button-label": t.clearTextLabel }, on: { input: t.handleInput }, scopedSlots: t._u([t.type !== "search" ? { key: "trailing-button-icon", fn: function() {
return [t.trailingButtonIcon === "close" ? e("Close", { attrs: { size: 20 } }) : t.trailingButtonIcon === "arrowRight" ? e("ArrowRight", { attrs: { size: 20 } }) : t.trailingButtonIcon === "undo" ? e("Undo", { attrs: { size: 20 } }) : t._e()];
}, proxy: !0 } : null], null, !0) }, "NcInputField", { ...t.$attrs, ...t.$props }, !1), t.$listeners), [t._t("default")], 2);
}, p = [], c = s(u, a, p, !1, null, null, null, null);
const b = c.exports;
export {
b as default
};