@tetacom/ng-components 1.5.6 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/component/modal/dialog/dialog.component.d.ts +14 -12
- package/component/modal/dialog.service.d.ts +3 -2
- package/component/modal/model/dialog-data.d.ts +11 -0
- package/fesm2022/tetacom-ng-components.mjs +40 -25
- package/fesm2022/tetacom-ng-components.mjs.map +1 -1
- package/package.json +1 -1
- package/style/table.scss +1 -0
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
1
|
import { CurrentModal } from '../model/current-modal';
|
|
3
|
-
import {
|
|
2
|
+
import { DialogButtonType } from '../model/dialog-data';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class DialogComponent
|
|
4
|
+
export declare class DialogComponent {
|
|
6
5
|
modal: CurrentModal;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
title: string;
|
|
7
|
+
private _text;
|
|
8
|
+
get text(): string;
|
|
9
|
+
set text(value: string);
|
|
10
|
+
private _confirm;
|
|
11
|
+
get confirm(): DialogButtonType;
|
|
12
|
+
set confirm(value: DialogButtonType);
|
|
13
|
+
private _decline;
|
|
14
|
+
get decline(): null | DialogButtonType;
|
|
15
|
+
set decline(value: null | DialogButtonType);
|
|
16
|
+
constructor(modal: CurrentModal);
|
|
14
17
|
cancel(): void;
|
|
15
18
|
ok(): void;
|
|
16
|
-
ngOnInit(): void;
|
|
17
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<DialogComponent, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DialogComponent, "teta-dialog", never, { "
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DialogComponent, "teta-dialog", never, { "title": { "alias": "title"; "required": true; }; "text": { "alias": "text"; "required": false; }; "confirm": { "alias": "confirm"; "required": false; }; "decline": { "alias": "decline"; "required": false; }; }, {}, never, never, true, never>;
|
|
19
21
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ModalService } from './modal.service';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
+
import { DialogDataType } from './model/dialog-data';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class DialogService {
|
|
5
6
|
private _modal;
|
|
6
7
|
constructor(_modal: ModalService);
|
|
7
|
-
alert(
|
|
8
|
-
confirm(
|
|
8
|
+
alert(title: string): void;
|
|
9
|
+
confirm(confirmDialogData: DialogDataType): Observable<boolean>;
|
|
9
10
|
private createDialog;
|
|
10
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
|
|
11
12
|
static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
|
|
@@ -5094,9 +5094,26 @@ class CurrentModal {
|
|
|
5094
5094
|
}
|
|
5095
5095
|
|
|
5096
5096
|
class DialogComponent {
|
|
5097
|
-
|
|
5097
|
+
get text() {
|
|
5098
|
+
return this._text;
|
|
5099
|
+
}
|
|
5100
|
+
set text(value) {
|
|
5101
|
+
this._text = value || '';
|
|
5102
|
+
}
|
|
5103
|
+
get confirm() {
|
|
5104
|
+
return this._confirm;
|
|
5105
|
+
}
|
|
5106
|
+
set confirm(value) {
|
|
5107
|
+
this._confirm = value || { text: 'common.ok', palette: 'primary' };
|
|
5108
|
+
}
|
|
5109
|
+
get decline() {
|
|
5110
|
+
return this._decline;
|
|
5111
|
+
}
|
|
5112
|
+
set decline(value) {
|
|
5113
|
+
this._decline = value !== undefined ? value : { text: 'common.cancel', palette: 'text' };
|
|
5114
|
+
}
|
|
5115
|
+
constructor(modal) {
|
|
5098
5116
|
this.modal = modal;
|
|
5099
|
-
this.data = data;
|
|
5100
5117
|
}
|
|
5101
5118
|
cancel() {
|
|
5102
5119
|
this.modal.close({
|
|
@@ -5108,22 +5125,20 @@ class DialogComponent {
|
|
|
5108
5125
|
reason: ModalCloseReason.resolve,
|
|
5109
5126
|
});
|
|
5110
5127
|
}
|
|
5111
|
-
|
|
5112
|
-
static { this.ɵ
|
|
5113
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DialogComponent, isStandalone: true, selector: "teta-dialog", inputs: { message: "message", buttonText: "buttonText", buttonIcon: "buttonIcon", buttonPalette: "buttonPalette", showCancelButton: "showCancelButton" }, ngImport: i0, template: "<div class=\"padding-2 font-body-2\">\n {{ message | transloco }}\n</div>\n<teta-toolbar class=\"justify-content-end\">\n @if (showCancelButton) {\n <button teta-button (click)=\"cancel()\" [palette]=\"'text'\" [view]=\"'ghost'\">\n {{ 'common.cancel' | transloco }}\n </button>\n }\n\n <button teta-button (click)=\"ok()\" [square]=\"!buttonText?.length\" [palette]=\"buttonPalette\">\n @if (buttonIcon) {\n <teta-icon [name]=\"buttonIcon\"></teta-icon>\n }\n @if (buttonText?.length > 0) {\n {{ buttonText | transloco }}\n }\n </button>\n</teta-toolbar>\n", styles: [":host{display:flex;flex-direction:column;width:300px}\n"], dependencies: [{ kind: "component", type: ToolbarComponent, selector: "teta-toolbar", inputs: ["palette", "class"] }, { kind: "component", type: ButtonComponent, selector: "button[teta-button], teta-button", inputs: ["palette", "class", "view", "square", "viewType", "size"] }, { kind: "component", type: IconComponent, selector: "teta-icon", inputs: ["name", "size", "palette", "class"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i1$2.TranslocoPipe, name: "transloco" }] }); }
|
|
5128
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DialogComponent, deps: [{ token: CurrentModal }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5129
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: DialogComponent, isStandalone: true, selector: "teta-dialog", inputs: { title: "title", text: "text", confirm: "confirm", decline: "decline" }, ngImport: i0, template: "<h3 class=\"padding-2 font-title-2\">\n {{ title | transloco }}\n</h3>\n\n@if (text) {\n <p class=\"padding-2 font-body-3\">\n {{ text | transloco }}\n </p>\n}\n\n<teta-toolbar class=\"justify-content-end\">\n @if (decline) {\n <button teta-button (click)=\"cancel()\" [palette]=\"decline?.palette || 'text'\" [view]=\"'ghost'\">\n @if (decline?.icon) {\n <teta-icon [name]=\"decline.icon\"></teta-icon>\n }\n @if (decline.text) {\n {{ decline.text | transloco }}\n }\n </button>\n }\n\n <button teta-button (click)=\"ok()\" [palette]=\"confirm?.palette || 'primary'\">\n @if (confirm?.icon) {\n <teta-icon [name]=\"confirm.icon\"></teta-icon>\n }\n @if (confirm.text) {\n {{ confirm.text | transloco }}\n }\n </button>\n</teta-toolbar>\n", styles: [":host{display:flex;flex-direction:column;width:300px}\n"], dependencies: [{ kind: "component", type: ToolbarComponent, selector: "teta-toolbar", inputs: ["palette", "class"] }, { kind: "component", type: ButtonComponent, selector: "button[teta-button], teta-button", inputs: ["palette", "class", "view", "square", "viewType", "size"] }, { kind: "component", type: IconComponent, selector: "teta-icon", inputs: ["name", "size", "palette", "class"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "pipe", type: i1$2.TranslocoPipe, name: "transloco" }] }); }
|
|
5114
5130
|
}
|
|
5115
5131
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DialogComponent, decorators: [{
|
|
5116
5132
|
type: Component,
|
|
5117
|
-
args: [{ selector: 'teta-dialog', imports: [ToolbarComponent, ButtonComponent, IconComponent, TranslocoModule], template: "<
|
|
5118
|
-
}], ctorParameters: () => [{ type: CurrentModal }
|
|
5119
|
-
type: Input
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
}], buttonIcon: [{
|
|
5133
|
+
args: [{ selector: 'teta-dialog', imports: [ToolbarComponent, ButtonComponent, IconComponent, TranslocoModule], template: "<h3 class=\"padding-2 font-title-2\">\n {{ title | transloco }}\n</h3>\n\n@if (text) {\n <p class=\"padding-2 font-body-3\">\n {{ text | transloco }}\n </p>\n}\n\n<teta-toolbar class=\"justify-content-end\">\n @if (decline) {\n <button teta-button (click)=\"cancel()\" [palette]=\"decline?.palette || 'text'\" [view]=\"'ghost'\">\n @if (decline?.icon) {\n <teta-icon [name]=\"decline.icon\"></teta-icon>\n }\n @if (decline.text) {\n {{ decline.text | transloco }}\n }\n </button>\n }\n\n <button teta-button (click)=\"ok()\" [palette]=\"confirm?.palette || 'primary'\">\n @if (confirm?.icon) {\n <teta-icon [name]=\"confirm.icon\"></teta-icon>\n }\n @if (confirm.text) {\n {{ confirm.text | transloco }}\n }\n </button>\n</teta-toolbar>\n", styles: [":host{display:flex;flex-direction:column;width:300px}\n"] }]
|
|
5134
|
+
}], ctorParameters: () => [{ type: CurrentModal }], propDecorators: { title: [{
|
|
5135
|
+
type: Input,
|
|
5136
|
+
args: [{ required: true }]
|
|
5137
|
+
}], text: [{
|
|
5123
5138
|
type: Input
|
|
5124
|
-
}],
|
|
5139
|
+
}], confirm: [{
|
|
5125
5140
|
type: Input
|
|
5126
|
-
}],
|
|
5141
|
+
}], decline: [{
|
|
5127
5142
|
type: Input
|
|
5128
5143
|
}] } });
|
|
5129
5144
|
|
|
@@ -5301,19 +5316,19 @@ class DialogService {
|
|
|
5301
5316
|
constructor(_modal) {
|
|
5302
5317
|
this._modal = _modal;
|
|
5303
5318
|
}
|
|
5304
|
-
alert(
|
|
5305
|
-
this.createDialog(
|
|
5319
|
+
alert(title) {
|
|
5320
|
+
this.createDialog({ title, decline: null });
|
|
5306
5321
|
}
|
|
5307
|
-
confirm(
|
|
5308
|
-
return this.createDialog(
|
|
5322
|
+
confirm(confirmDialogData) {
|
|
5323
|
+
return this.createDialog(confirmDialogData).pipe(map((result) => result.reason === ModalCloseReason.resolve));
|
|
5309
5324
|
}
|
|
5310
|
-
createDialog(
|
|
5325
|
+
createDialog(dialogData) {
|
|
5326
|
+
const { title, text, confirm, decline } = dialogData;
|
|
5311
5327
|
const dialog = this._modal.create(DialogComponent, {
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
showCancelButton,
|
|
5328
|
+
title,
|
|
5329
|
+
text,
|
|
5330
|
+
confirm,
|
|
5331
|
+
decline,
|
|
5317
5332
|
}, {
|
|
5318
5333
|
esc: true,
|
|
5319
5334
|
backdrop: true,
|
|
@@ -7882,11 +7897,11 @@ class ListCellComponent extends CellComponentBase {
|
|
|
7882
7897
|
return item.name;
|
|
7883
7898
|
}
|
|
7884
7899
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ListCellComponent, deps: [{ token: TableService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7885
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ListCellComponent, isStandalone: true, selector: "teta-list-cell", viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<span [style.display]=\"edit ? 'none' : '
|
|
7900
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: ListCellComponent, isStandalone: true, selector: "teta-list-cell", viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<span [style.display]=\"edit ? 'none' : 'flex'\" class=\"cell-text justify-content-between\" [class.cell-text_disabled]=\"!editable\">\n <span class=\"row_auto overflow-hidden text-overflow-ellipsis\">{{ getValue(control.value) }}</span>\n <teta-icon [name]=\"'arrowDownSmall'\" [palette]=\"'text'\"></teta-icon>\n</span>\n@if (edit) {\n <teta-select\n #input\n class=\"row_auto select-table\"\n [allowNull]=\"!column.required\"\n [verticalAlign]=\"verticalAlign.auto\"\n [appendToBody]=\"true\"\n [options]=\"displayFilterOptions\"\n [valueRef]=\"'id'\"\n [textRef]=\"'name'\"\n [searchRef]=\"displayFilterOptions?.length > 20 ? 'name' : ''\"\n [formControl]=\"control\"\n >\n </teta-select>\n}\n", styles: [""], dependencies: [{ kind: "component", type: SelectComponent, selector: "teta-select", inputs: ["multiple", "options", "invalid", "align", "verticalAlign", "autoClose", "autoCloseIgnore", "disabled", "itemSize", "virtual", "icon", "placeholder", "appendToBody", "allowNull", "viewType", "notFoundText", "valueRef", "textRef", "searchRef"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: IconComponent, selector: "teta-icon", inputs: ["name", "size", "palette", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
7886
7901
|
}
|
|
7887
7902
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: ListCellComponent, decorators: [{
|
|
7888
7903
|
type: Component,
|
|
7889
|
-
args: [{ selector: 'teta-list-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SelectComponent, FormsModule, ReactiveFormsModule], template: "<span [style.display]=\"edit ? 'none' : '
|
|
7904
|
+
args: [{ selector: 'teta-list-cell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SelectComponent, FormsModule, ReactiveFormsModule, IconComponent], template: "<span [style.display]=\"edit ? 'none' : 'flex'\" class=\"cell-text justify-content-between\" [class.cell-text_disabled]=\"!editable\">\n <span class=\"row_auto overflow-hidden text-overflow-ellipsis\">{{ getValue(control.value) }}</span>\n <teta-icon [name]=\"'arrowDownSmall'\" [palette]=\"'text'\"></teta-icon>\n</span>\n@if (edit) {\n <teta-select\n #input\n class=\"row_auto select-table\"\n [allowNull]=\"!column.required\"\n [verticalAlign]=\"verticalAlign.auto\"\n [appendToBody]=\"true\"\n [options]=\"displayFilterOptions\"\n [valueRef]=\"'id'\"\n [textRef]=\"'name'\"\n [searchRef]=\"displayFilterOptions?.length > 20 ? 'name' : ''\"\n [formControl]=\"control\"\n >\n </teta-select>\n}\n" }]
|
|
7890
7905
|
}], ctorParameters: () => [{ type: TableService }, { type: i0.ChangeDetectorRef }], propDecorators: { input: [{
|
|
7891
7906
|
type: ViewChild,
|
|
7892
7907
|
args: ['input', { static: false }]
|