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

View file

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

View file

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

View file

@ -53,11 +53,14 @@ export class LionInputAmount extends LocalizeMixin(LionInput) {
}
static get styles() {
return css`
return [
super.styles,
css`
.input-group__container > .input-group__input ::slotted(.form-control) {
text-align: right;
}
`;
`,
];
}
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.
export class LionInputStepper extends LionInput {
static get styles() {
return css`
return [
super.styles,
css`
.input-group__container > .input-group__input ::slotted(.form-control) {
text-align: center;
}
`;
`,
];
}
static get properties() {