This commit is contained in:
2024-10-22 09:09:41 +08:00
parent ef869c5ab1
commit 3a9b2d55c6
99 changed files with 4506 additions and 3465 deletions

View File

@@ -1,7 +1,7 @@
import { w as withInstall } from "../badge/index2.js";
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, createElementVNode, normalizeClass, unref, createVNode, createCommentVNode, toDisplayString } from "vue";
import { _ as _sfc_main$2W } from "../_chunks/@layui/index.js";
import { g as isObject } from "../_chunks/@vueuse/index.js";
import { i as isObject } from "../_chunks/@vueuse/index.js";
var index = /* @__PURE__ */ (() => ":root{--textarea-border-radius: var(--global-border-radius);--textarea-border-color: var(--global-neutral-color-3)}.layui-textarea{border-width:1px;border-style:solid;background-color:#fff;color:#000000d9;border-radius:var(--textarea-border-radius);border-color:var(--textarea-border-color);display:block;width:100%;height:auto;line-height:20px;min-height:100px;padding:6px 10px;resize:vertical;position:relative;transition:none;-webkit-transition:none}.layui-textarea-wrapper{position:relative}.layui-textarea:hover,.layui-textarea:focus{border-color:#d2d2d2!important}.layui-textarea-clear{position:absolute;color:#00000073;right:10px;top:10px}.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-texterea-count{color:inherit;white-space:nowrap;pointer-events:none;text-align:right;margin-top:4px}.layui-textarea-disabled{cursor:not-allowed!important;opacity:.6}\n")();
const _hoisted_1 = { class: "layui-textarea-wrapper" };
const _hoisted_2 = ["value", "placeholder", "name", "disabled", "maxlength"];
@@ -74,21 +74,25 @@ const _sfc_main = defineComponent({
}
return count;
});
watch([() => props.modelValue, textareaRef], () => {
var _a, _b;
if (!textareaRef.value || !props.autosize)
return;
const height = ((_a = textareaRef.value) == null ? void 0 : _a.scrollHeight) + 2;
if (isObject(props.autosize)) {
const { minHeight, maxHeight } = props.autosize;
if (height < minHeight || height > maxHeight)
watch(
[() => props.modelValue, textareaRef],
() => {
var _a, _b;
if (!textareaRef.value || !props.autosize)
return;
const height = ((_a = textareaRef.value) == null ? void 0 : _a.scrollHeight) + 2;
if (isObject(props.autosize)) {
const { minHeight, maxHeight } = props.autosize;
if (height < minHeight || height > maxHeight)
return;
}
textareaRef.value.style.height = "1px";
textareaRef.value.style.height = `${((_b = textareaRef.value) == null ? void 0 : _b.scrollHeight) + 2}px`;
},
{
immediate: true
}
textareaRef.value.style.height = "1px";
textareaRef.value.style.height = `${((_b = textareaRef.value) == null ? void 0 : _b.scrollHeight) + 2}px`;
}, {
immediate: true
});
);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1, [
createElementVNode("textarea", {