Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed so the the logviewer's date input is using the umb-input-date… #18494

Open
wants to merge 1 commit into
base: v15/dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Umbraco.Web.UI.Client/src/css/dark.theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@
--uui-color-positive-emphasis: #347d39;
--uui-color-positive-standalone: #347d39;
--uui-color-positive-contrast: #eeeeef;
--uui-color-scheme: dark;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { customElement } from '@umbraco-cms/backoffice/external/lit';
import { customElement, css } from '@umbraco-cms/backoffice/external/lit';
import { UUIInputElement } from '@umbraco-cms/backoffice/external/uui';

export type InputDateType = 'date' | 'time' | 'datetime-local';
Expand Down Expand Up @@ -28,6 +28,16 @@ export class UmbInputDateElement extends UUIInputElement {
super();
this.type = 'date'; // Default to 'date'
}

// Adding styles override to add a darkmode version.
static override styles = [
...UUIInputElement.styles,
css`
input {
color-scheme: var(--uui-color-scheme, normal);
}
`,
];
}

export default UmbInputDateElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ export class UmbLogViewerDateRangeSelectorElement extends UmbLitElement {
return html`
<div class="input-container">
<uui-label for="start-date">From:</uui-label>
<input
<umb-input-date
@click=${(e: Event) => {
(e.target as HTMLInputElement).showPicker();
}}
id="start-date"
type="date"
label="From"
.max=${this.#logViewerContext?.today ?? ''}
.value=${this._startDate} />
.value=${this._startDate}></umb-input-date>
</div>
<div class="input-container">
<uui-label for="end-date">To: </uui-label>
<input
<umb-input-date
@click=${(e: Event) => {
(e.target as HTMLInputElement).showPicker();
}}
Expand All @@ -91,7 +91,7 @@ export class UmbLogViewerDateRangeSelectorElement extends UmbLitElement {
label="To"
.min=${this._startDate}
.max=${this.#logViewerContext?.today ?? ''}
.value=${this._endDate} />
.value=${this._endDate}></umb-input-date>
</div>
`;
}
Expand All @@ -104,30 +104,14 @@ export class UmbLogViewerDateRangeSelectorElement extends UmbLitElement {
flex-direction: column;
gap: var(--uui-size-space-3);
}

input {
font-family: inherit;
padding: var(--uui-size-1) var(--uui-size-space-3);
font-size: inherit;
color: inherit;
border-radius: 0;
box-sizing: border-box;
border: none;
background: none;
umb-input-date {
width: 100%;
outline: none;
position: relative;
border-bottom: 2px solid transparent;
}

/* find out better validation for that */
input:out-of-range {
border-color: var(--uui-color-danger);
}

:host([horizontal]) .input-container {
display: flex;
align-items: baseline;
gap: var(--uui-size-space-3);
}
`,
];
Expand Down
Loading