UNPKG

@konnectio/core

Version:

Konnectio Core Frontend Integration.

104 lines (103 loc) 3.47 kB
import { d as c, c as m, a as d, b as t, g as i, w as V, e as v, f as q } from "./mitt-CWSmi8M-.js"; import { H as g, x as k, d as B, i as I, T as C, e as T, _ as F } from "./SelectField.vue_vue_type_style_index_0_lang-Cev1TH7y.js"; const A = { class: "konnectio-action-field" }, L = /* @__PURE__ */ c({ __name: "ActionField", props: { modelValue: {}, label: {}, inputType: { default: "text" }, buttonLabel: {}, buttonIcon: {}, buttonIconColor: {}, buttonDisabled: { type: Boolean, default: !1 }, secondary: { type: Boolean, default: !1 }, name: {}, id: {}, type: { default: "text" }, placeholder: {}, icon: {}, iconType: { default: "fal" }, required: { type: Boolean, default: !1 }, readonly: { type: Boolean, default: !1 }, data: {}, action: {}, minValue: {}, maxValue: {}, isLoading: { type: Boolean, default: !1 } }, emits: ["update:modelValue", "action"], setup(y, { emit: f }) { const s = f, u = y, o = u.id || g(); function r(e) { s("update:modelValue", e); } const n = m({ get: () => u.modelValue, set: (e) => r(e) }), p = m({ get: () => u.modelValue, set: (e) => r(e) }); function b() { s("action"); } return (e, a) => (t(), d(k, { label: e.label, id: i(o), icon: e.icon, "icon-type": e.iconType, required: e.required, type: e.type, readonly: e.readonly }, { default: V(() => [ v("div", A, [ e.type === "dropdown" && e.data ? (t(), d(B, { key: 0, modelValue: n.value, "onUpdate:modelValue": a[0] || (a[0] = (l) => n.value = l), id: i(o), options: e.data, name: e.name, required: e.required, placeholder: e.placeholder }, null, 8, ["modelValue", "id", "options", "name", "required", "placeholder"])) : e.type === "number" ? (t(), d(I, { key: 1, modelValue: p.value, "onUpdate:modelValue": a[1] || (a[1] = (l) => p.value = l), id: i(o), "min-value": e.minValue, "max-value": e.maxValue }, null, 8, ["modelValue", "id", "min-value", "max-value"])) : (t(), d(C, { key: 2, modelValue: n.value, "onUpdate:modelValue": a[2] || (a[2] = (l) => n.value = l), id: i(o), type: e.inputType, name: e.name, required: e.required, placeholder: e.placeholder, "no-optional-label": !0 }, null, 8, ["modelValue", "id", "type", "name", "required", "placeholder"])), q(T, { "data-test": `${e.name}Submit`, icon: e.buttonIcon, label: e.buttonLabel, "icon-color": e.buttonIconColor, styling: e.action, type: "button", "is-loading": e.isLoading, disabled: e.buttonDisabled, secondary: e.secondary, onClickEvent: a[3] || (a[3] = (l) => b()) }, null, 8, ["data-test", "icon", "label", "icon-color", "styling", "is-loading", "disabled", "secondary"]) ]) ]), _: 1 }, 8, ["label", "id", "icon", "icon-type", "required", "type", "readonly"])); } }), U = /* @__PURE__ */ F(L, [["__scopeId", "data-v-18f51ff2"]]); export { U as A }; //# sourceMappingURL=ActionField-BsmMIhW6.js.map