RED-6154, add ids to file upload input, radio detail groups and empty state button.
This commit is contained in:
parent
03eedf10c8
commit
1fda6967b1
@ -12,6 +12,7 @@
|
||||
</div>
|
||||
<div class="heading-l" [innerHTML]="text"></div>
|
||||
<iqser-icon-button
|
||||
[buttonId]="buttonId"
|
||||
(action)="action.emit()"
|
||||
*ngIf="showButton"
|
||||
[icon]="buttonIcon"
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { IconButtonTypes } from '../../buttons';
|
||||
import { randomString } from '../../utils';
|
||||
|
||||
@Component({
|
||||
selector: 'iqser-empty-state [text]',
|
||||
@ -15,6 +16,7 @@ export class EmptyStateComponent implements OnInit {
|
||||
@Input() showButton = true;
|
||||
@Input() buttonIcon = 'iqser:plus';
|
||||
@Input() buttonLabel?: string;
|
||||
@Input() buttonId = `${randomString()}-icon-button`;
|
||||
@Input() horizontalPadding = 100;
|
||||
@Input() verticalPadding = 120;
|
||||
@Input() helpModeKey?: string;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
export interface DetailsRadioOption<I> {
|
||||
id?: string;
|
||||
label: string;
|
||||
description: string;
|
||||
value: I;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<div class="iqser-input-group" [class.row]="displayInRow">
|
||||
<div
|
||||
[id]="groupId(option)"
|
||||
(click)="toggleOption(option)"
|
||||
*ngFor="let option of options"
|
||||
[class.active]="option.value === value?.value"
|
||||
|
||||
@ -30,4 +30,8 @@ export class DetailsRadioComponent<I> extends FormFieldComponent<DetailsRadioOpt
|
||||
this._value = currentlyChecked ? undefined : option;
|
||||
this.onChange(this._value);
|
||||
}
|
||||
|
||||
groupId(option: DetailsRadioOption<I>) {
|
||||
return (option.id ?? option.label.replace('.', '-')) + '-checkbox-details-input';
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,5 +12,13 @@
|
||||
<mat-icon (click)="removeFile()" *ngIf="!readonly" svgIcon="iqser:trash"></mat-icon>
|
||||
</div>
|
||||
|
||||
<input #attachFileInput (change)="attachFile($event)" [accept]="accept" [hidden]="true" class="file-upload-input" type="file" />
|
||||
<input
|
||||
#attachFileInput
|
||||
id="file-upload-input"
|
||||
(change)="attachFile($event)"
|
||||
[accept]="accept"
|
||||
[hidden]="true"
|
||||
class="file-upload-input"
|
||||
type="file"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user