Merge remote-tracking branch 'origin/master' into RED-6037
This commit is contained in:
commit
36e5f65beb
@ -1,4 +1,4 @@
|
||||
<button [class.overlay]="showDot" [class.primary]="primary" [disabled]="disabled" mat-button>
|
||||
<button [class.overlay]="showDot" [class.primary]="primary" [disabled]="disabled" [id]="buttonId" mat-button>
|
||||
<span>{{ label }}</span>
|
||||
<mat-icon class="chevron-icon" svgIcon="iqser:arrow-down"></mat-icon>
|
||||
</button>
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { randomString } from '../../utils';
|
||||
|
||||
@Component({
|
||||
selector: 'iqser-chevron-button [label]',
|
||||
templateUrl: './chevron-button.component.html',
|
||||
styleUrls: ['./chevron-button.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ChevronButtonComponent {
|
||||
@Input() label!: string;
|
||||
@Input() showDot = false;
|
||||
@Input() primary = false;
|
||||
@Input() disabled = false;
|
||||
@Input() buttonId = `${randomString()}-chevron-button`;
|
||||
}
|
||||
|
||||
@ -13,11 +13,12 @@
|
||||
[class.primary]="type === circleButtonTypes.primary"
|
||||
[class.warn]="type === circleButtonTypes.warn"
|
||||
[disabled]="disabled"
|
||||
[id]="id ? id : buttonId"
|
||||
[id]="buttonId"
|
||||
[type]="isSubmit ? 'submit' : 'button'"
|
||||
mat-icon-button
|
||||
>
|
||||
<mat-icon [svgIcon]="icon"></mat-icon>
|
||||
</button>
|
||||
|
||||
<div *ngIf="showDot" class="dot"></div>
|
||||
</div>
|
||||
|
||||
@ -1,18 +1,17 @@
|
||||
import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { MatLegacyTooltip as MatTooltip } from '@angular/material/legacy-tooltip';
|
||||
import { CircleButtonType, CircleButtonTypes } from '../types/circle-button.type';
|
||||
import { IqserTooltipPosition, IqserTooltipPositions } from '../../utils';
|
||||
import { IqserTooltipPosition, IqserTooltipPositions, randomString } from '../../utils';
|
||||
|
||||
@Component({
|
||||
selector: 'iqser-circle-button [icon]',
|
||||
templateUrl: './circle-button.component.html',
|
||||
styleUrls: ['./circle-button.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class CircleButtonComponent implements OnInit {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
|
||||
@Input() id!: string;
|
||||
@Input() buttonId = `${randomString()}-circle-button`;
|
||||
@Input() icon!: string;
|
||||
@Input() tooltip?: string;
|
||||
@Input() tooltipClass?: string;
|
||||
@ -32,10 +31,6 @@ export class CircleButtonComponent implements OnInit {
|
||||
|
||||
constructor(private readonly _elementRef: ElementRef) {}
|
||||
|
||||
get buttonId(): string {
|
||||
return `${Math.random().toString(36).substring(2, 9)}-button`;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
(this._elementRef.nativeElement as HTMLElement).style.setProperty('--size', `${this.size}px`);
|
||||
(this._elementRef.nativeElement as HTMLElement).style.setProperty('--iconSize', `${this.iconSize}px`);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<button
|
||||
(click)="!disabled && action.emit($event)"
|
||||
[disabled]="disabled"
|
||||
[id]="id ? id : buttonId"
|
||||
[id]="buttonId"
|
||||
[ngClass]="classes"
|
||||
[type]="submit ? 'submit' : 'button'"
|
||||
mat-button
|
||||
|
||||
@ -1,18 +1,16 @@
|
||||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { IconButtonType, IconButtonTypes } from '../types/icon-button.type';
|
||||
import { randomString } from '../../utils';
|
||||
|
||||
@Component({
|
||||
selector: 'iqser-icon-button [label]',
|
||||
templateUrl: './icon-button.component.html',
|
||||
styleUrls: ['./icon-button.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class IconButtonComponent {
|
||||
readonly iconButtonTypes = IconButtonTypes;
|
||||
readonly buttonId: string;
|
||||
|
||||
@Input() label!: string;
|
||||
@Input() id?: string;
|
||||
@Input() buttonId = `${randomString()}-icon-button`;
|
||||
@Input() icon?: string;
|
||||
@Input() showDot = false;
|
||||
@Input() disabled = false;
|
||||
@ -20,10 +18,6 @@ export class IconButtonComponent {
|
||||
@Input() type: IconButtonType = IconButtonTypes.default;
|
||||
@Output() readonly action = new EventEmitter<MouseEvent>();
|
||||
|
||||
constructor() {
|
||||
this.buttonId = `${Math.random().toString(36).substring(2, 9)}-button`;
|
||||
}
|
||||
|
||||
get classes(): Record<string, boolean> {
|
||||
return {
|
||||
overlay: this.showDot,
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
[disabled]="(config.requireInput && confirmationDoesNotMatch()) || config.disableConfirm"
|
||||
[label]="config.confirmationText"
|
||||
[type]="iconButtonTypes.primary"
|
||||
id="confirm"
|
||||
buttonId="confirm"
|
||||
>
|
||||
</iqser-icon-button>
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
[label]="primaryGroup.label?.capitalize() || ('filter-menu.label' | translate)"
|
||||
[matMenuTriggerFor]="filterMenu"
|
||||
[showDot]="hasActiveFilters$ | async"
|
||||
id="{{ primaryGroup.slug }}"
|
||||
buttonId="{{ primaryGroup.slug }}"
|
||||
></iqser-icon-button>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { DetailsRadioOption } from './details-radio-option';
|
||||
import { NG_VALIDATORS, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||
import { FormFieldComponent } from '../form-field/form-field-component.directive';
|
||||
@ -7,7 +7,6 @@ import { FormFieldComponent } from '../form-field/form-field-component.directive
|
||||
selector: 'iqser-details-radio [options]',
|
||||
templateUrl: './details-radio.component.html',
|
||||
styleUrls: ['./details-radio.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
providers: [
|
||||
{
|
||||
provide: NG_VALUE_ACCESSOR,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<form (submit)="executeAction(null)" [style.max-width]="computedWidth" [style.width]="computedWidth" class="iqser-input-group">
|
||||
<input
|
||||
[id]="inputId"
|
||||
(ngModelChange)="valueChange.emit($event)"
|
||||
[(ngModel)]="value"
|
||||
[autocomplete]="autocomplete"
|
||||
@ -13,9 +14,16 @@
|
||||
|
||||
<mat-icon *ngIf="isSearch && !hasContent" class="icon-right" svgIcon="iqser:search"></mat-icon>
|
||||
|
||||
<iqser-circle-button (action)="reset()" *ngIf="isSearch && hasContent" [size]="25" icon="iqser:close"></iqser-circle-button>
|
||||
<iqser-circle-button
|
||||
[buttonId]="inputId + '-clear'"
|
||||
(action)="reset()"
|
||||
*ngIf="isSearch && hasContent"
|
||||
[size]="25"
|
||||
icon="iqser:close"
|
||||
></iqser-circle-button>
|
||||
|
||||
<iqser-circle-button
|
||||
[buttonId]="actionButtonId"
|
||||
(action)="executeAction($event)"
|
||||
*ngIf="!isSearch"
|
||||
[disabled]="!hasContent"
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { randomString } from '../../utils';
|
||||
|
||||
@Component({
|
||||
selector: 'iqser-input-with-action',
|
||||
@ -7,6 +8,8 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, In
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class InputWithActionComponent {
|
||||
@Input() inputId = `${randomString() + '-search-input'}`;
|
||||
@Input() actionButtonId = `${randomString() + '-action-input'}`;
|
||||
@Input() placeholder = '';
|
||||
@Input() hint?: string;
|
||||
@Input() width: number | 'full' = 250;
|
||||
|
||||
@ -44,11 +44,11 @@
|
||||
<iqser-icon-button
|
||||
(action)="config.action($event)"
|
||||
*ngIf="!config.hide"
|
||||
[buttonId]="config.label.replace('.', '-')"
|
||||
[icon]="config.icon"
|
||||
[id]="config.label.replace('.', '-')"
|
||||
[iqserHelpMode]="config.helpModeKey"
|
||||
[overlappingElements]="config.overlappingElements"
|
||||
[label]="config.label | translate"
|
||||
[overlappingElements]="config.overlappingElements"
|
||||
[type]="config.type"
|
||||
></iqser-icon-button>
|
||||
</ng-container>
|
||||
@ -58,9 +58,9 @@
|
||||
<iqser-circle-button
|
||||
(action)="config.action($event)"
|
||||
*ngIf="!config.hide"
|
||||
[buttonId]="config.id"
|
||||
[disabled]="config.disabled$ && (config.disabled$ | async)"
|
||||
[icon]="config.icon"
|
||||
[id]="config.id"
|
||||
[iqserHelpMode]="config.helpModeKey"
|
||||
[overlappingElements]="config.overlappingElements"
|
||||
[tooltipPosition]="'below'"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div (click)="toggleEntitySelected($event, entity)" *ngIf="selectionEnabled" class="selection-column">
|
||||
<div [id]="'select-' + entity.id" (click)="toggleEntitySelected($event, entity)" *ngIf="selectionEnabled" class="selection-column">
|
||||
<iqser-round-checkbox [active]="isSelected$ | async"></iqser-round-checkbox>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
||||
import { Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'iqser-upload-file',
|
||||
templateUrl: './upload-file.component.html',
|
||||
styleUrls: ['./upload-file.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class UploadFileComponent {
|
||||
@ViewChild('attachFileInput', { static: true }) attachFileInput!: ElementRef;
|
||||
|
||||
@ -73,6 +73,14 @@ export function toNumber(str: string): number {
|
||||
}
|
||||
}
|
||||
|
||||
export function randomString() {
|
||||
return Math.random().toString(36).substring(2, 9);
|
||||
}
|
||||
|
||||
export function isJustOne<T>(list: T[]): list is [T] {
|
||||
return list.length === 1;
|
||||
}
|
||||
|
||||
export function trackByFactory<T extends ITrackable<PrimaryKey>, PrimaryKey extends Id = T['id']>() {
|
||||
return (_index: number, item: T): Id => item.id;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user