UNPKG

vuestic-ui

Version:
135 lines (134 loc) 7.46 kB
import { _ as _sfc_main } from "./VaInputWrapper.vue_vue_type_script_lang.mjs"; import { resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createVNode, withCtx, createBlock, mergeProps, renderSlot, normalizeProps, guardReactiveProps, createCommentVNode, withDirectives, vModelDynamic, toDisplayString } from "vue"; import { _ as _export_sfc } from "../../../plugin-vue_export-helper.mjs"; const VaInputWrapper_vue_vue_type_style_index_0_lang = ""; const _hoisted_1 = { class: "va-input-wrapper__fieldset va-input-wrapper__size-keeper" }; const _hoisted_2 = { class: "va-input-wrapper__container" }; const _hoisted_3 = { class: "va-input-wrapper__text" }; const _hoisted_4 = ["placeholder", "readonly", "disabled"]; const _hoisted_5 = ["id"]; const _hoisted_6 = { class: "va-input-wrapper__counter" }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_VaInputLabel = resolveComponent("VaInputLabel"); const _component_va_icon = resolveComponent("va-icon"); const _component_va_message_list = resolveComponent("va-message-list"); return openBlock(), createElementBlock("div", { class: normalizeClass(["va-input-wrapper", _ctx.wrapperClass]), onClick: _cache[6] || (_cache[6] = ($event) => _ctx.$emit("click", $event)), style: normalizeStyle(`--va-background-computed: ${String(_ctx.backgroundComputed)};--va-color-computed: ${String(_ctx.colorComputed)};--va-text-color-computed: ${String(_ctx.textColorComputed)}`) }, [ createElementVNode("fieldset", _hoisted_1, [ createVNode(_component_va_message_list, { color: _ctx.messagesColor, "model-value": _ctx.messagesComputed, limit: _ctx.errorLimit, "inherit-slots": ["message", "messages"] }, { default: withCtx(({ ariaAttributes: messagesChildAriaAttributes }) => [ (_ctx.$props.label || _ctx.$slots.label) && !_ctx.$props.innerLabel ? (openBlock(), createBlock(_component_VaInputLabel, mergeProps({ key: 0, class: "va-input-wrapper__label va-input-wrapper__label--outer" }, _ctx.vaInputLabelProps, { id: _ctx.labelId }), { default: withCtx((bind) => [ renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps(bind))) ]), _: 3 }, 16, ["id"])) : createCommentVNode("", true), createElementVNode("div", _hoisted_2, [ _ctx.$slots.prepend ? (openBlock(), createElementBlock("div", { key: 0, class: "va-input-wrapper__prepend-inner", onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click-prepend")) }, [ renderSlot(_ctx.$slots, "prepend") ])) : createCommentVNode("", true), createElementVNode("div", { onClick: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("click-field", $event)), class: "va-input-wrapper__field" }, [ _ctx.$slots.prependInner ? (openBlock(), createElementBlock("div", { key: 0, class: "va-input-wrapper__prepend-inner", ref: "container", onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("click-prepend-inner", $event)) }, [ renderSlot(_ctx.$slots, "prependInner") ], 512)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3, [ (_ctx.$props.label || _ctx.$slots.label) && _ctx.$props.innerLabel ? (openBlock(), createBlock(_component_VaInputLabel, mergeProps({ key: 0, class: "va-input-wrapper__label va-input-wrapper__label--inner" }, _ctx.vaInputLabelProps, { id: _ctx.labelId }), { default: withCtx((bind) => [ renderSlot(_ctx.$slots, "label", normalizeProps(guardReactiveProps(bind))) ]), _: 3 }, 16, ["id"])) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ ariaAttributes: { ...messagesChildAriaAttributes, ..._ctx.ariaAttributes }, value: _ctx.vModel })), () => [ withDirectives(createElementVNode("input", mergeProps({ ...messagesChildAriaAttributes, ..._ctx.ariaAttributes }, { "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.vModel = $event), ref: "inputRef", placeholder: _ctx.$props.placeholder, readonly: _ctx.$props.readonly, disabled: _ctx.$props.disabled }), null, 16, _hoisted_4), [ [vModelDynamic, _ctx.vModel] ]) ]) ]), _ctx.success ? (openBlock(), createBlock(_component_va_icon, { key: 1, color: "success", name: "va-check-circle", class: "va-input-wrapper__icon va-input-wrapper__icon--success" })) : createCommentVNode("", true), _ctx.error ? (openBlock(), createBlock(_component_va_icon, { key: 2, color: "danger", name: "va-warning", class: "va-input-wrapper__icon va-input-wrapper__icon--error" })) : createCommentVNode("", true), _ctx.$props.loading ? (openBlock(), createBlock(_component_va_icon, { key: 3, color: _ctx.$props.color, name: "va-loading", spin: "counter-clockwise", class: "va-input-wrapper__icon va-input-wrapper__icon--loading" }, null, 8, ["color"])) : createCommentVNode("", true), renderSlot(_ctx.$slots, "icon"), _ctx.$slots.appendInner ? (openBlock(), createElementBlock("div", { key: 4, class: "va-input-wrapper__append-inner", onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("click-append-inner", $event)) }, [ renderSlot(_ctx.$slots, "appendInner") ])) : createCommentVNode("", true) ]), _ctx.$slots.append ? (openBlock(), createElementBlock("div", { key: 1, class: "va-input-wrapper__append-inner", onClick: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("click-append")) }, [ renderSlot(_ctx.$slots, "append") ])) : createCommentVNode("", true) ]), _ctx.isCounterVisible ? (openBlock(), createElementBlock("div", { key: 1, class: "va-input-wrapper__counter-wrapper", id: _ctx.characterCountId }, [ renderSlot(_ctx.$slots, "counter", normalizeProps(guardReactiveProps({ valueLength: _ctx.counterValue, maxLength: _ctx.$props.maxLength })), () => [ createElementVNode("div", _hoisted_6, toDisplayString(_ctx.counterComputed), 1) ]) ], 8, _hoisted_5)) : createCommentVNode("", true) ]), _: 3 }, 8, ["color", "model-value", "limit"]) ]) ], 6); } const _VaInputWrapper = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); export { _VaInputWrapper as _ }; //# sourceMappingURL=VaInputWrapper.mjs.map