inputtext: компонент, стилизация, сторисы#51
Conversation
5709279 to
8526b89
Compare
| @@ -0,0 +1,31 @@ | |||
| export const inputtextCss = ({ dt }: { dt: (token: string) => string }): string => ` | |||
|
|
|||
There was a problem hiding this comment.
background и color поля не меняется на темной теме, включая применение флагов disabled и readonly
There was a problem hiding this comment.
Возможно проблема в самом переключателе цветов в сторибуке, но я не вижу, чтобы при переключении темы в сторибуке цвета компонента менялись
There was a problem hiding this comment.
@Tenkoru фикс в виде pull от ветки /styles-debug
| @@ -0,0 +1,31 @@ | |||
| export const inputtextCss = ({ dt }: { dt: (token: string) => string }): string => ` | |||
|
|
|||
There was a problem hiding this comment.
При :focus у поля нет box-shadow
There was a problem hiding this comment.
Цвет box-shadow сейчас идентичен цвету border, в макете это #12611B
| name: 'Default', | ||
| render: (args) => { | ||
| const parts: string[] = []; | ||
|
|
There was a problem hiding this comment.
Так как используется NG_VALUE_ACCESSOR, то в stories тоже не должно быть disabled, invalid и ngModel
There was a problem hiding this comment.
Видимо не совсем ясно выразился. Disabled и invalid из stories удалять не нужно, но изменить их отображение на formControl
Например render для Default: Story
`
render: (args) => {
const parts: string[] = [];
if (args.placeholder) parts.push(`placeholder="${args.placeholder}"`);
if (args.size && args.size !== 'base') parts.push(`size="${args.size}"`);
if (args.readonly) parts.push(`[readonly]="true"`);
if (args.showClear) parts.push(`[showClear]="true"`);
if (args.fluid) parts.push(`[fluid]="true"`);
const validators = [];
if (args.invalid) validators.push(Validators.required);
const control = new FormControl({
value: '',
disabled: args.disabled,
}, validators);
const template = `
<input-text
[formControl]="control"
${parts.join('\n ')}
></input-text>
`;
return { props: { ...args, control }, template };
},
`
9354d99 to
28735e7
Compare
| import { InputTextComponent } from '@cdek-it/angular-ui-kit'; | ||
| import { FormControl, Validators, ReactiveFormsModule } from '@angular/forms'; | ||
|
|
||
| // formControl = new FormControl('', Validators.required); |
There was a problem hiding this comment.
В некоторых сторях закоменчены поля
657f925 to
0d78e17
Compare
No description provided.