UNPKG

@nextcloud/vue

Version:
44 lines (43 loc) 2.59 kB
import "../assets/NcInputConfirmCancel.css"; import a from "../Components/NcButton.mjs"; import { t as o } from "./l10n-9a5a6afc.mjs"; import r from "vue-material-design-icons/ArrowRight.vue"; import l from "vue-material-design-icons/Close.vue"; import { n as i } from "./_plugin-vue2_normalizer-5b4c43a4.mjs"; const u = { name: "NcInputConfirmCancel", components: { NcButton: a, ArrowRight: r, Close: l }, props: { placeholder: { default: "", type: String }, value: { default: "", type: String } }, emits: ["input", "confirm", "cancel"], data() { return { labelConfirm: o("Confirm changes"), labelCancel: o("Cancel changes") }; }, computed: { valueModel: { get() { return this.value; }, set(t) { this.$emit("input", t); } } }, methods: { confirm() { this.$emit("confirm"); }, cancel() { this.$emit("cancel"); }, focusInput() { this.$refs.input.focus(); } } }; var p = function() { var t = this, n = t._self._c; return n("div", { staticClass: "app-navigation-input-confirm" }, [n("form", { on: { submit: function(e) { return e.preventDefault(), t.confirm.apply(null, arguments); }, keydown: function(e) { return !e.type.indexOf("key") && t._k(e.keyCode, "esc", 27, e.key, ["Esc", "Escape"]) || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey ? null : (e.stopPropagation(), e.preventDefault(), t.cancel.apply(null, arguments)); }, click: function(e) { e.stopPropagation(), e.preventDefault(); } } }, [n("input", { directives: [{ name: "model", rawName: "v-model", value: t.valueModel, expression: "valueModel" }], ref: "input", staticClass: "app-navigation-input-confirm__input", attrs: { type: "text", placeholder: t.placeholder }, domProps: { value: t.valueModel }, on: { input: function(e) { e.target.composing || (t.valueModel = e.target.value); } } }), n("NcButton", { attrs: { "native-type": "submit", type: "primary", "aria-label": t.labelConfirm }, on: { click: function(e) { return e.stopPropagation(), e.preventDefault(), t.confirm.apply(null, arguments); } }, scopedSlots: t._u([{ key: "icon", fn: function() { return [n("ArrowRight", { attrs: { size: 20 } })]; }, proxy: !0 }]) }), n("NcButton", { attrs: { "native-type": "reset", type: "tertiary", "aria-label": t.labelCancel }, on: { click: function(e) { return e.stopPropagation(), e.preventDefault(), t.cancel.apply(null, arguments); } }, scopedSlots: t._u([{ key: "icon", fn: function() { return [n("Close", { attrs: { size: 20 } })]; }, proxy: !0 }]) })], 1)]); }, c = [], s = i(u, p, c, !1, null, null, null, null); const h = s.exports; export { h as N };