@jooler/inputs 0.0.53 → 0.0.54
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/esm2022/lib/choose-general-item/choose-general-item.component.mjs +222 -45
- package/esm2022/lib/choose-general-item/choose-general-item.service.mjs +24 -3
- package/esm2022/lib/choose-general-item/choose-object-basic-template-label-field.enum.mjs +7 -0
- package/esm2022/lib/choose-general-item/choose-object-basic-template.model.mjs +67 -0
- package/esm2022/lib/choose-general-item/choose-object-template-type.enum.mjs +7 -0
- package/esm2022/lib/choose-general-item-renderer/choose-general-item-renderer.component.mjs +3 -3
- package/esm2022/lib/dictionary-to-params-converter.mjs +15 -0
- package/esm2022/lib/models/choose-item-full-object-control-config.enum.mjs +6 -0
- package/fesm2022/inputs.mjs +343 -124
- package/fesm2022/inputs.mjs.map +1 -1
- package/lib/choose-general-item/choose-general-item.component.d.ts +44 -15
- package/lib/choose-general-item/choose-general-item.service.d.ts +5 -1
- package/lib/choose-general-item/choose-object-basic-template-label-field.enum.d.ts +5 -0
- package/lib/choose-general-item/choose-object-basic-template.model.d.ts +15 -0
- package/lib/choose-general-item/choose-object-template-type.enum.d.ts +5 -0
- package/lib/dictionary-to-params-converter.d.ts +4 -0
- package/lib/models/choose-item-full-object-control-config.enum.d.ts +4 -0
- package/package.json +1 -1
package/fesm2022/inputs.mjs
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, forwardRef, Component, Input, Output, Injectable, Inject, Pipe, Directive, HostListener, NgModule } from '@angular/core';
|
|
2
|
+
import { EventEmitter, forwardRef, Component, Input, Output, Injectable, Inject, ContentChild, Pipe, Directive, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2$1 from '@angular/forms';
|
|
4
|
-
import { NG_VALUE_ACCESSOR, NgModel, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgModel, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import * as i1 from '@angular/common';
|
|
6
6
|
import { CurrencyPipe, DecimalPipe, CommonModule } from '@angular/common';
|
|
7
7
|
import * as i2 from '@ng-select/ng-select';
|
|
8
8
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
9
9
|
import * as i4 from '@jooler/shared-general-components';
|
|
10
|
-
import { SharedGeneralComponentsModule } from '@jooler/shared-general-components';
|
|
10
|
+
import { ChipInputType, SharedGeneralComponentsModule } from '@jooler/shared-general-components';
|
|
11
11
|
import * as i2$2 from '@fortawesome/angular-fontawesome';
|
|
12
12
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
13
13
|
import * as i1$1 from '@angular/common/http';
|
|
14
|
-
import { HttpHeaders } from '@angular/common/http';
|
|
15
|
-
import * as
|
|
16
|
-
import
|
|
14
|
+
import { HttpParams, HttpHeaders } from '@angular/common/http';
|
|
15
|
+
import * as i2$3 from '@angular/material/dialog';
|
|
16
|
+
import * as i6 from '@angular/material/card';
|
|
17
17
|
import * as i1$2 from '@angular/router';
|
|
18
|
-
import * as i3
|
|
18
|
+
import * as i3 from '@angular/material/menu';
|
|
19
|
+
import * as i3$1 from '@angular/material/button';
|
|
20
|
+
import { AppMaterialModule } from '@jooler/app-material';
|
|
19
21
|
|
|
20
22
|
class PrimaryColors {
|
|
21
23
|
static $primaryBlueColor = '#155ED4';
|
|
@@ -847,6 +849,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
847
849
|
args: [{ selector: 'choose-enum-renderer', template: "<div class=\"all\" [ngClass]=\"{ single: !showError, double: showError }\" *ngIf=\"rowLevelFG\" [formGroup]=\"rowLevelFG\">\r\n <choose-enum [clearable]=\"clearable\" [formControlName]=\"key\" [appendTo]=\"'body'\" [label]=\"params.label\"\r\n [labelTextAlign]=\"params.labelTextAlign\" [labelTextFontWeight]=\"params.labelTextFontWeight\"\r\n [labelTextFontSize]=\"params.labelTextFontSize\" [selectedItem]=\"params.value\" [valuesToHide]=\"valuesToHide\"\r\n [valuesToDisable]=\"valuesToDisable\" [isDropdownDisabled]=\"params.isDropdownDisabled\"\r\n [enumChoices]=\"params.enumChoices\" [placeholder]=\"params.placeholder\" [width]=\"params.width\" [isChip]=\"isChip\"\r\n [paddingTop]=\"params.paddingTop\" [customColors]=\"params.customColors\" (change)=\"onEnumSelected($event)\">\r\n </choose-enum>\r\n</div>", styles: [".all{display:grid;gap:.5rem;align-items:center;margin:auto}.single{grid-template-columns:auto}.double{grid-template-columns:auto max-content}\n"] }]
|
|
848
850
|
}], ctorParameters: function () { return []; } });
|
|
849
851
|
|
|
852
|
+
var ChooseObjectTemplateType;
|
|
853
|
+
(function (ChooseObjectTemplateType) {
|
|
854
|
+
ChooseObjectTemplateType[ChooseObjectTemplateType["DEFAULT"] = 0] = "DEFAULT";
|
|
855
|
+
ChooseObjectTemplateType[ChooseObjectTemplateType["BASIC"] = 1] = "BASIC";
|
|
856
|
+
ChooseObjectTemplateType[ChooseObjectTemplateType["CONTENT_PROJECTION"] = 2] = "CONTENT_PROJECTION";
|
|
857
|
+
})(ChooseObjectTemplateType || (ChooseObjectTemplateType = {}));
|
|
858
|
+
|
|
859
|
+
var ChooseItemFullObjectControlConfig;
|
|
860
|
+
(function (ChooseItemFullObjectControlConfig) {
|
|
861
|
+
ChooseItemFullObjectControlConfig[ChooseItemFullObjectControlConfig["OBJECT"] = 1] = "OBJECT";
|
|
862
|
+
ChooseItemFullObjectControlConfig[ChooseItemFullObjectControlConfig["ID"] = 2] = "ID";
|
|
863
|
+
})(ChooseItemFullObjectControlConfig || (ChooseItemFullObjectControlConfig = {}));
|
|
864
|
+
|
|
865
|
+
class DictionaryToHttpParamsConverter {
|
|
866
|
+
static dictionaryToHttpParamsConverter(form_dictionary) {
|
|
867
|
+
let queryParams = new HttpParams();
|
|
868
|
+
for (let key in form_dictionary) {
|
|
869
|
+
if (form_dictionary[key] !== null &&
|
|
870
|
+
form_dictionary[key] !== '' &&
|
|
871
|
+
form_dictionary[key] !== undefined &&
|
|
872
|
+
form_dictionary[key]?.length !== 0)
|
|
873
|
+
queryParams = queryParams.append(key, form_dictionary[key]);
|
|
874
|
+
}
|
|
875
|
+
return queryParams;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
850
879
|
// import { environment } from '../../environments/environment';
|
|
851
880
|
class ChooseGeneralItemService {
|
|
852
881
|
http;
|
|
@@ -864,6 +893,21 @@ class ChooseGeneralItemService {
|
|
|
864
893
|
});
|
|
865
894
|
return { headers: httpHeaders };
|
|
866
895
|
}
|
|
896
|
+
getHeadersAndParams(dictionary) {
|
|
897
|
+
let httpHeaders;
|
|
898
|
+
const token = localStorage.getItem('token');
|
|
899
|
+
if (token) {
|
|
900
|
+
httpHeaders = new HttpHeaders({
|
|
901
|
+
'Content-Type': 'application/json; charset-utf-8',
|
|
902
|
+
Authorization: 'Token ' + token,
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
else {
|
|
906
|
+
httpHeaders = new HttpHeaders();
|
|
907
|
+
}
|
|
908
|
+
const params = DictionaryToHttpParamsConverter.dictionaryToHttpParamsConverter(dictionary);
|
|
909
|
+
return { headers: httpHeaders, params: params };
|
|
910
|
+
}
|
|
867
911
|
getAuthenticationHeadersWithQueryParams(params) {
|
|
868
912
|
const token = localStorage.getItem("token");
|
|
869
913
|
const httpHeaders = new HttpHeaders({
|
|
@@ -872,8 +916,13 @@ class ChooseGeneralItemService {
|
|
|
872
916
|
});
|
|
873
917
|
return { headers: httpHeaders, params: params };
|
|
874
918
|
}
|
|
875
|
-
getData(apiPath) {
|
|
876
|
-
|
|
919
|
+
getData(apiPath, filterParams) {
|
|
920
|
+
if (filterParams) {
|
|
921
|
+
return this.http.get(`${this.env.apiURL}${apiPath}`, this.getHeadersAndParams(filterParams));
|
|
922
|
+
}
|
|
923
|
+
else {
|
|
924
|
+
return this.http.get(`${this.env.apiURL}${apiPath}`, this.getHeaders());
|
|
925
|
+
}
|
|
877
926
|
}
|
|
878
927
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemService, deps: [{ token: i1$1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
879
928
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemService, providedIn: 'root' });
|
|
@@ -888,22 +937,97 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
888
937
|
args: ['env']
|
|
889
938
|
}] }]; } });
|
|
890
939
|
|
|
940
|
+
var DropdownActionType;
|
|
941
|
+
(function (DropdownActionType) {
|
|
942
|
+
DropdownActionType[DropdownActionType["ADD"] = 0] = "ADD";
|
|
943
|
+
DropdownActionType[DropdownActionType["MENU"] = 1] = "MENU";
|
|
944
|
+
})(DropdownActionType || (DropdownActionType = {}));
|
|
945
|
+
|
|
946
|
+
class DropdownActionsComponent {
|
|
947
|
+
_Router;
|
|
948
|
+
dropdownActionTypes = DropdownActionType;
|
|
949
|
+
canRoute = true;
|
|
950
|
+
disabled;
|
|
951
|
+
labelsAndRoutes = [];
|
|
952
|
+
route;
|
|
953
|
+
dropdownActionType = this.dropdownActionTypes.ADD;
|
|
954
|
+
addClicked = new EventEmitter();
|
|
955
|
+
constructor(_Router) {
|
|
956
|
+
this._Router = _Router;
|
|
957
|
+
}
|
|
958
|
+
ngOnInit() {
|
|
959
|
+
this.validateActions();
|
|
960
|
+
}
|
|
961
|
+
validateActions() {
|
|
962
|
+
if (this.dropdownActionType == this.dropdownActionTypes.ADD) {
|
|
963
|
+
if (this.canRoute) {
|
|
964
|
+
if (this.route == "" || this.route == undefined || this.route == null) {
|
|
965
|
+
throw Error("Route needs to be provided.");
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
else {
|
|
969
|
+
if (this.route) {
|
|
970
|
+
throw Error("Route shouldn't be provided since canRoute is false");
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
else if (this.dropdownActionType == this.dropdownActionTypes.MENU) {
|
|
975
|
+
if (!this.labelsAndRoutes.length) {
|
|
976
|
+
throw Error("A list of labels & Routes need to be provided for the actions menu.");
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
else {
|
|
980
|
+
throw Error("Dropdown Action Type is not recognized.");
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
onClickAdd($event) {
|
|
984
|
+
$event.preventDefault();
|
|
985
|
+
if (this.canRoute && this.route) {
|
|
986
|
+
this._Router.navigate([this.route]);
|
|
987
|
+
}
|
|
988
|
+
this.addClicked.emit();
|
|
989
|
+
}
|
|
990
|
+
onClickLabel(route, $event) {
|
|
991
|
+
$event.preventDefault();
|
|
992
|
+
this._Router.navigate([route]);
|
|
993
|
+
}
|
|
994
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownActionsComponent, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
995
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DropdownActionsComponent, selector: "dropdown-actions", inputs: { canRoute: "canRoute", disabled: "disabled", labelsAndRoutes: "labelsAndRoutes", route: "route", dropdownActionType: "dropdownActionType" }, outputs: { addClicked: "addClicked" }, ngImport: i0, template: "<div [ngSwitch]=\"dropdownActionType\">\r\n <a *ngSwitchCase=\"dropdownActionTypes.ADD\" [href]=\"route\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n (click)=\"onClickAdd($event)\">\r\n <fa-icon icon=\"plus\"></fa-icon>\r\n </a>\r\n <fa-icon *ngSwitchCase=\"dropdownActionTypes.MENU\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n class=\"menu\" [matMenuTriggerFor]=\"menu\"\r\n icon=\"ellipsis-vertical\"></fa-icon>\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let labelAndRoute of labelsAndRoutes\" mat-menu-item>\r\n <a [href]=\"labelAndRoute.route\"\r\n (click)=\"onClickLabel(labelAndRoute.route, $event)\">{{labelAndRoute.label}}</a>\r\n </button>\r\n </mat-menu>\r\n</div>", styles: [".action-enabled{cursor:pointer;color:#155ed4}.action-enabled:hover{color:#3178eb}.disabled{color:#676767;cursor:initial;pointer-events:none}.menu{font-size:1.8rem;display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i3.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i3.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i2$2.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }] });
|
|
996
|
+
}
|
|
997
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownActionsComponent, decorators: [{
|
|
998
|
+
type: Component,
|
|
999
|
+
args: [{ selector: 'dropdown-actions', template: "<div [ngSwitch]=\"dropdownActionType\">\r\n <a *ngSwitchCase=\"dropdownActionTypes.ADD\" [href]=\"route\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n (click)=\"onClickAdd($event)\">\r\n <fa-icon icon=\"plus\"></fa-icon>\r\n </a>\r\n <fa-icon *ngSwitchCase=\"dropdownActionTypes.MENU\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n class=\"menu\" [matMenuTriggerFor]=\"menu\"\r\n icon=\"ellipsis-vertical\"></fa-icon>\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let labelAndRoute of labelsAndRoutes\" mat-menu-item>\r\n <a [href]=\"labelAndRoute.route\"\r\n (click)=\"onClickLabel(labelAndRoute.route, $event)\">{{labelAndRoute.label}}</a>\r\n </button>\r\n </mat-menu>\r\n</div>", styles: [".action-enabled{cursor:pointer;color:#155ed4}.action-enabled:hover{color:#3178eb}.disabled{color:#676767;cursor:initial;pointer-events:none}.menu{font-size:1.8rem;display:flex;align-items:center}\n"] }]
|
|
1000
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }]; }, propDecorators: { canRoute: [{
|
|
1001
|
+
type: Input
|
|
1002
|
+
}], disabled: [{
|
|
1003
|
+
type: Input
|
|
1004
|
+
}], labelsAndRoutes: [{
|
|
1005
|
+
type: Input
|
|
1006
|
+
}], route: [{
|
|
1007
|
+
type: Input
|
|
1008
|
+
}], dropdownActionType: [{
|
|
1009
|
+
type: Input
|
|
1010
|
+
}], addClicked: [{
|
|
1011
|
+
type: Output
|
|
1012
|
+
}] } });
|
|
1013
|
+
|
|
891
1014
|
class ChooseGeneralItemComponent {
|
|
892
1015
|
_ChooseGeneralItemService;
|
|
893
|
-
|
|
1016
|
+
dialog;
|
|
1017
|
+
_cdr;
|
|
1018
|
+
primaryRed = PrimaryColors.$primaryRedColor;
|
|
1019
|
+
isLoading = false;
|
|
894
1020
|
items;
|
|
895
|
-
label;
|
|
896
|
-
appendTo;
|
|
1021
|
+
label = 'label';
|
|
1022
|
+
appendTo = 'body';
|
|
897
1023
|
placeholder;
|
|
898
1024
|
apiPath;
|
|
899
|
-
isMultiple;
|
|
1025
|
+
isMultiple = false;
|
|
900
1026
|
hideSelectedItem;
|
|
901
1027
|
objects;
|
|
902
|
-
showLabel;
|
|
1028
|
+
showLabel = false;
|
|
903
1029
|
separator;
|
|
904
|
-
width
|
|
905
|
-
fontWeight;
|
|
906
|
-
fontSize;
|
|
1030
|
+
width;
|
|
907
1031
|
isChip = false;
|
|
908
1032
|
isTypeDate;
|
|
909
1033
|
chipColor = 'black';
|
|
@@ -911,20 +1035,81 @@ class ChooseGeneralItemComponent {
|
|
|
911
1035
|
chipWidth = 11;
|
|
912
1036
|
selectedItemId;
|
|
913
1037
|
disabled;
|
|
1038
|
+
readOnly;
|
|
914
1039
|
useFullObject = false;
|
|
915
|
-
|
|
1040
|
+
showAdd = false;
|
|
1041
|
+
dialogComponentClass;
|
|
1042
|
+
showDialogDefaultButtons = false;
|
|
1043
|
+
dialogComponentInputs = {
|
|
1044
|
+
isDialog: true,
|
|
1045
|
+
};
|
|
1046
|
+
bindValueKey = 'id'; // or null for full object
|
|
1047
|
+
addRoute;
|
|
1048
|
+
canActionsRoute;
|
|
1049
|
+
dialogTitle;
|
|
1050
|
+
clearable = true;
|
|
1051
|
+
filterParams;
|
|
1052
|
+
templateType = ChooseObjectTemplateType.DEFAULT;
|
|
1053
|
+
basicTemplateData;
|
|
1054
|
+
contentProjectionLabelKey;
|
|
1055
|
+
fullObjectControlConfig = ChooseItemFullObjectControlConfig.ID;
|
|
1056
|
+
change = new EventEmitter();
|
|
1057
|
+
blur = new EventEmitter();
|
|
1058
|
+
customOptionTemplate;
|
|
1059
|
+
ChooseObjectTemplateType = ChooseObjectTemplateType;
|
|
1060
|
+
chipInputTypes = ChipInputType;
|
|
1061
|
+
constructor(_ChooseGeneralItemService, dialog, _cdr) {
|
|
916
1062
|
this._ChooseGeneralItemService = _ChooseGeneralItemService;
|
|
1063
|
+
this.dialog = dialog;
|
|
1064
|
+
this._cdr = _cdr;
|
|
917
1065
|
}
|
|
918
1066
|
ngOnInit() {
|
|
919
|
-
if (
|
|
1067
|
+
if (this.templateType == ChooseObjectTemplateType.BASIC) {
|
|
1068
|
+
this.setupBasicTemplate();
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
setupBasicTemplate() { }
|
|
1072
|
+
ngOnChanges(changes) {
|
|
1073
|
+
if (changes['items'] && !changes.items) {
|
|
1074
|
+
this.items = undefined;
|
|
1075
|
+
}
|
|
1076
|
+
if (changes['apiPath'] && !changes.apiPath) {
|
|
1077
|
+
this.apiPath = undefined;
|
|
1078
|
+
}
|
|
1079
|
+
this.validateInputs(changes);
|
|
1080
|
+
if (this.showAdd) {
|
|
1081
|
+
this.validateAddConfiguration();
|
|
1082
|
+
}
|
|
1083
|
+
if (!changes['items'] || !changes['items'].currentValue) {
|
|
1084
|
+
this.isLoading = true;
|
|
920
1085
|
this.getData();
|
|
1086
|
+
}
|
|
1087
|
+
else {
|
|
1088
|
+
this.isLoading = false;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
validateAddConfiguration() {
|
|
1092
|
+
if ((this.addRoute == '' || this.addRoute == null || this.addRoute == undefined) &&
|
|
1093
|
+
(this.dialogComponentClass == null || this.dialogComponentClass == undefined)) {
|
|
1094
|
+
throw Error('Showing the add button requires either a route for the add button to route to, or a component class for a dialog to open up with that component.');
|
|
1095
|
+
}
|
|
921
1096
|
}
|
|
922
1097
|
writeValue(item) {
|
|
923
|
-
if (item != undefined) {
|
|
924
|
-
this.
|
|
1098
|
+
if (item != undefined || item != null) {
|
|
1099
|
+
if (!this.useFullObject) {
|
|
1100
|
+
this.selectedItemId = item;
|
|
1101
|
+
}
|
|
1102
|
+
else {
|
|
1103
|
+
if (Array.isArray(item)) {
|
|
1104
|
+
this.selectedItemId = item.map(item => item.id);
|
|
1105
|
+
}
|
|
1106
|
+
else {
|
|
1107
|
+
this.selectedItemId = item.id;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
925
1110
|
}
|
|
926
|
-
else
|
|
927
|
-
this.selectedItemId =
|
|
1111
|
+
else {
|
|
1112
|
+
this.selectedItemId = null;
|
|
928
1113
|
}
|
|
929
1114
|
}
|
|
930
1115
|
registerOnChange(fn) {
|
|
@@ -935,44 +1120,116 @@ class ChooseGeneralItemComponent {
|
|
|
935
1120
|
}
|
|
936
1121
|
propagateChange = (_) => { };
|
|
937
1122
|
propogateTouch = () => { };
|
|
1123
|
+
onValidationChange = () => { };
|
|
938
1124
|
updateBlur() {
|
|
939
1125
|
this.propogateTouch();
|
|
1126
|
+
this.blur.emit();
|
|
940
1127
|
}
|
|
941
1128
|
onSelectedItemChanged($event) {
|
|
942
|
-
|
|
943
|
-
|
|
1129
|
+
let valueToPropagate;
|
|
1130
|
+
if (this.fullObjectControlConfig == ChooseItemFullObjectControlConfig.ID) {
|
|
1131
|
+
valueToPropagate = this.selectedItemId;
|
|
1132
|
+
}
|
|
1133
|
+
else if (this.fullObjectControlConfig == ChooseItemFullObjectControlConfig.OBJECT) {
|
|
1134
|
+
valueToPropagate = $event;
|
|
1135
|
+
}
|
|
1136
|
+
else {
|
|
1137
|
+
throw Error('ChooseItemFullObjectControlConfig is not recognized.');
|
|
1138
|
+
}
|
|
1139
|
+
this.propagateChange(valueToPropagate);
|
|
1140
|
+
this.change.emit($event);
|
|
1141
|
+
this.onValidationChange();
|
|
1142
|
+
}
|
|
1143
|
+
validateInputs(changes) {
|
|
1144
|
+
if (changes.apiPath &&
|
|
1145
|
+
changes.apiPath.currentValue &&
|
|
1146
|
+
changes.items &&
|
|
1147
|
+
changes.items.currentValue) {
|
|
1148
|
+
throw Error('Both an API path and an items list was provided.');
|
|
1149
|
+
}
|
|
944
1150
|
}
|
|
945
1151
|
getData() {
|
|
946
1152
|
if (this.apiPath) {
|
|
947
|
-
this._ChooseGeneralItemService.getData(this.apiPath).subscribe({
|
|
1153
|
+
this._ChooseGeneralItemService.getData(this.apiPath, this.filterParams).subscribe({
|
|
948
1154
|
next: (response) => {
|
|
949
1155
|
this.items = response;
|
|
1156
|
+
this.isLoading = false;
|
|
1157
|
+
this._cdr.markForCheck();
|
|
1158
|
+
console.log("response: items from '", this.apiPath, "' found: ", this.items);
|
|
950
1159
|
},
|
|
951
|
-
error:
|
|
1160
|
+
error: error => console.error('error', error),
|
|
952
1161
|
});
|
|
953
1162
|
}
|
|
954
1163
|
}
|
|
955
1164
|
setWidth() {
|
|
956
|
-
let style = {
|
|
957
|
-
|
|
958
|
-
|
|
1165
|
+
let style = {};
|
|
1166
|
+
if (this.width) {
|
|
1167
|
+
style = {
|
|
1168
|
+
width: this.width + 'rem',
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
else {
|
|
1172
|
+
style = {
|
|
1173
|
+
width: '100%',
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
959
1176
|
return style;
|
|
960
1177
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
1178
|
+
onClickAddNew() {
|
|
1179
|
+
console.log('DYNAMIC DIALOG NOT IMPLEMENTED IN LIBRARY YET');
|
|
1180
|
+
// Add dynamic dialog later
|
|
1181
|
+
// let dialogRef = this.dialog.open(DynamicDialogComponent, {
|
|
1182
|
+
// panelClass: 'custom-dialog-padding',
|
|
1183
|
+
// width: '90%',
|
|
1184
|
+
// minWidth: '90%',
|
|
1185
|
+
// maxHeight: '90vh',
|
|
1186
|
+
// data: {
|
|
1187
|
+
// component: this.dialogComponentClass,
|
|
1188
|
+
// showDefaultButtons: this.showDialogDefaultButtons,
|
|
1189
|
+
// title: this.dialogTitle,
|
|
1190
|
+
// inputs: this.dialogComponentInputs,
|
|
1191
|
+
// },
|
|
1192
|
+
// });
|
|
1193
|
+
// dialogRef.afterClosed().subscribe((data: any) => {
|
|
1194
|
+
// if (data) {
|
|
1195
|
+
// console.log('New item Added: ', data);
|
|
1196
|
+
// this.items.push(data);
|
|
1197
|
+
// this.items = [...this.items];
|
|
1198
|
+
// }
|
|
1199
|
+
// });
|
|
1200
|
+
}
|
|
1201
|
+
setDisabledState(isDisabled) {
|
|
1202
|
+
this.disabled = isDisabled;
|
|
1203
|
+
}
|
|
1204
|
+
registerOnValidatorChange(fn) {
|
|
1205
|
+
this.onValidationChange = fn;
|
|
1206
|
+
}
|
|
1207
|
+
validate(control) {
|
|
1208
|
+
return null;
|
|
1209
|
+
if (control) {
|
|
1210
|
+
const errors = control.errors;
|
|
1211
|
+
if (errors) {
|
|
1212
|
+
console.log('errorssss: ', errors);
|
|
1213
|
+
return errors;
|
|
1214
|
+
}
|
|
1215
|
+
else {
|
|
1216
|
+
return null;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
967
1219
|
}
|
|
968
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemComponent, deps: [{ token: ChooseGeneralItemService }], target: i0.ɵɵFactoryTarget.Component });
|
|
969
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ChooseGeneralItemComponent, selector: "choose-general-item", inputs: { items: "items", label: "label", appendTo: "appendTo", placeholder: "placeholder", apiPath: "apiPath", isMultiple: "isMultiple", hideSelectedItem: "hideSelectedItem", objects: "objects", showLabel: "showLabel", separator: "separator", width: "width",
|
|
1220
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemComponent, deps: [{ token: ChooseGeneralItemService }, { token: i2$3.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1221
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ChooseGeneralItemComponent, selector: "choose-general-item", inputs: { items: "items", label: "label", appendTo: "appendTo", placeholder: "placeholder", apiPath: "apiPath", isMultiple: "isMultiple", hideSelectedItem: "hideSelectedItem", objects: "objects", showLabel: "showLabel", separator: "separator", width: "width", isChip: "isChip", isTypeDate: "isTypeDate", chipColor: "chipColor", chipTextColor: "chipTextColor", chipWidth: "chipWidth", selectedItemId: "selectedItemId", disabled: "disabled", readOnly: "readOnly", useFullObject: "useFullObject", showAdd: "showAdd", dialogComponentClass: "dialogComponentClass", showDialogDefaultButtons: "showDialogDefaultButtons", dialogComponentInputs: "dialogComponentInputs", bindValueKey: "bindValueKey", addRoute: "addRoute", canActionsRoute: "canActionsRoute", dialogTitle: "dialogTitle", clearable: "clearable", filterParams: "filterParams", templateType: "templateType", basicTemplateData: "basicTemplateData", contentProjectionLabelKey: "contentProjectionLabelKey", fullObjectControlConfig: "fullObjectControlConfig" }, outputs: { change: "change", blur: "blur" }, providers: [
|
|
970
1222
|
{
|
|
971
1223
|
provide: NG_VALUE_ACCESSOR,
|
|
972
1224
|
useExisting: forwardRef(() => ChooseGeneralItemComponent),
|
|
973
1225
|
multi: true,
|
|
974
1226
|
},
|
|
975
|
-
|
|
1227
|
+
{
|
|
1228
|
+
provide: NG_VALIDATORS,
|
|
1229
|
+
useExisting: ChooseGeneralItemComponent,
|
|
1230
|
+
multi: true,
|
|
1231
|
+
},
|
|
1232
|
+
], queries: [{ propertyName: "customOptionTemplate", first: true, predicate: ["customOption"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"select\">\r\n <ng-select [readonly]=\"readOnly\" [loading]=\"isLoading\" [hideSelected]=\"hideSelectedItem\"\r\n [closeOnSelect]=\"!isMultiple\" [ngStyle]=\"setWidth()\" class=\"component\" [disabled]=\"disabled\"\r\n [appendTo]=\"appendTo\" dropdownPosition=\"bottom\" (blur)=\"updateBlur()\" [bindLabel]=\"label\"\r\n [bindValue]=\"bindValueKey\" [compareWith]=\"\" [items]=\"items\" [placeholder]=\"placeholder\"\r\n (change)=\"onSelectedItemChanged($event)\" [(ngModel)]=\"selectedItemId\" [clearable]=\"clearable\"\r\n [multiple]=\"isMultiple\">\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.DEFAULT\">\r\n <ng-template *ngIf=\"isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\"> </ng-template>\r\n\r\n <ng-template ng-label-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container *ngIf=\"objects; else nonObjectLabelTemplate\">\r\n <span class=\"template\" *ngFor=\"let object of objects; let isLast = last\">\r\n <span class=\"template-item\">\r\n {{ showLabel ? object.label + ': ' : ''\r\n }}{{\r\n isTypeDate ? (item[object.field] | date: 'mediumDate') : item[object.field]\r\n }}</span>\r\n </span>\r\n </ng-container>\r\n <ng-template #nonObjectLabelTemplate>{{ item }} </ng-template>\r\n </ng-template>\r\n\r\n <!-- Option Template -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container *ngIf=\"objects; else nonObjectOptionTemplate\">\r\n <span *ngFor=\"let object of objects; let isLast = last\">\r\n {{ showLabel ? object.label + ': ' : ''\r\n }}{{ isTypeDate ? (item[object.field] | date: 'mediumDate') : item[object.field] }}\r\n </span>\r\n </ng-container>\r\n <ng-template #nonObjectOptionTemplate>{{ item }} </ng-template>\r\n </ng-template>\r\n\r\n <ng-template *ngIf=\"isChip && !isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [clear]=\"clear\" [withCross]=\"isMultiple\"\r\n [inputType]=\"chipInputTypes.CUSTOM\"\r\n [backgroundColor]=\"item.disabled == true ? primaryRed : chipColor\" [label]=\"item[objects[0].field]\"\r\n [item]=\"item\">\r\n </ng-chip>\r\n </ng-template>\r\n <ng-template *ngIf=\"isChip && !isLoading\" ng-option-tmp let-clear=\"clear\" let-item=\"item\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [withCross]=\"false\" [inputType]=\"chipInputTypes.CUSTOM\"\r\n [backgroundColor]=\"item.disabled == true ? primaryRed : chipColor\" [label]=\"item[objects[0].field]\">\r\n </ng-chip>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.BASIC\">\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n {{ item[basicTemplateData.label] }}\r\n </ng-template>\r\n <ng-template ng-option-tmp let-clear=\"clear\" let-item=\"item\">\r\n <mat-card class=\"basic-template-card\" [ngClass]=\"{\r\n 'with-image': basicTemplateData.hasImage,\r\n 'without-image': !basicTemplateData.hasImage,\r\n }\">\r\n <div class=\"image-cont\" *ngIf=\"basicTemplateData.hasImage\">\r\n <img class=\"main-image\" [src]=\"item[basicTemplateData.image]\"\r\n onerror=\"this.src='../../../assets/images/defaultImage.jpg';\" />\r\n </div>\r\n\r\n <div class=\"info\">\r\n <div class=\"title\">\r\n {{ item[basicTemplateData.title] }}\r\n </div>\r\n <div class=\"subtitle-style\" *ngIf=\"basicTemplateData.hasSubtitleOne\">\r\n <span>{{ item[basicTemplateData.subtitleOne] }}</span>\r\n <ng-container *ngIf=\"basicTemplateData.hasSubtitleTwo\">\r\n <span class=\"col-divider\"> | </span>\r\n <span>{{ item[basicTemplateData.subtitleTwo] }}</span>\r\n </ng-container>\r\n </div>\r\n <div class=\"description\" *ngIf=\"basicTemplateData.hasDescription\">\r\n {{ item[basicTemplateData.description] }}\r\n </div>\r\n </div>\r\n </mat-card>\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.CONTENT_PROJECTION\">\r\n <ng-template *ngIf=\"isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\"> </ng-template>\r\n\r\n <ng-template ng-label-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <span class=\"template\">\r\n <span class=\"template-item\"> {{ item[contentProjectionLabelKey] }} </span>\r\n </span>\r\n </ng-template>\r\n\r\n <!-- Option Template -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container [ngTemplateOutlet]=\"customOptionTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item }\">\r\n </ng-container>\r\n </ng-template>\r\n </ng-container>\r\n </ng-select>\r\n <dropdown-actions *ngIf=\"showAdd\" [canRoute]=\"canActionsRoute\" [route]=\"addRoute\"\r\n (addClicked)=\"onClickAddNew()\"></dropdown-actions>\r\n</div>\r\n ", styles: [".template{background-color:#f0f2f4;border-radius:1.6rem;height:2.6rem;line-height:2.6rem;display:inline-block}.template-item{padding:.8rem 1.2rem}.basic-template-card{display:grid;row-gap:.4rem}.basic-template-card .image-cont,.basic-template-card .image-cont .main-image{max-width:100%;max-height:100%}.basic-template-card .info{display:flex;flex-direction:column;row-gap:.4rem;padding:.6rem;white-space:normal}.basic-template-card .info .title{font-weight:600;color:#155ed4}.basic-template-card .info .subtitle-style{font-weight:400}.basic-template-card .info .description{color:#676767;font-style:italic;font-size:1.1rem}.basic-template-card .info .col-divider{color:#12957e}.with-image{grid-template-columns:8rem auto}.without-image{grid-template-columns:auto}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i2.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i4.NgChipComponent, selector: "ng-chip", inputs: ["backgroundColor", "size", "clear", "customColors", "enumClass", "enumValue", "inputType", "item", "isClickable", "label", "width", "withCross"] }, { kind: "component", type: DropdownActionsComponent, selector: "dropdown-actions", inputs: ["canRoute", "disabled", "labelsAndRoutes", "route", "dropdownActionType"], outputs: ["addClicked"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
976
1233
|
}
|
|
977
1234
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemComponent, decorators: [{
|
|
978
1235
|
type: Component,
|
|
@@ -982,10 +1239,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
982
1239
|
useExisting: forwardRef(() => ChooseGeneralItemComponent),
|
|
983
1240
|
multi: true,
|
|
984
1241
|
},
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1242
|
+
{
|
|
1243
|
+
provide: NG_VALIDATORS,
|
|
1244
|
+
useExisting: ChooseGeneralItemComponent,
|
|
1245
|
+
multi: true,
|
|
1246
|
+
},
|
|
1247
|
+
], template: "<div class=\"select\">\r\n <ng-select [readonly]=\"readOnly\" [loading]=\"isLoading\" [hideSelected]=\"hideSelectedItem\"\r\n [closeOnSelect]=\"!isMultiple\" [ngStyle]=\"setWidth()\" class=\"component\" [disabled]=\"disabled\"\r\n [appendTo]=\"appendTo\" dropdownPosition=\"bottom\" (blur)=\"updateBlur()\" [bindLabel]=\"label\"\r\n [bindValue]=\"bindValueKey\" [compareWith]=\"\" [items]=\"items\" [placeholder]=\"placeholder\"\r\n (change)=\"onSelectedItemChanged($event)\" [(ngModel)]=\"selectedItemId\" [clearable]=\"clearable\"\r\n [multiple]=\"isMultiple\">\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.DEFAULT\">\r\n <ng-template *ngIf=\"isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\"> </ng-template>\r\n\r\n <ng-template ng-label-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container *ngIf=\"objects; else nonObjectLabelTemplate\">\r\n <span class=\"template\" *ngFor=\"let object of objects; let isLast = last\">\r\n <span class=\"template-item\">\r\n {{ showLabel ? object.label + ': ' : ''\r\n }}{{\r\n isTypeDate ? (item[object.field] | date: 'mediumDate') : item[object.field]\r\n }}</span>\r\n </span>\r\n </ng-container>\r\n <ng-template #nonObjectLabelTemplate>{{ item }} </ng-template>\r\n </ng-template>\r\n\r\n <!-- Option Template -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container *ngIf=\"objects; else nonObjectOptionTemplate\">\r\n <span *ngFor=\"let object of objects; let isLast = last\">\r\n {{ showLabel ? object.label + ': ' : ''\r\n }}{{ isTypeDate ? (item[object.field] | date: 'mediumDate') : item[object.field] }}\r\n </span>\r\n </ng-container>\r\n <ng-template #nonObjectOptionTemplate>{{ item }} </ng-template>\r\n </ng-template>\r\n\r\n <ng-template *ngIf=\"isChip && !isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [clear]=\"clear\" [withCross]=\"isMultiple\"\r\n [inputType]=\"chipInputTypes.CUSTOM\"\r\n [backgroundColor]=\"item.disabled == true ? primaryRed : chipColor\" [label]=\"item[objects[0].field]\"\r\n [item]=\"item\">\r\n </ng-chip>\r\n </ng-template>\r\n <ng-template *ngIf=\"isChip && !isLoading\" ng-option-tmp let-clear=\"clear\" let-item=\"item\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [withCross]=\"false\" [inputType]=\"chipInputTypes.CUSTOM\"\r\n [backgroundColor]=\"item.disabled == true ? primaryRed : chipColor\" [label]=\"item[objects[0].field]\">\r\n </ng-chip>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.BASIC\">\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n {{ item[basicTemplateData.label] }}\r\n </ng-template>\r\n <ng-template ng-option-tmp let-clear=\"clear\" let-item=\"item\">\r\n <mat-card class=\"basic-template-card\" [ngClass]=\"{\r\n 'with-image': basicTemplateData.hasImage,\r\n 'without-image': !basicTemplateData.hasImage,\r\n }\">\r\n <div class=\"image-cont\" *ngIf=\"basicTemplateData.hasImage\">\r\n <img class=\"main-image\" [src]=\"item[basicTemplateData.image]\"\r\n onerror=\"this.src='../../../assets/images/defaultImage.jpg';\" />\r\n </div>\r\n\r\n <div class=\"info\">\r\n <div class=\"title\">\r\n {{ item[basicTemplateData.title] }}\r\n </div>\r\n <div class=\"subtitle-style\" *ngIf=\"basicTemplateData.hasSubtitleOne\">\r\n <span>{{ item[basicTemplateData.subtitleOne] }}</span>\r\n <ng-container *ngIf=\"basicTemplateData.hasSubtitleTwo\">\r\n <span class=\"col-divider\"> | </span>\r\n <span>{{ item[basicTemplateData.subtitleTwo] }}</span>\r\n </ng-container>\r\n </div>\r\n <div class=\"description\" *ngIf=\"basicTemplateData.hasDescription\">\r\n {{ item[basicTemplateData.description] }}\r\n </div>\r\n </div>\r\n </mat-card>\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.CONTENT_PROJECTION\">\r\n <ng-template *ngIf=\"isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\"> </ng-template>\r\n\r\n <ng-template ng-label-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <span class=\"template\">\r\n <span class=\"template-item\"> {{ item[contentProjectionLabelKey] }} </span>\r\n </span>\r\n </ng-template>\r\n\r\n <!-- Option Template -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container [ngTemplateOutlet]=\"customOptionTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item }\">\r\n </ng-container>\r\n </ng-template>\r\n </ng-container>\r\n </ng-select>\r\n <dropdown-actions *ngIf=\"showAdd\" [canRoute]=\"canActionsRoute\" [route]=\"addRoute\"\r\n (addClicked)=\"onClickAddNew()\"></dropdown-actions>\r\n</div>\r\n ", styles: [".template{background-color:#f0f2f4;border-radius:1.6rem;height:2.6rem;line-height:2.6rem;display:inline-block}.template-item{padding:.8rem 1.2rem}.basic-template-card{display:grid;row-gap:.4rem}.basic-template-card .image-cont,.basic-template-card .image-cont .main-image{max-width:100%;max-height:100%}.basic-template-card .info{display:flex;flex-direction:column;row-gap:.4rem;padding:.6rem;white-space:normal}.basic-template-card .info .title{font-weight:600;color:#155ed4}.basic-template-card .info .subtitle-style{font-weight:400}.basic-template-card .info .description{color:#676767;font-style:italic;font-size:1.1rem}.basic-template-card .info .col-divider{color:#12957e}.with-image{grid-template-columns:8rem auto}.without-image{grid-template-columns:auto}\n"] }]
|
|
1248
|
+
}], ctorParameters: function () { return [{ type: ChooseGeneralItemService }, { type: i2$3.MatDialog }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { items: [{
|
|
989
1249
|
type: Input
|
|
990
1250
|
}], label: [{
|
|
991
1251
|
type: Input
|
|
@@ -1007,10 +1267,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1007
1267
|
type: Input
|
|
1008
1268
|
}], width: [{
|
|
1009
1269
|
type: Input
|
|
1010
|
-
}], fontWeight: [{
|
|
1011
|
-
type: Input
|
|
1012
|
-
}], fontSize: [{
|
|
1013
|
-
type: Input
|
|
1014
1270
|
}], isChip: [{
|
|
1015
1271
|
type: Input
|
|
1016
1272
|
}], isTypeDate: [{
|
|
@@ -1025,8 +1281,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1025
1281
|
type: Input
|
|
1026
1282
|
}], disabled: [{
|
|
1027
1283
|
type: Input
|
|
1284
|
+
}], readOnly: [{
|
|
1285
|
+
type: Input
|
|
1028
1286
|
}], useFullObject: [{
|
|
1029
1287
|
type: Input
|
|
1288
|
+
}], showAdd: [{
|
|
1289
|
+
type: Input
|
|
1290
|
+
}], dialogComponentClass: [{
|
|
1291
|
+
type: Input
|
|
1292
|
+
}], showDialogDefaultButtons: [{
|
|
1293
|
+
type: Input
|
|
1294
|
+
}], dialogComponentInputs: [{
|
|
1295
|
+
type: Input
|
|
1296
|
+
}], bindValueKey: [{
|
|
1297
|
+
type: Input
|
|
1298
|
+
}], addRoute: [{
|
|
1299
|
+
type: Input
|
|
1300
|
+
}], canActionsRoute: [{
|
|
1301
|
+
type: Input
|
|
1302
|
+
}], dialogTitle: [{
|
|
1303
|
+
type: Input
|
|
1304
|
+
}], clearable: [{
|
|
1305
|
+
type: Input
|
|
1306
|
+
}], filterParams: [{
|
|
1307
|
+
type: Input
|
|
1308
|
+
}], templateType: [{
|
|
1309
|
+
type: Input
|
|
1310
|
+
}], basicTemplateData: [{
|
|
1311
|
+
type: Input
|
|
1312
|
+
}], contentProjectionLabelKey: [{
|
|
1313
|
+
type: Input
|
|
1314
|
+
}], fullObjectControlConfig: [{
|
|
1315
|
+
type: Input
|
|
1316
|
+
}], change: [{
|
|
1317
|
+
type: Output
|
|
1318
|
+
}], blur: [{
|
|
1319
|
+
type: Output
|
|
1320
|
+
}], customOptionTemplate: [{
|
|
1321
|
+
type: ContentChild,
|
|
1322
|
+
args: ['customOption']
|
|
1030
1323
|
}] } });
|
|
1031
1324
|
|
|
1032
1325
|
class ChooseGeneralItemRendererComponent {
|
|
@@ -1056,11 +1349,11 @@ class ChooseGeneralItemRendererComponent {
|
|
|
1056
1349
|
return true;
|
|
1057
1350
|
}
|
|
1058
1351
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1059
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ChooseGeneralItemRendererComponent, selector: "choose-general-item-renderer", ngImport: i0, template: "<choose-general-item [label]=\"params.label\" [appendTo]=\"'body'\" [placeholder]=\"params.placeholder\"\r\n [apiPath]=\"params.apiPath\" [isMultiple]=\"params.isMultiple\" [objects]=\"params.objects\"\r\n [showLabel]=\"params.showLabel\" [separator]=\"params.separator\" [width]=\"params.width\"
|
|
1352
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ChooseGeneralItemRendererComponent, selector: "choose-general-item-renderer", ngImport: i0, template: "<choose-general-item [label]=\"params.label\" [appendTo]=\"'body'\" [placeholder]=\"params.placeholder\"\r\n [apiPath]=\"params.apiPath\" [isMultiple]=\"params.isMultiple\" [objects]=\"params.objects\"\r\n [showLabel]=\"params.showLabel\" [separator]=\"params.separator\" [width]=\"params.width\" [isChip]=\"params.isChip\"\r\n [isTypeDate]=\"params.isTypeDate\" [chipColor]=\"params.chipColor\" [chipTextColor]=\"params.chipTextColor\"\r\n [chipWidth]=\"params.chipWidth\" [selectedItemId]=\"itemId\" [disabled]=\"params.disabled\"\r\n (change)=\"onCellDataChanged($event)\">\r\n</choose-general-item>", styles: [".all{display:grid;gap:.5rem;align-items:center;margin:auto}.single{grid-template-columns:auto}.double{grid-template-columns:auto max-content}\n"], dependencies: [{ kind: "component", type: ChooseGeneralItemComponent, selector: "choose-general-item", inputs: ["items", "label", "appendTo", "placeholder", "apiPath", "isMultiple", "hideSelectedItem", "objects", "showLabel", "separator", "width", "isChip", "isTypeDate", "chipColor", "chipTextColor", "chipWidth", "selectedItemId", "disabled", "readOnly", "useFullObject", "showAdd", "dialogComponentClass", "showDialogDefaultButtons", "dialogComponentInputs", "bindValueKey", "addRoute", "canActionsRoute", "dialogTitle", "clearable", "filterParams", "templateType", "basicTemplateData", "contentProjectionLabelKey", "fullObjectControlConfig"], outputs: ["change", "blur"] }] });
|
|
1060
1353
|
}
|
|
1061
1354
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemRendererComponent, decorators: [{
|
|
1062
1355
|
type: Component,
|
|
1063
|
-
args: [{ selector: 'choose-general-item-renderer', template: "<choose-general-item [label]=\"params.label\" [appendTo]=\"'body'\" [placeholder]=\"params.placeholder\"\r\n [apiPath]=\"params.apiPath\" [isMultiple]=\"params.isMultiple\" [objects]=\"params.objects\"\r\n [showLabel]=\"params.showLabel\" [separator]=\"params.separator\" [width]=\"params.width\"
|
|
1356
|
+
args: [{ selector: 'choose-general-item-renderer', template: "<choose-general-item [label]=\"params.label\" [appendTo]=\"'body'\" [placeholder]=\"params.placeholder\"\r\n [apiPath]=\"params.apiPath\" [isMultiple]=\"params.isMultiple\" [objects]=\"params.objects\"\r\n [showLabel]=\"params.showLabel\" [separator]=\"params.separator\" [width]=\"params.width\" [isChip]=\"params.isChip\"\r\n [isTypeDate]=\"params.isTypeDate\" [chipColor]=\"params.chipColor\" [chipTextColor]=\"params.chipTextColor\"\r\n [chipWidth]=\"params.chipWidth\" [selectedItemId]=\"itemId\" [disabled]=\"params.disabled\"\r\n (change)=\"onCellDataChanged($event)\">\r\n</choose-general-item>", styles: [".all{display:grid;gap:.5rem;align-items:center;margin:auto}.single{grid-template-columns:auto}.double{grid-template-columns:auto max-content}\n"] }]
|
|
1064
1357
|
}], ctorParameters: function () { return []; } });
|
|
1065
1358
|
|
|
1066
1359
|
var LineType;
|
|
@@ -1365,7 +1658,7 @@ class EditableSavableInputComponent {
|
|
|
1365
1658
|
useExisting: forwardRef(() => EditableSavableInputComponent),
|
|
1366
1659
|
multi: true
|
|
1367
1660
|
}
|
|
1368
|
-
], ngImport: i0, template: "<div *ngIf=\"showHeader\" class=\"header\">\r\n {{headerLabel}}\r\n</div>\r\n<div class=\"container\" [ngClass]=\"{'closed':!isAddClickedOn, 'open': isAddClickedOn}\">\r\n <div class=\"content\">\r\n <div class=\"default-content\" *ngIf=\"!isAddClickedOn && !isUpdated && isEditable\">\r\n <div class=\"add\" (click)=\"onClickAdd()\">\r\n {{defaultvalue}} </div>\r\n </div>\r\n <div class=\"edit-content\" *ngIf=\"isAddClickedOn\">\r\n <label class=\"input-label\" for=\"input\">{{newLabel}}</label>\r\n <div class=\"input \" [ngClass]=\"{'input-with-appended-unit': showUnit}\">\r\n <span *ngIf=\"showUnit\">{{unit}}</span>\r\n <input (change)=\"onChange($event)\" (blur)=\"updateBlur()\" [ngModel]=\"value\" [value]=\"value\" id=\"input\" #input\r\n class=\"form-control\" [ngClass]=\"{'input-box': showUnit}\" [type]=\"inputType\">\r\n </div>\r\n <div class=\"edit-actions\">\r\n <button type=\"button\" class=\"btn cancel\" (click)=\"onClickCancel()\" mat-raised-button>Cancel</button>\r\n <button type=\"button\" class=\"save\" (click)=\"onClickSave(input)\" mat-raised-button color=\"primary\">Save</button>\r\n </div>\r\n </div>\r\n <div class=\"updated-content closed\" *ngIf=\"!isAddClickedOn && isUpdated\" (mouseenter)=\"onMouseEnter()\"\r\n (mouseleave)=\"onMouseLeave()\">\r\n <div class=\"edit-icon-container\" *ngIf=\"showEdit && isEditable\" (click)=\"onClickEdit()\">\r\n <i class=\"fas fa-pencil-alt\"></i>\r\n </div>\r\n <div class=\"updated\">\r\n <span class=\"updated-label\">\r\n <label for=\"input\">{{newLabel}}</label>\r\n </span>\r\n <span *ngIf=\"!showUnit\">{{value}}</span>\r\n <span *ngIf=\"showUnit\" class=\"updated-value\">\r\n {{value | dynamicPipe: unitType}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".container{display:block;width:100%}.open{height:120px}.closed{height:40px}.edit-icon-container{position:absolute;right:0%;transform:translate(0);top:0;cursor:pointer}.edit-icon-container:hover{background-color:gray;color:#fff;padding:2px}label,.updated-label{color:gray;margin-right:5px}#input{display:inline}.cancel{grid-column:1;grid-row:2;height:80%;width:80px}.save{grid-column:2;grid-row:2;height:80%;width:80px}.default-content{position:absolute}.input{width:280px;grid-column:2;grid-row:1}.input-box{width:200px}.input-label{grid-column:1;grid-row:1}.updated{position:absolute}.add{color:#00f}.add:hover{text-decoration:underline;cursor:pointer}.content{position:relative}.btn:focus{outline:none!important}.edit-content{position:absolute;left:50%;transform:translate(-50%);display:grid;grid-template-columns:150px 200px;grid-template-rows:50px 50px}.updated-content{display:block}.header{color:gray;border-bottom:1px solid grey;height:30px;font-size:20px;margin-bottom:10px;margin-top:10px}.input-with-appended-unit input{padding-left:20px;text-align:left}.input-with-appended-unit span{position:relative;left:20px;color:gray}.edit-actions{grid-column:2;grid-row:2;display:grid;grid-template-columns:50% 50%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: DynamicPipe, name: "dynamicPipe" }] });
|
|
1661
|
+
], ngImport: i0, template: "<div *ngIf=\"showHeader\" class=\"header\">\r\n {{headerLabel}}\r\n</div>\r\n<div class=\"container\" [ngClass]=\"{'closed':!isAddClickedOn, 'open': isAddClickedOn}\">\r\n <div class=\"content\">\r\n <div class=\"default-content\" *ngIf=\"!isAddClickedOn && !isUpdated && isEditable\">\r\n <div class=\"add\" (click)=\"onClickAdd()\">\r\n {{defaultvalue}} </div>\r\n </div>\r\n <div class=\"edit-content\" *ngIf=\"isAddClickedOn\">\r\n <label class=\"input-label\" for=\"input\">{{newLabel}}</label>\r\n <div class=\"input \" [ngClass]=\"{'input-with-appended-unit': showUnit}\">\r\n <span *ngIf=\"showUnit\">{{unit}}</span>\r\n <input (change)=\"onChange($event)\" (blur)=\"updateBlur()\" [ngModel]=\"value\" [value]=\"value\" id=\"input\" #input\r\n class=\"form-control\" [ngClass]=\"{'input-box': showUnit}\" [type]=\"inputType\">\r\n </div>\r\n <div class=\"edit-actions\">\r\n <button type=\"button\" class=\"btn cancel\" (click)=\"onClickCancel()\" mat-raised-button>Cancel</button>\r\n <button type=\"button\" class=\"save\" (click)=\"onClickSave(input)\" mat-raised-button color=\"primary\">Save</button>\r\n </div>\r\n </div>\r\n <div class=\"updated-content closed\" *ngIf=\"!isAddClickedOn && isUpdated\" (mouseenter)=\"onMouseEnter()\"\r\n (mouseleave)=\"onMouseLeave()\">\r\n <div class=\"edit-icon-container\" *ngIf=\"showEdit && isEditable\" (click)=\"onClickEdit()\">\r\n <i class=\"fas fa-pencil-alt\"></i>\r\n </div>\r\n <div class=\"updated\">\r\n <span class=\"updated-label\">\r\n <label for=\"input\">{{newLabel}}</label>\r\n </span>\r\n <span *ngIf=\"!showUnit\">{{value}}</span>\r\n <span *ngIf=\"showUnit\" class=\"updated-value\">\r\n {{value | dynamicPipe: unitType}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".container{display:block;width:100%}.open{height:120px}.closed{height:40px}.edit-icon-container{position:absolute;right:0%;transform:translate(0);top:0;cursor:pointer}.edit-icon-container:hover{background-color:gray;color:#fff;padding:2px}label,.updated-label{color:gray;margin-right:5px}#input{display:inline}.cancel{grid-column:1;grid-row:2;height:80%;width:80px}.save{grid-column:2;grid-row:2;height:80%;width:80px}.default-content{position:absolute}.input{width:280px;grid-column:2;grid-row:1}.input-box{width:200px}.input-label{grid-column:1;grid-row:1}.updated{position:absolute}.add{color:#00f}.add:hover{text-decoration:underline;cursor:pointer}.content{position:relative}.btn:focus{outline:none!important}.edit-content{position:absolute;left:50%;transform:translate(-50%);display:grid;grid-template-columns:150px 200px;grid-template-rows:50px 50px}.updated-content{display:block}.header{color:gray;border-bottom:1px solid grey;height:30px;font-size:20px;margin-bottom:10px;margin-top:10px}.input-with-appended-unit input{padding-left:20px;text-align:left}.input-with-appended-unit span{position:relative;left:20px;color:gray}.edit-actions{grid-column:2;grid-row:2;display:grid;grid-template-columns:50% 50%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: DynamicPipe, name: "dynamicPipe" }] });
|
|
1369
1662
|
}
|
|
1370
1663
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EditableSavableInputComponent, decorators: [{
|
|
1371
1664
|
type: Component,
|
|
@@ -1759,80 +2052,6 @@ class LabelAndField {
|
|
|
1759
2052
|
field;
|
|
1760
2053
|
}
|
|
1761
2054
|
|
|
1762
|
-
var DropdownActionType;
|
|
1763
|
-
(function (DropdownActionType) {
|
|
1764
|
-
DropdownActionType[DropdownActionType["ADD"] = 0] = "ADD";
|
|
1765
|
-
DropdownActionType[DropdownActionType["MENU"] = 1] = "MENU";
|
|
1766
|
-
})(DropdownActionType || (DropdownActionType = {}));
|
|
1767
|
-
|
|
1768
|
-
class DropdownActionsComponent {
|
|
1769
|
-
_Router;
|
|
1770
|
-
dropdownActionTypes = DropdownActionType;
|
|
1771
|
-
canRoute = true;
|
|
1772
|
-
disabled;
|
|
1773
|
-
labelsAndRoutes = [];
|
|
1774
|
-
route;
|
|
1775
|
-
dropdownActionType = this.dropdownActionTypes.ADD;
|
|
1776
|
-
addClicked = new EventEmitter();
|
|
1777
|
-
constructor(_Router) {
|
|
1778
|
-
this._Router = _Router;
|
|
1779
|
-
}
|
|
1780
|
-
ngOnInit() {
|
|
1781
|
-
this.validateActions();
|
|
1782
|
-
}
|
|
1783
|
-
validateActions() {
|
|
1784
|
-
if (this.dropdownActionType == this.dropdownActionTypes.ADD) {
|
|
1785
|
-
if (this.canRoute) {
|
|
1786
|
-
if (this.route == "" || this.route == undefined || this.route == null) {
|
|
1787
|
-
throw Error("Route needs to be provided.");
|
|
1788
|
-
}
|
|
1789
|
-
}
|
|
1790
|
-
else {
|
|
1791
|
-
if (this.route) {
|
|
1792
|
-
throw Error("Route shouldn't be provided since canRoute is false");
|
|
1793
|
-
}
|
|
1794
|
-
}
|
|
1795
|
-
}
|
|
1796
|
-
else if (this.dropdownActionType == this.dropdownActionTypes.MENU) {
|
|
1797
|
-
if (!this.labelsAndRoutes.length) {
|
|
1798
|
-
throw Error("A list of labels & Routes need to be provided for the actions menu.");
|
|
1799
|
-
}
|
|
1800
|
-
}
|
|
1801
|
-
else {
|
|
1802
|
-
throw Error("Dropdown Action Type is not recognized.");
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
onClickAdd($event) {
|
|
1806
|
-
$event.preventDefault();
|
|
1807
|
-
if (this.canRoute && this.route) {
|
|
1808
|
-
this._Router.navigate([this.route]);
|
|
1809
|
-
}
|
|
1810
|
-
this.addClicked.emit();
|
|
1811
|
-
}
|
|
1812
|
-
onClickLabel(route, $event) {
|
|
1813
|
-
$event.preventDefault();
|
|
1814
|
-
this._Router.navigate([route]);
|
|
1815
|
-
}
|
|
1816
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownActionsComponent, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
1817
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DropdownActionsComponent, selector: "dropdown-actions", inputs: { canRoute: "canRoute", disabled: "disabled", labelsAndRoutes: "labelsAndRoutes", route: "route", dropdownActionType: "dropdownActionType" }, outputs: { addClicked: "addClicked" }, ngImport: i0, template: "<div [ngSwitch]=\"dropdownActionType\">\r\n <a *ngSwitchCase=\"dropdownActionTypes.ADD\" [href]=\"route\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n (click)=\"onClickAdd($event)\">\r\n <fa-icon icon=\"plus\"></fa-icon>\r\n </a>\r\n <fa-icon *ngSwitchCase=\"dropdownActionTypes.MENU\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n class=\"menu\" [matMenuTriggerFor]=\"menu\"\r\n icon=\"ellipsis-vertical\"></fa-icon>\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let labelAndRoute of labelsAndRoutes\" mat-menu-item>\r\n <a [href]=\"labelAndRoute.route\"\r\n (click)=\"onClickLabel(labelAndRoute.route, $event)\">{{labelAndRoute.label}}</a>\r\n </button>\r\n </mat-menu>\r\n</div>", styles: [".action-enabled{cursor:pointer;color:#155ed4}.action-enabled:hover{color:#3178eb}.disabled{color:#676767;cursor:initial;pointer-events:none}.menu{font-size:1.8rem;display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i3$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i3$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i2$2.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }] });
|
|
1818
|
-
}
|
|
1819
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownActionsComponent, decorators: [{
|
|
1820
|
-
type: Component,
|
|
1821
|
-
args: [{ selector: 'dropdown-actions', template: "<div [ngSwitch]=\"dropdownActionType\">\r\n <a *ngSwitchCase=\"dropdownActionTypes.ADD\" [href]=\"route\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n (click)=\"onClickAdd($event)\">\r\n <fa-icon icon=\"plus\"></fa-icon>\r\n </a>\r\n <fa-icon *ngSwitchCase=\"dropdownActionTypes.MENU\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n class=\"menu\" [matMenuTriggerFor]=\"menu\"\r\n icon=\"ellipsis-vertical\"></fa-icon>\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let labelAndRoute of labelsAndRoutes\" mat-menu-item>\r\n <a [href]=\"labelAndRoute.route\"\r\n (click)=\"onClickLabel(labelAndRoute.route, $event)\">{{labelAndRoute.label}}</a>\r\n </button>\r\n </mat-menu>\r\n</div>", styles: [".action-enabled{cursor:pointer;color:#155ed4}.action-enabled:hover{color:#3178eb}.disabled{color:#676767;cursor:initial;pointer-events:none}.menu{font-size:1.8rem;display:flex;align-items:center}\n"] }]
|
|
1822
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }]; }, propDecorators: { canRoute: [{
|
|
1823
|
-
type: Input
|
|
1824
|
-
}], disabled: [{
|
|
1825
|
-
type: Input
|
|
1826
|
-
}], labelsAndRoutes: [{
|
|
1827
|
-
type: Input
|
|
1828
|
-
}], route: [{
|
|
1829
|
-
type: Input
|
|
1830
|
-
}], dropdownActionType: [{
|
|
1831
|
-
type: Input
|
|
1832
|
-
}], addClicked: [{
|
|
1833
|
-
type: Output
|
|
1834
|
-
}] } });
|
|
1835
|
-
|
|
1836
2055
|
class AddAsteriskDirective {
|
|
1837
2056
|
elem;
|
|
1838
2057
|
show = true;
|