Skip to content

Commit

Permalink
feat(frontend): Improve inputs (#3651)
Browse files Browse the repository at this point in the history
* fix(frontend): Improve AgGrid Infinite table default codes + deprecated table + improve AutoDatatable

* fix(frontend): Handle undefined rowCount

* fix(frontend): Improve Ag Grid footer

* fix(frontend): Improve Deprecated badge

* fix(frontend): Improve inputs

* fix(frontend): revert select
  • Loading branch information
fatonramadani committed May 1, 2024
1 parent d7d2f03 commit 790f263
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 10 deletions.
4 changes: 4 additions & 0 deletions frontend/src/lib/assets/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,7 @@
.component-wrapper {
@apply rounded-md border overflow-hidden border-gray-300 dark:border-gray-600;
}

.app-editor-input {
@apply rounded-md border border-gray-300 dark:border-gray-500 focus:border-gray-300 focus:dark:border-gray-500 focus:!ring-1 focus:!ring-blue-300;
}
19 changes: 16 additions & 3 deletions frontend/src/lib/components/DateTimeInput.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte'
import { Button } from './common'
import { Clock } from 'lucide-svelte'
export let value: string | undefined = undefined
Expand Down Expand Up @@ -63,11 +64,21 @@

<div class="flex flex-row gap-1 items-center w-full" id={randomId} on:pointerdown on:focus>
<!-- svelte-ignore a11y-autofocus -->
<input type="date" bind:value={date} {autofocus} class="!w-3/4" min={minDate} max={maxDate} />
<input type="time" bind:value={time} class="!w-1/4 min-w-[100px]" />
<input
type="date"
bind:value={date}
{autofocus}
class="!w-3/4 app-editor-input"
min={minDate}
max={maxDate}
/>
<input type="time" bind:value={time} class="!w-1/4 min-w-[100px] app-editor-input" />
<Button
variant="border"
color="light"
startIcon={{
icon: Clock
}}
size="xs"
portalTarget={`#${randomId}`}
dropdownItems={useDropdown
Expand Down Expand Up @@ -100,6 +111,8 @@
: undefined}
on:click={() => {
setTimeLater(0)
}}>Now</Button
}}
>
Now
</Button>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@
min={resolvedConfig.minDate}
max={resolvedConfig.maxDate}
placeholder="Type..."
class={twMerge('windmillapp w-full py-1.5 text-sm px-2', css?.input?.class, 'wm-date-input')}
class={twMerge(
'windmillapp w-full py-1.5 text-sm px-2 app-editor-input',
css?.input?.class,
'wm-date-input'
)}
style={css?.input?.style ?? ''}
/>
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<InitializeComponent {id} />

{#if render}
<div class="w-full h-full p-1">
<div class="w-full h-full">
<FileInput
bind:this={fileInput}
accept={acceptedFileTypes?.length ? acceptedFileTypes?.join(', ') : undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,21 @@
{/if}

<style>
:global(.ql-toolbar) {
@apply rounded-t-md;
}
:global(.dark .ql-toolbar) {
@apply border-gray-500;
}
:global(.ql-toolbar .ql-stroke) {
fill: none;
@apply stroke-primary;
@apply stroke-primary rounded-t-md;
}
:global(.ql-toolbar .ql-fill) {
@apply fill-primary;
@apply fill-primary bg-red-500;
stroke: none;
}
Expand All @@ -116,6 +124,14 @@
}
:global(.ql-container) {
@apply text-primary;
@apply text-primary rounded-b-md;
}
:global(.dark .ql-container) {
@apply border-gray-500;
}
:global(.dark .ql-container > .ql-editor.ql-blank::before) {
@apply text-gray-500;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@
let css = initCss($app.css?.[appCssKey], customCss)
$: classInput = twMerge(
'windmillapp w-full py-1.5 text-sm focus:ring-indigo-100 px-2',
'windmillapp w-full py-1.5 px-2 text-sm',
css?.input?.class ?? '',
resolvedConfig.disabled ? 'placeholder:text-gray-400 dark:placeholder:text-gray-600' : '',
'app-editor-input',
'wm-text-input'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
formatted: twMerge(
'px-2 w-full py-1.5 windmillapp',
css?.input?.class,
'app-editor-input h-8',
'wm-currency-input'
),
wrapper: 'w-full windmillapp',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
class={twMerge(
`relative center-center flex-col text-center font-medium text-tertiary
border border-dashed border-gray-400 hover:border-blue-500
focus-within:border-blue-500 hover:bg-blue-50 dark:hover:bg-frost-900 focus-within:bg-blue-50
focus-within:border-blue-300 hover:bg-blue-50 dark:hover:bg-frost-900
duration-200 rounded-lg p-1`,
c
)}
Expand Down

0 comments on commit 790f263

Please sign in to comment.