From 9fece6b570b7bbf8bf3327de59225f3f503e08d7 Mon Sep 17 00:00:00 2001 From: Daria Golova Date: Thu, 8 Dec 2022 12:28:50 +0300 Subject: [PATCH] =?UTF-8?q?WIP=20=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=20textarea?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clients/components/ClientDetailInfoSection.vue | 3 ++- src/pages/clients/components/ClientDetailInput.vue | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/pages/clients/components/ClientDetailInfoSection.vue b/src/pages/clients/components/ClientDetailInfoSection.vue index eb99038..722ef16 100644 --- a/src/pages/clients/components/ClientDetailInfoSection.vue +++ b/src/pages/clients/components/ClientDetailInfoSection.vue @@ -64,9 +64,10 @@ span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}} client-detail-input.text-sm.w-max-fit( v-if="section!=='docs' && isChange && settings[section].options[key] !== 'Дата выдачи'", - :style="{fontWeight:key === 'numba'&&600, maxHeight: settings[section].options[key] !== 'Выдан' ? '40px' : ''}", + :style="{fontWeight:key === 'numba'&&600, maxHeight: settings[section].options[key] !== 'Выдан' ? '' : ''}", v-model:value="sectionInfo[key]", :width="settings[section].width", + :rows="section ==='pass' ? 2 : 1", :placeholder="settings[section].placeholder[key]" :sharp="settings[section].sharps[key] && section === 'pass' ? settings[section].sharps[key] : ''" ) diff --git a/src/pages/clients/components/ClientDetailInput.vue b/src/pages/clients/components/ClientDetailInput.vue index 228f432..7cdeb83 100644 --- a/src/pages/clients/components/ClientDetailInput.vue +++ b/src/pages/clients/components/ClientDetailInput.vue @@ -2,14 +2,14 @@ .input-wrapper.flex.gap-x-2.px-3.box-border.w-max-fit(class="py-2.5") textarea.place-input.w-full.outline-0.text-sm.not-italic.resize-none.font-medium( v-if="!sharp" - :rows="Math.ceil(value.length/heightInput)", + :rows="textareaRows", :value="value", + :cols="24", @input="$emit('update:value', $event.target.value)", :placeholder="placeholder", ) input.place-input.w-full.outline-0.text-sm.not-italic.resize-none.font-medium( v-else, - :rows="Math.ceil(value.length/heightInput)", :value="value", @input="$emit('update:value', $event.target.value)", :placeholder="placeholder", @@ -29,12 +29,17 @@ export default { placeholder: { default: "Поиск", }, + rows: Number, }, directives: { mask }, computed: { heightInput() { return ((this.width / 100) * 70) / 11; }, + textareaRows() { + if (this.value.length <= 22) return this.rows; + return Math.ceil(this.value.length / 22); + }, }, }; @@ -44,4 +49,6 @@ export default { border: 2px solid var(--border-light-grey-color) border-radius: 4px background-color: var(--default-white) +textarea + overflow: hidden