Compare commits
10 Commits
master
...
release-4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76c2562d7f | ||
|
|
0e7d234c70 | ||
|
|
962458fbf9 | ||
|
|
54312abb6c | ||
|
|
ecf20fbf1b | ||
|
|
022a7985d4 | ||
|
|
3b6406517a | ||
|
|
fa80d067bd | ||
|
|
aea61cbcf6 | ||
|
|
4b8fa5f533 |
@ -231,7 +231,7 @@ iqser-dynamic-input {
|
|||||||
|
|
||||||
&.required label:after {
|
&.required label:after {
|
||||||
content: ' *';
|
content: ' *';
|
||||||
color: var(--iqser-primary);
|
color: var(--iqser-red-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.datepicker-wrapper {
|
&.datepicker-wrapper {
|
||||||
|
|||||||
@ -3,6 +3,7 @@ interface ExtraOption {
|
|||||||
checked: boolean;
|
checked: boolean;
|
||||||
hidden?: boolean;
|
hidden?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
description?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DetailsRadioOption<I> {
|
export interface DetailsRadioOption<I> {
|
||||||
|
|||||||
@ -27,6 +27,11 @@
|
|||||||
>
|
>
|
||||||
{{ option.extraOption.label | translate }}
|
{{ option.extraOption.label | translate }}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
|
<span
|
||||||
|
*ngIf="option.extraOption.description"
|
||||||
|
[innerHTML]="option.extraOption.description | translate"
|
||||||
|
class="hint extra-option-description"
|
||||||
|
></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,11 @@ label {
|
|||||||
color: var(--iqser-primary);
|
color: var(--iqser-primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.extra-option-description {
|
||||||
|
margin-left: 23px;
|
||||||
|
opacity: 0.49;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<ng-container *ngIf="!editing">
|
<ng-container *ngIf="!editing">
|
||||||
<div *ngIf="showPreview">
|
<div *ngIf="showPreview">
|
||||||
{{ value }}
|
<li *ngIf="listValue; else simpleValue">{{ value }}</li>
|
||||||
|
<ng-template #simpleValue> {{ value }} </ng-template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
@ -35,8 +36,8 @@
|
|||||||
[placeholder]="placeholder"
|
[placeholder]="placeholder"
|
||||||
[id]="id"
|
[id]="id"
|
||||||
name="name"
|
name="name"
|
||||||
[style.width]="this.textArea.width + 'px'"
|
[style.width]="this.parentDimensions?.width + 'px'"
|
||||||
[style.height]="this.textArea.height + 'px'"
|
[style.height]="this.parentDimensions?.height + 'px'"
|
||||||
></textarea>
|
></textarea>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -25,8 +25,9 @@ export class EditableInputComponent implements OnChanges {
|
|||||||
@Input() buttonsType: CircleButtonType = CircleButtonTypes.default;
|
@Input() buttonsType: CircleButtonType = CircleButtonTypes.default;
|
||||||
@Input() helpModeKey: string = '';
|
@Input() helpModeKey: string = '';
|
||||||
@Input() lastChild = false;
|
@Input() lastChild = false;
|
||||||
|
@Input() listValue = false;
|
||||||
@Output() readonly save = new EventEmitter<string>();
|
@Output() readonly save = new EventEmitter<string>();
|
||||||
textArea?: { width: number; height: number };
|
parentDimensions?: { width: number; height: number };
|
||||||
newValue = '';
|
newValue = '';
|
||||||
|
|
||||||
private _editing = false;
|
private _editing = false;
|
||||||
@ -45,23 +46,10 @@ export class EditableInputComponent implements OnChanges {
|
|||||||
if (changes['value']) {
|
if (changes['value']) {
|
||||||
this.editing = false;
|
this.editing = false;
|
||||||
}
|
}
|
||||||
if (changes['parentId']?.currentValue) {
|
|
||||||
this.setTextAreaSize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setTextAreaSize() {
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const element = document.getElementById(this.id as string) as HTMLElement;
|
const parent = document.getElementById(this.parentId as string) as HTMLElement;
|
||||||
const parentElement = document.getElementById(this.parentId as string) as HTMLElement;
|
this.parentDimensions = { width: parent.offsetWidth - 98, height: parent.offsetHeight - 16 };
|
||||||
const width = parentElement.offsetWidth - 98;
|
}, 20);
|
||||||
let height = (this.lastChild ? parentElement.offsetHeight : element.offsetHeight) - 16;
|
|
||||||
if (this.lastChild) {
|
|
||||||
const lastChildIndex = Number(this.id?.split('-')[2]);
|
|
||||||
height = height - lastChildIndex * element.offsetHeight;
|
|
||||||
}
|
|
||||||
this.textArea = { width, height };
|
|
||||||
}, 50);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
saveValue(): void {
|
saveValue(): void {
|
||||||
|
|||||||
@ -236,7 +236,11 @@ export class WorkflowComponent<T extends IListable, K extends string> extends Co
|
|||||||
|
|
||||||
private _shouldUpdate(entity: T): boolean {
|
private _shouldUpdate(entity: T): boolean {
|
||||||
const existingEntity = this.all[entity.id]?.entity;
|
const existingEntity = this.all[entity.id]?.entity;
|
||||||
return existingEntity && this.config.itemVersionFn(entity) !== this.config.itemVersionFn(existingEntity);
|
return (
|
||||||
|
existingEntity &&
|
||||||
|
(this.config.itemVersionFn(entity) !== this.config.itemVersionFn(existingEntity) ||
|
||||||
|
JSON.stringify(entity) !== JSON.stringify(existingEntity))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _shouldAdd(entity: T): boolean {
|
private _shouldAdd(entity: T): boolean {
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import { ActiveToast, ToastrService } from 'ngx-toastr';
|
|||||||
import { IndividualConfig } from 'ngx-toastr/toastr/toastr-config';
|
import { IndividualConfig } from 'ngx-toastr/toastr/toastr-config';
|
||||||
import { filter, tap } from 'rxjs/operators';
|
import { filter, tap } from 'rxjs/operators';
|
||||||
import { ErrorMessageService } from './error-message.service';
|
import { ErrorMessageService } from './error-message.service';
|
||||||
|
import { isIqserDevMode } from './iqser-user-preference.service';
|
||||||
|
|
||||||
const enum NotificationType {
|
const enum NotificationType {
|
||||||
SUCCESS = 'SUCCESS',
|
SUCCESS = 'SUCCESS',
|
||||||
@ -26,6 +27,7 @@ export interface ToasterOptions extends IndividualConfig {
|
|||||||
*/
|
*/
|
||||||
readonly params?: Record<string, string | number>;
|
readonly params?: Record<string, string | number>;
|
||||||
readonly actions?: ToasterActions[];
|
readonly actions?: ToasterActions[];
|
||||||
|
readonly useRaw?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ErrorToasterOptions extends ToasterOptions {
|
export interface ErrorToasterOptions extends ToasterOptions {
|
||||||
@ -35,10 +37,19 @@ export interface ErrorToasterOptions extends ToasterOptions {
|
|||||||
readonly error?: HttpErrorResponse;
|
readonly error?: HttpErrorResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const defaultDevToastOptions: Partial<ToasterOptions> = {
|
||||||
|
timeOut: 10000,
|
||||||
|
easing: 'ease-in-out',
|
||||||
|
easeTime: 500,
|
||||||
|
useRaw: true,
|
||||||
|
};
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class Toaster {
|
export class Toaster {
|
||||||
|
readonly #isIqserDevMode = isIqserDevMode();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
router: Router,
|
router: Router,
|
||||||
private readonly _toastr: ToastrService,
|
private readonly _toastr: ToastrService,
|
||||||
@ -69,6 +80,14 @@ export class Toaster {
|
|||||||
return this._toastr.error(message, undefined, config);
|
return this._toastr.error(message, undefined, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
devInfo(message: string): ActiveToast<unknown> | undefined {
|
||||||
|
if (!this.#isIqserDevMode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.info(message, defaultDevToastOptions);
|
||||||
|
}
|
||||||
|
|
||||||
info(message: string, options?: Partial<ToasterOptions>): ActiveToast<unknown> {
|
info(message: string, options?: Partial<ToasterOptions>): ActiveToast<unknown> {
|
||||||
return this.#showToastNotification(message, NotificationType.INFO, options);
|
return this.#showToastNotification(message, NotificationType.INFO, options);
|
||||||
}
|
}
|
||||||
@ -86,7 +105,7 @@ export class Toaster {
|
|||||||
notificationType = NotificationType.INFO,
|
notificationType = NotificationType.INFO,
|
||||||
options?: Partial<ToasterOptions>,
|
options?: Partial<ToasterOptions>,
|
||||||
): ActiveToast<unknown> {
|
): ActiveToast<unknown> {
|
||||||
const translatedMsg = this._translateService.instant(message, options?.params) as string;
|
const translatedMsg = options?.useRaw ? message : (this._translateService.instant(message, options?.params) as string);
|
||||||
|
|
||||||
switch (notificationType) {
|
switch (notificationType) {
|
||||||
case NotificationType.SUCCESS:
|
case NotificationType.SUCCESS:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user