chore: add consistent styles inheritance for types

This commit is contained in:
Joren Broekema 2020-10-05 10:26:05 +02:00
parent 2f48f59244
commit 7f744e6368
5 changed files with 54 additions and 51 deletions

View file

@ -607,8 +607,7 @@ const FormControlMixinImplementation = superclass =>
* @return {CSSResult | CSSResult[]} * @return {CSSResult | CSSResult[]}
*/ */
static get styles() { static get styles() {
return [ return css`
css`
/********************** /**********************
{block} .form-field {block} .form-field
********************/ ********************/
@ -657,8 +656,7 @@ const FormControlMixinImplementation = superclass =>
margin: 0; /* remove input margin in Safari */ margin: 0; /* remove input margin in Safari */
font-size: 100%; /* normalize default input font-size */ font-size: 100%; /* normalize default input font-size */
} }
`, `;
];
} }
/** /**

View file

@ -46,7 +46,6 @@ export function runFormGroupMixinInputSuite(cfg = {}) {
<${childTag} name="custom[]"></${childTag}> <${childTag} name="custom[]"></${childTag}>
</${tag}> </${tag}>
`)); `));
console.log(fieldset.formElements['custom[]'][1]);
fieldset.formElements['custom[]'][0].modelValue = 'custom 1'; fieldset.formElements['custom[]'][0].modelValue = 'custom 1';
fieldset.formElements['custom[]'][1].modelValue = undefined; fieldset.formElements['custom[]'][1].modelValue = undefined;

View file

@ -14,6 +14,6 @@ export declare class NativeTextFieldHost {
export declare function NativeTextFieldImplementation<T extends Constructor<NativeTextField>>( export declare function NativeTextFieldImplementation<T extends Constructor<NativeTextField>>(
superclass: T, superclass: T,
): T & Constructor<NativeTextFieldHost> & NativeTextFieldHost; ): T & Constructor<NativeTextFieldHost> & NativeTextFieldHost & typeof NativeTextField;
export type NativeTextFieldMixin = typeof NativeTextFieldImplementation; export type NativeTextFieldMixin = typeof NativeTextFieldImplementation;

View file

@ -53,11 +53,14 @@ export class LionInputAmount extends LocalizeMixin(LionInput) {
} }
static get styles() { static get styles() {
return css` return [
super.styles,
css`
.input-group__container > .input-group__input ::slotted(.form-control) { .input-group__container > .input-group__input ::slotted(.form-control) {
text-align: right; text-align: right;
} }
`; `,
];
} }
constructor() { constructor() {

View file

@ -10,11 +10,14 @@ import { IsNumber, MinNumber, MaxNumber } from '@lion/form-core';
// @ts-expect-error false positive for incompatible static get properties. Lit-element merges super properties already for you. // @ts-expect-error false positive for incompatible static get properties. Lit-element merges super properties already for you.
export class LionInputStepper extends LionInput { export class LionInputStepper extends LionInput {
static get styles() { static get styles() {
return css` return [
super.styles,
css`
.input-group__container > .input-group__input ::slotted(.form-control) { .input-group__container > .input-group__input ::slotted(.form-control) {
text-align: center; text-align: center;
} }
`; `,
];
} }
static get properties() { static get properties() {