UNPKG

various-ui

Version:

This is a test version of the Vue 3 component library

82 lines (79 loc) 2.8 kB
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createCommentVNode, createElementVNode, mergeProps, toHandlers, withKeys, createVNode, Transition, withCtx, withDirectives, vShow } from 'vue'; import { UiTextareaPropsOption, UiTextareaEmits } from './index.mjs'; import { useComposable } from './src/composable.mjs'; import { UiIcon } from '../../icon/index.mjs'; const _hoisted_1 = { key: 0, class: "ui-mask ui-loading" }; const __default__ = defineComponent({ name: "UiTextarea" }); var _sfc_main = /* @__PURE__ */ defineComponent({ ...__default__, props: UiTextareaPropsOption, emits: UiTextareaEmits, setup(__props, { expose: __expose, emit: __emit }) { const define = __props; const emits = __emit; const { refs, methods, handlers, computeds } = useComposable(define, emits); const { className, status, style, attrs } = computeds; const { inputHandler } = handlers; const { enter, clear, focus, blur } = methods; const { inputNode } = refs; ; __expose({ clear, focus, blur }); return (_ctx, _cache) => { return openBlock(), createElementBlock( "div", { class: normalizeClass(["ui-textarea", unref(className)]), style: normalizeStyle(unref(style)) }, [ createCommentVNode(" * \u8F93\u5165\u6846\u4E3B\u4F53 "), createElementVNode( "textarea", mergeProps({ class: "ui-form-control", ref_key: "inputNode", ref: inputNode }, toHandlers(unref(inputHandler), true), unref(attrs), { onKeydown: _cache[0] || (_cache[0] = withKeys( //@ts-ignore (...args) => unref(enter) && unref(enter)(...args), ["enter"] )) }), null, 16 /* FULL_PROPS */ ), createCommentVNode(" \u906E\u7F69\u5C42 "), createVNode(Transition, null, { default: withCtx(() => [ unref(status).name == "loading" ? (openBlock(), createElementBlock("div", _hoisted_1, [ withDirectives(createVNode( unref(UiIcon), { name: "loading", class: "ui-mask-icon" }, null, 512 /* NEED_PATCH */ ), [ [vShow, unref(status).is] ]) ])) : createCommentVNode("v-if", true) ]), _: 1 /* STABLE */ }) ], 6 /* CLASS, STYLE */ ); }; } }); export { _sfc_main as default }; //# sourceMappingURL=index.vue2.mjs.map