From bf4e40ecd51e99a8899bb5e490a5f190506a90fe Mon Sep 17 00:00:00 2001 From: Itamar Givon Date: Thu, 26 Aug 2021 12:13:10 +0200 Subject: [PATCH] Add TextArea component (#459) * Upstream TextArea component from Mismatch Finder * Add TextArea story (#460) Co-authored-by: Silvan Heintze <59574251+Silvan-WMDE@users.noreply.github.com> Bug: T289138 Bug: T289141 --- vue-components/src/components/ResizeLimit.ts | 14 ++ vue-components/src/components/TextArea.vue | 201 ++++++++++++++++++ vue-components/stories/TextArea.stories.ts | 84 ++++++++ .../tests/unit/components/TextArea.spec.ts | 73 +++++++ 4 files changed, 372 insertions(+) create mode 100644 vue-components/src/components/ResizeLimit.ts create mode 100644 vue-components/src/components/TextArea.vue create mode 100644 vue-components/stories/TextArea.stories.ts create mode 100644 vue-components/tests/unit/components/TextArea.spec.ts diff --git a/vue-components/src/components/ResizeLimit.ts b/vue-components/src/components/ResizeLimit.ts new file mode 100644 index 000000000..8e1f5e8b9 --- /dev/null +++ b/vue-components/src/components/ResizeLimit.ts @@ -0,0 +1,14 @@ +enum ResizeLimit { + Horizontal = 'horizontal', + Vertical = 'vertical', + None = 'none' +} + +function validateLimit( limit: string ): boolean { + return Object.values( ResizeLimit ).includes( limit as ResizeLimit ); +} + +export { + ResizeLimit, + validateLimit, +}; diff --git a/vue-components/src/components/TextArea.vue b/vue-components/src/components/TextArea.vue new file mode 100644 index 000000000..ca100e15a --- /dev/null +++ b/vue-components/src/components/TextArea.vue @@ -0,0 +1,201 @@ +