mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-18 13:12:16 +01:00
indent design bug fixes on time view, fixes ST-208
This commit is contained in:
@@ -111,17 +111,18 @@ const expanded = ref(false);
|
|||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
class="h-4 w-4 rounded bg-card-background border-input-border text-accent-500/80 focus:ring-accent-500/80" />
|
class="h-4 w-4 rounded bg-card-background border-input-border text-accent-500/80 focus:ring-accent-500/80" />
|
||||||
<GroupedItemsCountButton
|
<div class="flex items-center">
|
||||||
:expanded="expanded"
|
<GroupedItemsCountButton
|
||||||
@click="expanded = !expanded">
|
:expanded="expanded"
|
||||||
{{ timeEntry?.timeEntries?.length }}
|
@click="expanded = !expanded">
|
||||||
</GroupedItemsCountButton>
|
{{ timeEntry?.timeEntries?.length }}
|
||||||
<TimeEntryDescriptionInput
|
</GroupedItemsCountButton>
|
||||||
@changed="updateTimeEntryDescription"
|
<TimeEntryDescriptionInput
|
||||||
class="flex-1"
|
@changed="updateTimeEntryDescription"
|
||||||
:modelValue="
|
:modelValue="
|
||||||
timeEntry.description
|
timeEntry.description
|
||||||
"></TimeEntryDescriptionInput>
|
"></TimeEntryDescriptionInput>
|
||||||
|
</div>
|
||||||
<TimeTrackerProjectTaskDropdown
|
<TimeTrackerProjectTaskDropdown
|
||||||
:showBadgeBorder="false"
|
:showBadgeBorder="false"
|
||||||
@changed="updateProjectAndTask"
|
@changed="updateProjectAndTask"
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
const value = defineModel();
|
const value = defineModel();
|
||||||
const emit = defineEmits(['changed']);
|
const emit = defineEmits(['changed']);
|
||||||
|
|
||||||
@@ -6,60 +8,39 @@ function onChange(event: Event) {
|
|||||||
const target = event.target as HTMLInputElement;
|
const target = event.target as HTMLInputElement;
|
||||||
if (target.value !== value.value) {
|
if (target.value !== value.value) {
|
||||||
emit('changed', target.value);
|
emit('changed', target.value);
|
||||||
|
value.value = target.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onInput(event: Event) {
|
||||||
|
liveDataValue.value = (event.target as HTMLInputElement).value;
|
||||||
|
}
|
||||||
|
|
||||||
|
const liveDataValue = ref(value.value);
|
||||||
|
|
||||||
|
const displaysPlaceholder = computed(() => {
|
||||||
|
return liveDataValue.value === '' || liveDataValue.value === null;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<label class="input-sizer text-sm font-medium" :data-value="value">
|
<div class="relative text-sm font-medium p">
|
||||||
|
<div
|
||||||
|
:class="[
|
||||||
|
'opacity-0 py-2 text-base whitespace-pre pl-3 pr-1',
|
||||||
|
{ 'min-w-[150px]': displaysPlaceholder },
|
||||||
|
]">
|
||||||
|
{{ liveDataValue }}
|
||||||
|
</div>
|
||||||
<input
|
<input
|
||||||
data-testid="time_entry_description"
|
data-testid="time_entry_description"
|
||||||
:value="value"
|
:value="liveDataValue"
|
||||||
@blur="onChange"
|
@blur="onChange"
|
||||||
|
@input="onInput"
|
||||||
@keydown.enter="onChange"
|
@keydown.enter="onChange"
|
||||||
placeholder="Add a description"
|
placeholder="Add a description"
|
||||||
class="text-white font-medium bg-transparent focus-visible:ring-0 hover:bg-card-background rounded-lg border border-transparent hover:border-card-border" />
|
class="absolute px-0 pl-3 pr-1 left-0 top-0 w-full text-white font-medium bg-transparent focus-visible:ring-0 rounded-lg border-0" />
|
||||||
</label>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="postcss">
|
|
||||||
.input-sizer {
|
|
||||||
display: inline-grid;
|
|
||||||
vertical-align: top;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&.stacked {
|
|
||||||
align-items: stretch;
|
|
||||||
|
|
||||||
&::after,
|
|
||||||
input,
|
|
||||||
textarea {
|
|
||||||
grid-area: 2 / 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after,
|
|
||||||
input,
|
|
||||||
textarea {
|
|
||||||
width: auto;
|
|
||||||
min-width: 1em;
|
|
||||||
grid-area: 1 / 2;
|
|
||||||
padding: 0.5rem 0.75rem;
|
|
||||||
margin: 0;
|
|
||||||
font: inherit;
|
|
||||||
resize: none;
|
|
||||||
background: none;
|
|
||||||
appearance: none;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: attr(data-value) ' ';
|
|
||||||
visibility: hidden;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ function updateProjectAndTask(projectId: string, taskId: string) {
|
|||||||
<div class="w-7 h-7" v-if="indent === true"></div>
|
<div class="w-7 h-7" v-if="indent === true"></div>
|
||||||
<TimeEntryDescriptionInput
|
<TimeEntryDescriptionInput
|
||||||
@changed="updateTimeEntryDescription"
|
@changed="updateTimeEntryDescription"
|
||||||
class="flex-1"
|
|
||||||
:modelValue="
|
:modelValue="
|
||||||
timeEntry.description
|
timeEntry.description
|
||||||
"></TimeEntryDescriptionInput>
|
"></TimeEntryDescriptionInput>
|
||||||
|
|||||||
Reference in New Issue
Block a user