From d3b9c1ca9699f9c7c41267f7eac495e2ff6fcb83 Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Mon, 6 Dec 2021 12:12:03 +0300 Subject: [PATCH] Update EditWithIcon, add clear (#537) Signed-off-by: Alexander Platov --- packages/theme/styles/_layouts.scss | 1 + packages/ui/lang/en.json | 3 +- packages/ui/src/components/ActionIcon.svelte | 1 + .../ui/src/components/EditWithIcon.svelte | 56 ++++++++++--------- packages/ui/src/plugin.ts | 1 + .../src/components/SpaceView.svelte | 25 +++------ 6 files changed, 42 insertions(+), 45 deletions(-) diff --git a/packages/theme/styles/_layouts.scss b/packages/theme/styles/_layouts.scss index d51ea45ac2..5b347ccc0d 100644 --- a/packages/theme/styles/_layouts.scss +++ b/packages/theme/styles/_layouts.scss @@ -187,6 +187,7 @@ p:last-child { margin-block-end: 0; } .ml-3 { margin-left: .75rem; } .ml-4 { margin-left: 1rem; } .mr-1 { margin-right: .25rem; } +.mr-2 { margin-right: .5rem; } .mr-4 { margin-right: 1rem; } .mr-8 { margin-right: 2rem; } .mt-2 { margin-top: .5rem; } diff --git a/packages/ui/lang/en.json b/packages/ui/lang/en.json index 37bb89c5c1..9c69d8cf34 100644 --- a/packages/ui/lang/en.json +++ b/packages/ui/lang/en.json @@ -3,6 +3,7 @@ "Cancel": "Cancel", "Minutes": "{minutes, plural, =0 {less than a minute ago} =1 {a minute ago} other {# minutes ago}}", "Hours": "{hours, plural, =0 {less than an hour ago} =1 {an hour ago} other {# hours ago}}", - "Days": "{days, plural, =0 {today} =1 {yesterday} other {# days ago}}" + "Days": "{days, plural, =0 {today} =1 {yesterday} other {# days ago}}", + "Clear": "Clear" } } diff --git a/packages/ui/src/components/ActionIcon.svelte b/packages/ui/src/components/ActionIcon.svelte index 69543866cf..7bfe3cd330 100644 --- a/packages/ui/src/components/ActionIcon.svelte +++ b/packages/ui/src/components/ActionIcon.svelte @@ -44,6 +44,7 @@ .button { color: var(--theme-caption-color); border-radius: .125rem; + cursor: pointer; .icon { // transform-origin: center center; diff --git a/packages/ui/src/components/EditWithIcon.svelte b/packages/ui/src/components/EditWithIcon.svelte index 30b5290902..1c380abcf2 100644 --- a/packages/ui/src/components/EditWithIcon.svelte +++ b/packages/ui/src/components/EditWithIcon.svelte @@ -12,57 +12,61 @@ // See the License for the specific language governing permissions and // limitations under the License. --> + -
- -
- {#if typeof (icon) === 'string'} - - {:else} - - {/if} -
+
textHTML.focus()}> +
+ + {#if value} +
{ value = '' }}> + +
+
+
+ {/if}
diff --git a/packages/ui/src/plugin.ts b/packages/ui/src/plugin.ts index c9a2c9f82b..c37f08a481 100644 --- a/packages/ui/src/plugin.ts +++ b/packages/ui/src/plugin.ts @@ -28,5 +28,6 @@ import { plugin } from '@anticrm/platform' Minutes: '' as IntlString, Hours: '' as IntlString, Days: '' as IntlString, + Clear: '' as IntlString } }) \ No newline at end of file diff --git a/plugins/workbench-resources/src/components/SpaceView.svelte b/plugins/workbench-resources/src/components/SpaceView.svelte index 22617329f1..61cbad8ef7 100644 --- a/plugins/workbench-resources/src/components/SpaceView.svelte +++ b/plugins/workbench-resources/src/components/SpaceView.svelte @@ -60,12 +60,12 @@ function onSearch(ev: Event) { {:then viewlets} {#if viewlets.length > 0} -
- +
+
{#each viewlets as viewlet, i} -
{ selected = i }}> +
{ selected = i }}>
@@ -93,32 +93,21 @@ function onSearch(ev: Event) {