chore: add consistent styles inheritance for types
This commit is contained in:
parent
2f48f59244
commit
7f744e6368
5 changed files with 54 additions and 51 deletions
|
|
@ -607,58 +607,56 @@ const FormControlMixinImplementation = superclass =>
|
|||
* @return {CSSResult | CSSResult[]}
|
||||
*/
|
||||
static get styles() {
|
||||
return [
|
||||
css`
|
||||
/**********************
|
||||
return css`
|
||||
/**********************
|
||||
{block} .form-field
|
||||
********************/
|
||||
********************/
|
||||
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
|
||||
:host([hidden]) {
|
||||
display: none;
|
||||
}
|
||||
:host([hidden]) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:host([disabled]) {
|
||||
pointer-events: none;
|
||||
}
|
||||
:host([disabled]) {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
:host([disabled]) .form-field__label ::slotted(*),
|
||||
:host([disabled]) .form-field__help-text ::slotted(*) {
|
||||
color: var(--disabled-text-color, #adadad);
|
||||
}
|
||||
:host([disabled]) .form-field__label ::slotted(*),
|
||||
:host([disabled]) .form-field__help-text ::slotted(*) {
|
||||
color: var(--disabled-text-color, #adadad);
|
||||
}
|
||||
|
||||
/***********************
|
||||
/***********************
|
||||
{block} .input-group
|
||||
*********************/
|
||||
*********************/
|
||||
|
||||
.input-group__container {
|
||||
display: flex;
|
||||
}
|
||||
.input-group__container {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.input-group__input {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
}
|
||||
.input-group__input {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/***** {state} :disabled *****/
|
||||
:host([disabled]) .input-group ::slotted(slot='input') {
|
||||
color: var(--disabled-text-color, #adadad);
|
||||
}
|
||||
/***** {state} :disabled *****/
|
||||
:host([disabled]) .input-group ::slotted(slot='input') {
|
||||
color: var(--disabled-text-color, #adadad);
|
||||
}
|
||||
|
||||
/***********************
|
||||
/***********************
|
||||
{block} .form-control
|
||||
**********************/
|
||||
**********************/
|
||||
|
||||
.input-group__container > .input-group__input ::slotted(.form-control) {
|
||||
flex: 1 1 auto;
|
||||
margin: 0; /* remove input margin in Safari */
|
||||
font-size: 100%; /* normalize default input font-size */
|
||||
}
|
||||
`,
|
||||
];
|
||||
.input-group__container > .input-group__input ::slotted(.form-control) {
|
||||
flex: 1 1 auto;
|
||||
margin: 0; /* remove input margin in Safari */
|
||||
font-size: 100%; /* normalize default input font-size */
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -53,11 +53,14 @@ export class LionInputAmount extends LocalizeMixin(LionInput) {
|
|||
}
|
||||
|
||||
static get styles() {
|
||||
return css`
|
||||
.input-group__container > .input-group__input ::slotted(.form-control) {
|
||||
text-align: right;
|
||||
}
|
||||
`;
|
||||
return [
|
||||
super.styles,
|
||||
css`
|
||||
.input-group__container > .input-group__input ::slotted(.form-control) {
|
||||
text-align: right;
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
||||
constructor() {
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
.input-group__container > .input-group__input ::slotted(.form-control) {
|
||||
text-align: center;
|
||||
}
|
||||
`;
|
||||
return [
|
||||
super.styles,
|
||||
css`
|
||||
.input-group__container > .input-group__input ::slotted(.form-control) {
|
||||
text-align: center;
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
||||
static get properties() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue