From aa6c90285a5f82c3ab78a4598ac825c44976af3a Mon Sep 17 00:00:00 2001 From: Antoine Prentout Date: Mon, 18 Aug 2025 15:33:21 +0200 Subject: [PATCH 1/5] Smart Textarea: Add new component --- addon/components/o-s-s/smart/tag-input.hbs | 4 +- addon/components/o-s-s/smart/tag-input.ts | 4 + addon/components/o-s-s/smart/text-area.hbs | 23 +++ .../o-s-s/smart/text-area.stories.js | 121 +++++++++++++++ addon/components/o-s-s/smart/text-area.ts | 43 ++++++ addon/components/o-s-s/text-area.ts | 14 +- app/components/o-s-s/smart/text-area.js | 1 + app/styles/atoms/smart-textarea.less | 53 +++++++ app/styles/oss-components.less | 1 + tests/dummy/app/controllers/smart.ts | 8 + tests/dummy/app/templates/smart.hbs | 20 +++ .../components/o-s-s/smart/text-area-test.ts | 144 ++++++++++++++++++ 12 files changed, 428 insertions(+), 8 deletions(-) create mode 100644 addon/components/o-s-s/smart/text-area.hbs create mode 100644 addon/components/o-s-s/smart/text-area.stories.js create mode 100644 addon/components/o-s-s/smart/text-area.ts create mode 100644 app/components/o-s-s/smart/text-area.js create mode 100644 app/styles/atoms/smart-textarea.less create mode 100644 tests/integration/components/o-s-s/smart/text-area-test.ts diff --git a/addon/components/o-s-s/smart/tag-input.hbs b/addon/components/o-s-s/smart/tag-input.hbs index 60dc39551..2de81268d 100644 --- a/addon/components/o-s-s/smart/tag-input.hbs +++ b/addon/components/o-s-s/smart/tag-input.hbs @@ -10,9 +10,7 @@ {{else}}
- - {{if (or this.inputValue this.isInputFocused) this.inputValue this.placeholder}} - + {{this.hiddenSpanValue}} { return this.args.placeholder ?? this.intl.t('oss-components.smart.tag_input.placeholder'); } + get hiddenSpanValue(): string { + return this.inputValue || this.isInputFocused ? this.inputValue : this.placeholder; + } + @action registerElement(element: HTMLElement): void { this.element = element; diff --git a/addon/components/o-s-s/smart/text-area.hbs b/addon/components/o-s-s/smart/text-area.hbs new file mode 100644 index 000000000..c1bf990b9 --- /dev/null +++ b/addon/components/o-s-s/smart/text-area.hbs @@ -0,0 +1,23 @@ +
+
+ {{#if @loading}} +
+
{{@placeholder}}
+
+ {{/if}} +