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

fix(lib): title align to the right + use font-variant-numeric #630

Merged
merged 3 commits into from
Oct 23, 2024
Merged
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
13 changes: 6 additions & 7 deletions cosmoz-omnitable-column-date.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/* eslint-disable no-return-assign */
import '@neovici/cosmoz-input';
import { html } from 'lit-html';
import { PolymerElement } from '@polymer/polymer/polymer-element';
import '@polymer/paper-dropdown-menu/paper-dropdown-menu';
import '@neovici/cosmoz-input';

import './ui-helpers/cosmoz-clear-button';

import { PolymerElement } from '@polymer/polymer/polymer-element';
import { html } from 'lit-html';

import { columnMixin } from './cosmoz-omnitable-column-mixin';
import './lib/cosmoz-omnitable-date-range-input';
import { defaultComputeSource } from './lib/utils-data';
Expand Down Expand Up @@ -95,13 +93,14 @@ class OmnitableColumnDate extends columnMixin(PolymerElement) {
}

renderCell(column, { item }) {
return getString(column, item);
return html`<div class="omnitable-cell-date">
${getString(column, item)}
</div>`;
}

renderEditCell(column, { item }, onItemChange) {
const onChange = (event) =>
onItemChange(fromInputString(event.target.value));

return html`<cosmoz-input
no-label-float
type="date"
Expand Down
3 changes: 2 additions & 1 deletion cosmoz-omnitable-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ export default css`
.tableContent .itemRow-cell paper-dropdown-menu {
margin-top: -20px;
}
cosmoz-omnitable-item-expand[expanded] {
Expand Down Expand Up @@ -437,7 +438,7 @@ export default css`
overflow: initial;
}
.omnitable-cell-number {
.omnitable-cell-number, .omnitable-cell-date {
font-variant-numeric: tabular-nums;
}
Expand Down
16 changes: 9 additions & 7 deletions lib/cosmoz-omnitable-number-range-input.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { _ } from '@neovici/cosmoz-i18next';
import { PolymerElement } from '@polymer/polymer';
import { html } from 'lit-html';
import { ifDefined } from 'lit-html/directives/if-defined.js';
import { html } from 'lit-html';
import { _ } from '@neovici/cosmoz-i18next';
import '@neovici/cosmoz-input';
import { rangeInputMixin } from './cosmoz-omnitable-range-input-mixin';
import { polymerHauntedRender } from './polymer-haunted-render-mixin';
Expand Down Expand Up @@ -42,6 +42,12 @@ class NumberRangeInput extends rangeInputMixin(
paper-dropdown-menu {
--iron-icon-width: 0;
display: block;
text-align: right;
}
.dropdown-content {
padding: 15px;
min-width: 100px;
text-align: left;
}
</style>

Expand All @@ -58,11 +64,7 @@ class NumberRangeInput extends rangeInputMixin(
?opened=${this.headerFocused}
@opened-changed=${onOpenedChanged}
>
<div
class="dropdown-content"
slot="dropdown-content"
style="padding: 15px; min-width: 100px;"
>
<div class="dropdown-content" slot="dropdown-content">
<h3 style="margin: 0;">${this.title}</h3>
<cosmoz-input
class=${this._fromClasses}
Expand Down