UNPKG

@nextcloud/vue

Version:
26 lines (25 loc) 1.77 kB
import "../assets/index2.css"; import { t as a } from "../chunks/l10n-9a5a6afc.mjs"; import { G as s } from "../chunks/GenRandomId-1e1b509a.mjs"; import { n } from "../chunks/_plugin-vue2_normalizer-5b4c43a4.mjs"; const u = { name: "NcSettingsInputText", props: { label: { type: String, required: !0 }, hint: { type: String, default: "" }, value: { type: String, default: "" }, disabled: { type: Boolean, default: !1 }, id: { type: String, default: () => "settings-input-text-" + s(), validator: (t) => t.trim() !== "" } }, emits: ["update:value", "input", "submit", "change"], data() { return { submitTranslated: a("Submit") }; }, computed: { idSubmit() { return this.id + "-submit"; } }, methods: { onInput(t) { this.$emit("input", t), this.$emit("update:value", t.target.value); }, onSubmit(t) { this.disabled || this.$emit("submit", t); }, onChange(t) { this.$emit("change", t); } } }; var r = function() { var t = this, i = t._self._c; return i("form", { ref: "form", attrs: { disabled: t.disabled }, on: { submit: function(e) { return e.preventDefault(), e.stopPropagation(), t.onSubmit.apply(null, arguments); } } }, [i("div", { staticClass: "input-wrapper" }, [i("label", { staticClass: "action-input__label", attrs: { for: t.id } }, [t._v(t._s(t.label))]), i("input", { attrs: { id: t.id, type: "text", disabled: t.disabled }, domProps: { value: t.value }, on: { input: t.onInput, change: t.onChange } }), i("input", { staticClass: "action-input__submit", attrs: { id: t.idSubmit, type: "submit" }, domProps: { value: t.submitTranslated } }), t.hint ? i("p", { staticClass: "hint" }, [t._v(" " + t._s(t.hint) + " ")]) : t._e()])]); }, l = [], p = n(u, r, l, !1, null, "5b140fb6", null, null); const c = p.exports; export { c as default };