@huntsman-cancer-institute/dictionary-editor 16.0.1 → 17.0.0
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/components/detail.component.d.ts +90 -90
- package/components/home.component.d.ts +13 -13
- package/components/new-row.component.d.ts +20 -20
- package/dictionary-editor.component.d.ts +43 -43
- package/dictionary-editor.module.d.ts +24 -24
- package/dictionary-editor.routes.d.ts +4 -4
- package/esm2022/components/detail.component.mjs +606 -606
- package/esm2022/components/home.component.mjs +28 -28
- package/esm2022/components/new-row.component.mjs +81 -81
- package/esm2022/dictionary-editor.component.mjs +169 -169
- package/esm2022/dictionary-editor.module.mjs +76 -76
- package/esm2022/dictionary-editor.routes.mjs +14 -14
- package/esm2022/grid-editors/ag-grid-date-cell-editor.component.mjs +30 -30
- package/esm2022/grid-editors/ag-grid-editor.module.mjs +55 -55
- package/esm2022/grid-editors/datepicker.component.mjs +93 -93
- package/esm2022/grid-editors/select.editor.mjs +142 -142
- package/esm2022/grid-renderers/ag-grid-renderer.module.mjs +36 -36
- package/esm2022/grid-renderers/cell-renderer-validation.mjs +345 -345
- package/esm2022/grid-renderers/date.renderer.mjs +68 -68
- package/esm2022/grid-renderers/select.renderer.mjs +95 -95
- package/esm2022/huntsman-cancer-institute-dictionary-editor.mjs +4 -4
- package/esm2022/index.mjs +4 -4
- package/fesm2022/huntsman-cancer-institute-dictionary-editor.mjs +1718 -1718
- package/fesm2022/huntsman-cancer-institute-dictionary-editor.mjs.map +1 -1
- package/grid-editors/ag-grid-date-cell-editor.component.d.ts +11 -11
- package/grid-editors/ag-grid-editor.module.d.ts +15 -15
- package/grid-editors/datepicker.component.d.ts +16 -16
- package/grid-editors/select.editor.d.ts +30 -30
- package/grid-renderers/ag-grid-renderer.module.d.ts +10 -10
- package/grid-renderers/cell-renderer-validation.d.ts +69 -69
- package/grid-renderers/date.renderer.d.ts +15 -15
- package/grid-renderers/select.renderer.d.ts +17 -17
- package/index.d.ts +4 -4
- package/package.json +18 -10
|
@@ -26,149 +26,149 @@ import * as i3$1 from '@angular/material/datepicker';
|
|
|
26
26
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
27
27
|
import { MomentDateModule } from '@angular/material-moment-adapter';
|
|
28
28
|
|
|
29
|
-
/**
|
|
30
|
-
* The root component for the dictionary editor. This defines a sidebar which will contain the list of dictionaries.
|
|
31
|
-
* The sub route here will display a detail component when a dictionary is selected.
|
|
32
|
-
*
|
|
33
|
-
* @since 1.0.0
|
|
34
|
-
*/
|
|
35
|
-
class DictionaryEditorComponent {
|
|
36
|
-
constructor(dictionaryService, renderer) {
|
|
37
|
-
this.dictionaryService = dictionaryService;
|
|
38
|
-
this.renderer = renderer;
|
|
39
|
-
this.classList = "outlet-row";
|
|
40
|
-
this.filterReadOnlyDictionaries = true;
|
|
41
|
-
this.sortDictionariesUp = true;
|
|
42
|
-
this.loadingSubject = new BehaviorSubject(false);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Upon creation, set up the sidebar and listen for the list of dictionaries from the service.
|
|
46
|
-
*/
|
|
47
|
-
ngOnInit() {
|
|
48
|
-
this.dictionariesReference = [];
|
|
49
|
-
this.loadingSubject.next(true);
|
|
50
|
-
this.setDictionarySideBarConfiguration();
|
|
51
|
-
// Makes Call To Get The Dictionaries
|
|
52
|
-
this.dictionaryService.getDictionaries().subscribe(theData => {
|
|
53
|
-
this.dictionariesReference = theData.filter(this.checkInternalOnly);
|
|
54
|
-
this.dictionariesReference.sort((dictionaryA, dictionaryB) => (dictionaryA.displayName < dictionaryB.displayName ? -1 : 1));
|
|
55
|
-
this.dictionariesReferenceCopy = this.dictionariesReference;
|
|
56
|
-
this.dictionariesReference = this.dictionariesReference.filter(this.checkReadOnly);
|
|
57
|
-
this.setDictionarySideBarConfiguration();
|
|
58
|
-
this.loadingSubject.next(false);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/*************************************************
|
|
62
|
-
* Helper Method To Configure Dictionary Side Bar
|
|
63
|
-
*************************************************/
|
|
64
|
-
setDictionarySideBarConfiguration() {
|
|
65
|
-
let resultMessage = this.dictionariesReference.length == 0
|
|
66
|
-
? ""
|
|
67
|
-
: this.dictionariesReference.length + " Results";
|
|
68
|
-
this.sidebar.setConfig({
|
|
69
|
-
sidebarSize: 240,
|
|
70
|
-
showCollapse: false,
|
|
71
|
-
children: [
|
|
72
|
-
{
|
|
73
|
-
type: SearchListControllerComponent,
|
|
74
|
-
id: "SLCC",
|
|
75
|
-
showTitle: false,
|
|
76
|
-
filterByAllowedFields: ["displayName"],
|
|
77
|
-
sortByAllowedFields: ["displayName"],
|
|
78
|
-
loadingSubjects: [this.loadingSubject]
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
type: UlNavComponent,
|
|
82
|
-
ulClass: "hci-dic-ul-class",
|
|
83
|
-
id: "filterAndSortContainer",
|
|
84
|
-
children: [
|
|
85
|
-
{
|
|
86
|
-
type: LiNavComponent,
|
|
87
|
-
id: "filterReadOnly",
|
|
88
|
-
title: "Show All",
|
|
89
|
-
spanClass: "hci-dic-span-1",
|
|
90
|
-
liClass: "hci-dic-li-l",
|
|
91
|
-
iClass: "hci-dic-i",
|
|
92
|
-
ulClass: "hci-dic-ul",
|
|
93
|
-
expandable: true,
|
|
94
|
-
iRight: false,
|
|
95
|
-
showValueFlag: true,
|
|
96
|
-
showValue: resultMessage,
|
|
97
|
-
showValueClass: "hci-dic-show-value",
|
|
98
|
-
liClick: () => {
|
|
99
|
-
this.filter();
|
|
100
|
-
let SLC = this.sidebar.getChild("dictionaries-component");
|
|
101
|
-
SLC.setData(this.dictionariesReference);
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
type: LiNavComponent,
|
|
106
|
-
id: "sort",
|
|
107
|
-
title: "",
|
|
108
|
-
spanClass: "hci-dic-span-2",
|
|
109
|
-
liClass: "hci-dic-li-r",
|
|
110
|
-
iClass: "fa-solid fa-arrow-down-a-z hci-dic-i",
|
|
111
|
-
ulClass: "hci-dic-ul",
|
|
112
|
-
expandable: true,
|
|
113
|
-
iRight: true,
|
|
114
|
-
liClick: (click) => {
|
|
115
|
-
let SLCC = this.sidebar.getChild("SLCC");
|
|
116
|
-
SLCC.setSort(click, "displayName");
|
|
117
|
-
this.sortDictionariesUp = !this.sortDictionariesUp;
|
|
118
|
-
let sort = this.sidebar.getChild("filterAndSortContainer").getChild("sort");
|
|
119
|
-
if (this.sortDictionariesUp) {
|
|
120
|
-
sort.config.iClass = "fas fa-solid fa-arrow-down-a-z";
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
sort.config.iClass = "fa-solid fa-arrow-up-a-z";
|
|
124
|
-
}
|
|
125
|
-
sort.updateConfig(sort.config);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
type: SearchListComponent,
|
|
132
|
-
id: "dictionaries-component",
|
|
133
|
-
title: "Dictionaries",
|
|
134
|
-
itemTemplate: this.dictionaryTemplate,
|
|
135
|
-
sorts: [new HciSortDto("displayName", true)],
|
|
136
|
-
data: this.dictionariesReference,
|
|
137
|
-
loadingSubjects: [this.loadingSubject]
|
|
138
|
-
}
|
|
139
|
-
]
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
filter() {
|
|
143
|
-
this.filterReadOnlyDictionaries = !this.filterReadOnlyDictionaries;
|
|
144
|
-
let FRO = this.sidebar.getChild("filterAndSortContainer").getChild("filterReadOnly");
|
|
145
|
-
if (this.filterReadOnlyDictionaries) {
|
|
146
|
-
this.dictionariesReference = this.dictionariesReference.filter(this.checkReadOnly);
|
|
147
|
-
FRO.config.spanClass = "hci-dic-span-1";
|
|
148
|
-
FRO.config.showValue = (FRO.config.showValueFlag) ? this.dictionariesReference.length + " Result(s)" : "";
|
|
149
|
-
FRO.updateConfig(FRO.config);
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
this.dictionariesReference = this.dictionariesReferenceCopy;
|
|
153
|
-
FRO.config.spanClass = "hci-dic-span-3";
|
|
154
|
-
FRO.config.showValue = (FRO.config.showValueFlag) ? this.dictionariesReference.length + " Result(s)" : "";
|
|
155
|
-
FRO.updateConfig(FRO.config);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
/*******************************************************
|
|
159
|
-
* Helper Method To Determine If Dictionary Is Read Only
|
|
160
|
-
*******************************************************/
|
|
161
|
-
checkReadOnly(dictionary) {
|
|
162
|
-
return !dictionary.readOnly;
|
|
163
|
-
}
|
|
164
|
-
/***********************************************************
|
|
165
|
-
* Helper Method To Determine If Dictionary Is Internal Only
|
|
166
|
-
***********************************************************/
|
|
167
|
-
checkInternalOnly(dictionary) {
|
|
168
|
-
return !dictionary.internalOnly;
|
|
169
|
-
}
|
|
170
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
171
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
29
|
+
/**
|
|
30
|
+
* The root component for the dictionary editor. This defines a sidebar which will contain the list of dictionaries.
|
|
31
|
+
* The sub route here will display a detail component when a dictionary is selected.
|
|
32
|
+
*
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
*/
|
|
35
|
+
class DictionaryEditorComponent {
|
|
36
|
+
constructor(dictionaryService, renderer) {
|
|
37
|
+
this.dictionaryService = dictionaryService;
|
|
38
|
+
this.renderer = renderer;
|
|
39
|
+
this.classList = "outlet-row";
|
|
40
|
+
this.filterReadOnlyDictionaries = true;
|
|
41
|
+
this.sortDictionariesUp = true;
|
|
42
|
+
this.loadingSubject = new BehaviorSubject(false);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Upon creation, set up the sidebar and listen for the list of dictionaries from the service.
|
|
46
|
+
*/
|
|
47
|
+
ngOnInit() {
|
|
48
|
+
this.dictionariesReference = [];
|
|
49
|
+
this.loadingSubject.next(true);
|
|
50
|
+
this.setDictionarySideBarConfiguration();
|
|
51
|
+
// Makes Call To Get The Dictionaries
|
|
52
|
+
this.dictionaryService.getDictionaries().subscribe(theData => {
|
|
53
|
+
this.dictionariesReference = theData.filter(this.checkInternalOnly);
|
|
54
|
+
this.dictionariesReference.sort((dictionaryA, dictionaryB) => (dictionaryA.displayName < dictionaryB.displayName ? -1 : 1));
|
|
55
|
+
this.dictionariesReferenceCopy = this.dictionariesReference;
|
|
56
|
+
this.dictionariesReference = this.dictionariesReference.filter(this.checkReadOnly);
|
|
57
|
+
this.setDictionarySideBarConfiguration();
|
|
58
|
+
this.loadingSubject.next(false);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/*************************************************
|
|
62
|
+
* Helper Method To Configure Dictionary Side Bar
|
|
63
|
+
*************************************************/
|
|
64
|
+
setDictionarySideBarConfiguration() {
|
|
65
|
+
let resultMessage = this.dictionariesReference.length == 0
|
|
66
|
+
? ""
|
|
67
|
+
: this.dictionariesReference.length + " Results";
|
|
68
|
+
this.sidebar.setConfig({
|
|
69
|
+
sidebarSize: 240,
|
|
70
|
+
showCollapse: false,
|
|
71
|
+
children: [
|
|
72
|
+
{
|
|
73
|
+
type: SearchListControllerComponent,
|
|
74
|
+
id: "SLCC",
|
|
75
|
+
showTitle: false,
|
|
76
|
+
filterByAllowedFields: ["displayName"],
|
|
77
|
+
sortByAllowedFields: ["displayName"],
|
|
78
|
+
loadingSubjects: [this.loadingSubject]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: UlNavComponent,
|
|
82
|
+
ulClass: "hci-dic-ul-class",
|
|
83
|
+
id: "filterAndSortContainer",
|
|
84
|
+
children: [
|
|
85
|
+
{
|
|
86
|
+
type: LiNavComponent,
|
|
87
|
+
id: "filterReadOnly",
|
|
88
|
+
title: "Show All",
|
|
89
|
+
spanClass: "hci-dic-span-1",
|
|
90
|
+
liClass: "hci-dic-li-l",
|
|
91
|
+
iClass: "hci-dic-i",
|
|
92
|
+
ulClass: "hci-dic-ul",
|
|
93
|
+
expandable: true,
|
|
94
|
+
iRight: false,
|
|
95
|
+
showValueFlag: true,
|
|
96
|
+
showValue: resultMessage,
|
|
97
|
+
showValueClass: "hci-dic-show-value",
|
|
98
|
+
liClick: () => {
|
|
99
|
+
this.filter();
|
|
100
|
+
let SLC = this.sidebar.getChild("dictionaries-component");
|
|
101
|
+
SLC.setData(this.dictionariesReference);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: LiNavComponent,
|
|
106
|
+
id: "sort",
|
|
107
|
+
title: "",
|
|
108
|
+
spanClass: "hci-dic-span-2",
|
|
109
|
+
liClass: "hci-dic-li-r",
|
|
110
|
+
iClass: "fa-solid fa-arrow-down-a-z hci-dic-i",
|
|
111
|
+
ulClass: "hci-dic-ul",
|
|
112
|
+
expandable: true,
|
|
113
|
+
iRight: true,
|
|
114
|
+
liClick: (click) => {
|
|
115
|
+
let SLCC = this.sidebar.getChild("SLCC");
|
|
116
|
+
SLCC.setSort(click, "displayName");
|
|
117
|
+
this.sortDictionariesUp = !this.sortDictionariesUp;
|
|
118
|
+
let sort = this.sidebar.getChild("filterAndSortContainer").getChild("sort");
|
|
119
|
+
if (this.sortDictionariesUp) {
|
|
120
|
+
sort.config.iClass = "fas fa-solid fa-arrow-down-a-z";
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
sort.config.iClass = "fa-solid fa-arrow-up-a-z";
|
|
124
|
+
}
|
|
125
|
+
sort.updateConfig(sort.config);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
type: SearchListComponent,
|
|
132
|
+
id: "dictionaries-component",
|
|
133
|
+
title: "Dictionaries",
|
|
134
|
+
itemTemplate: this.dictionaryTemplate,
|
|
135
|
+
sorts: [new HciSortDto("displayName", true)],
|
|
136
|
+
data: this.dictionariesReference,
|
|
137
|
+
loadingSubjects: [this.loadingSubject]
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
filter() {
|
|
143
|
+
this.filterReadOnlyDictionaries = !this.filterReadOnlyDictionaries;
|
|
144
|
+
let FRO = this.sidebar.getChild("filterAndSortContainer").getChild("filterReadOnly");
|
|
145
|
+
if (this.filterReadOnlyDictionaries) {
|
|
146
|
+
this.dictionariesReference = this.dictionariesReference.filter(this.checkReadOnly);
|
|
147
|
+
FRO.config.spanClass = "hci-dic-span-1";
|
|
148
|
+
FRO.config.showValue = (FRO.config.showValueFlag) ? this.dictionariesReference.length + " Result(s)" : "";
|
|
149
|
+
FRO.updateConfig(FRO.config);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
this.dictionariesReference = this.dictionariesReferenceCopy;
|
|
153
|
+
FRO.config.spanClass = "hci-dic-span-3";
|
|
154
|
+
FRO.config.showValue = (FRO.config.showValueFlag) ? this.dictionariesReference.length + " Result(s)" : "";
|
|
155
|
+
FRO.updateConfig(FRO.config);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/*******************************************************
|
|
159
|
+
* Helper Method To Determine If Dictionary Is Read Only
|
|
160
|
+
*******************************************************/
|
|
161
|
+
checkReadOnly(dictionary) {
|
|
162
|
+
return !dictionary.readOnly;
|
|
163
|
+
}
|
|
164
|
+
/***********************************************************
|
|
165
|
+
* Helper Method To Determine If Dictionary Is Internal Only
|
|
166
|
+
***********************************************************/
|
|
167
|
+
checkInternalOnly(dictionary) {
|
|
168
|
+
return !dictionary.internalOnly;
|
|
169
|
+
}
|
|
170
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DictionaryEditorComponent, deps: [{ token: i1.DictionaryService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
171
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: DictionaryEditorComponent, selector: "hci-dictionary-editor", host: { properties: { "class": "this.classList" } }, viewQueries: [{ propertyName: "sidebar", first: true, predicate: SidebarComponent, descendants: true, static: true }, { propertyName: "dictionaryTemplate", first: true, predicate: ["dictionaryTemplate"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: `
|
|
172
172
|
<hci-sidebar #sidebar></hci-sidebar>
|
|
173
173
|
|
|
174
174
|
<router-outlet></router-outlet>
|
|
@@ -180,10 +180,10 @@ class DictionaryEditorComponent {
|
|
|
180
180
|
</div>
|
|
181
181
|
</div>
|
|
182
182
|
</ng-template>
|
|
183
|
-
`, isInline: true, styles: [".active .ml-3{color:#fff!important}:host::ng-deep .format-bottom-padding{padding-bottom:10px}:host::ng-deep .active{height:30px}:host::ng-deep .search-item{height:30px;overflow:hidden;white-space:nowrap}:host::ng-deep #filterReadOnly{float:left}:host::ng-deep #filterAndSortContainer{background-color:var(--greywarm-meddark)!important;height:42px}:host::ng-deep .results-count{height:0!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: i4.SidebarComponent, selector: "hci-sidebar", inputs: ["hidden", "output", "sidebarClasses", "showCollapse", "draggable", "sidebarSplitterWidth", "collapsedSize", "minWidth", "maxWidth", "sidebarSize", "sidebarFontSize", "sidebarExpanded"], outputs: ["sidebarSizeChange"] }] }); }
|
|
184
|
-
}
|
|
185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
186
|
-
type: Component,
|
|
183
|
+
`, isInline: true, styles: [".active .ml-3{color:#fff!important}:host::ng-deep .format-bottom-padding{padding-bottom:10px}:host::ng-deep .active{height:30px}:host::ng-deep .search-item{height:30px;overflow:hidden;white-space:nowrap}:host::ng-deep #filterReadOnly{float:left}:host::ng-deep #filterAndSortContainer{background-color:var(--greywarm-meddark)!important;height:42px}:host::ng-deep .results-count{height:0!important}\n"], dependencies: [{ kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i3.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i3.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: i4.SidebarComponent, selector: "hci-sidebar", inputs: ["hidden", "output", "sidebarClasses", "showCollapse", "draggable", "sidebarSplitterWidth", "collapsedSize", "minWidth", "maxWidth", "sidebarSize", "sidebarFontSize", "sidebarExpanded"], outputs: ["sidebarSizeChange"] }] }); }
|
|
184
|
+
}
|
|
185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DictionaryEditorComponent, decorators: [{
|
|
186
|
+
type: Component,
|
|
187
187
|
args: [{ selector: "hci-dictionary-editor", template: `
|
|
188
188
|
<hci-sidebar #sidebar></hci-sidebar>
|
|
189
189
|
|
|
@@ -196,31 +196,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
196
196
|
</div>
|
|
197
197
|
</div>
|
|
198
198
|
</ng-template>
|
|
199
|
-
`, styles: [".active .ml-3{color:#fff!important}:host::ng-deep .format-bottom-padding{padding-bottom:10px}:host::ng-deep .active{height:30px}:host::ng-deep .search-item{height:30px;overflow:hidden;white-space:nowrap}:host::ng-deep #filterReadOnly{float:left}:host::ng-deep #filterAndSortContainer{background-color:var(--greywarm-meddark)!important;height:42px}:host::ng-deep .results-count{height:0!important}\n"] }]
|
|
200
|
-
}], ctorParameters:
|
|
201
|
-
type: HostBinding,
|
|
202
|
-
args: ["class"]
|
|
203
|
-
}], sidebar: [{
|
|
204
|
-
type: ViewChild,
|
|
205
|
-
args: [SidebarComponent, { static: true }]
|
|
206
|
-
}], dictionaryTemplate: [{
|
|
207
|
-
type: ViewChild,
|
|
208
|
-
args: ["dictionaryTemplate", { read: TemplateRef, static: true }]
|
|
199
|
+
`, styles: [".active .ml-3{color:#fff!important}:host::ng-deep .format-bottom-padding{padding-bottom:10px}:host::ng-deep .active{height:30px}:host::ng-deep .search-item{height:30px;overflow:hidden;white-space:nowrap}:host::ng-deep #filterReadOnly{float:left}:host::ng-deep #filterAndSortContainer{background-color:var(--greywarm-meddark)!important;height:42px}:host::ng-deep .results-count{height:0!important}\n"] }]
|
|
200
|
+
}], ctorParameters: () => [{ type: i1.DictionaryService }, { type: i0.Renderer2 }], propDecorators: { classList: [{
|
|
201
|
+
type: HostBinding,
|
|
202
|
+
args: ["class"]
|
|
203
|
+
}], sidebar: [{
|
|
204
|
+
type: ViewChild,
|
|
205
|
+
args: [SidebarComponent, { static: true }]
|
|
206
|
+
}], dictionaryTemplate: [{
|
|
207
|
+
type: ViewChild,
|
|
208
|
+
args: ["dictionaryTemplate", { read: TemplateRef, static: true }]
|
|
209
209
|
}] } });
|
|
210
210
|
|
|
211
|
-
/**
|
|
212
|
-
* Splash screen for the editor when no dictionary is selected.
|
|
213
|
-
*
|
|
214
|
-
* TODO: Use this page to put more of a guide on how to use the editor?
|
|
215
|
-
*
|
|
216
|
-
* @since 1.0.0
|
|
217
|
-
*/
|
|
218
|
-
class DictionaryEditorHomeComponent {
|
|
219
|
-
constructor() {
|
|
220
|
-
this.classList = "outlet-column y-auto";
|
|
221
|
-
}
|
|
222
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
223
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
211
|
+
/**
|
|
212
|
+
* Splash screen for the editor when no dictionary is selected.
|
|
213
|
+
*
|
|
214
|
+
* TODO: Use this page to put more of a guide on how to use the editor?
|
|
215
|
+
*
|
|
216
|
+
* @since 1.0.0
|
|
217
|
+
*/
|
|
218
|
+
class DictionaryEditorHomeComponent {
|
|
219
|
+
constructor() {
|
|
220
|
+
this.classList = "outlet-column y-auto";
|
|
221
|
+
}
|
|
222
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DictionaryEditorHomeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
223
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: DictionaryEditorHomeComponent, selector: "core-dictionary-editor-home", host: { properties: { "class": "this.classList" } }, ngImport: i0, template: `
|
|
224
224
|
<div class="d-flex m-3 flex-column flex-grow">
|
|
225
225
|
<h4>Dictionary Editor</h4>
|
|
226
226
|
|
|
@@ -228,12 +228,12 @@ class DictionaryEditorHomeComponent {
|
|
|
228
228
|
Select a dictionary from the sidebar to view its properties and data.
|
|
229
229
|
</div>
|
|
230
230
|
</div>
|
|
231
|
-
`, isInline: true }); }
|
|
232
|
-
}
|
|
233
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
234
|
-
type: Component,
|
|
235
|
-
args: [{
|
|
236
|
-
selector: "core-dictionary-editor-home",
|
|
231
|
+
`, isInline: true }); }
|
|
232
|
+
}
|
|
233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DictionaryEditorHomeComponent, decorators: [{
|
|
234
|
+
type: Component,
|
|
235
|
+
args: [{
|
|
236
|
+
selector: "core-dictionary-editor-home",
|
|
237
237
|
template: `
|
|
238
238
|
<div class="d-flex m-3 flex-column flex-grow">
|
|
239
239
|
<h4>Dictionary Editor</h4>
|
|
@@ -242,442 +242,442 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
242
242
|
Select a dictionary from the sidebar to view its properties and data.
|
|
243
243
|
</div>
|
|
244
244
|
</div>
|
|
245
|
-
`
|
|
246
|
-
}]
|
|
247
|
-
}], propDecorators: { classList: [{
|
|
248
|
-
type: HostBinding,
|
|
249
|
-
args: ["class"]
|
|
245
|
+
`
|
|
246
|
+
}]
|
|
247
|
+
}], propDecorators: { classList: [{
|
|
248
|
+
type: HostBinding,
|
|
249
|
+
args: ["class"]
|
|
250
250
|
}] } });
|
|
251
251
|
|
|
252
|
-
/**
|
|
253
|
-
* This class' purpose is to place FormControls on cells in the grid, and to link them by rows, and rows to the grid as a whole.
|
|
254
|
-
* It allows you to add validators for a cells' value and link an error type to an error message to display in a tooltip, or
|
|
255
|
-
* you can provide a function to test some information about the row and provide an error message.
|
|
256
|
-
*
|
|
257
|
-
* The class works off of a number of properties added to the columnDefs in the ag-grid.
|
|
258
|
-
*
|
|
259
|
-
* We are looking for the following properties:
|
|
260
|
-
* 1. errorMessageHeader : a string to display at the top of the list of any errors found for the cell
|
|
261
|
-
* 2. validators : an array of angular validators to describe the cell value
|
|
262
|
-
* 3. errorNameErrorMessageMap : an array of objects with "errorName"s and "errorMessage"s that are used to create a displayed list for the user
|
|
263
|
-
* 4. setErrors: a function with the signature:
|
|
264
|
-
* (value: any, data: any, node: any, colDef: any, rowIndex: any, gridApi: any) => string
|
|
265
|
-
* which is called to generate a custom error message, if needed. An empty or null string
|
|
266
|
-
* is treated as not being an error.
|
|
267
|
-
*
|
|
268
|
-
* Example column definition:
|
|
269
|
-
* {
|
|
270
|
-
* headerName: "Name",
|
|
271
|
-
* editable: false,
|
|
272
|
-
* width: 600,
|
|
273
|
-
* cellRendererFramework: TextAlignLeftMiddleRenderer,
|
|
274
|
-
* setErrors: (value: any,
|
|
275
|
-
* data: any,
|
|
276
|
-
* node: any,
|
|
277
|
-
* colDef: any,
|
|
278
|
-
* rowIndex: any,
|
|
279
|
-
* gridApi: any) => {
|
|
280
|
-
* return (value && value === 'TEST') ? 'Invalid name' : '';
|
|
281
|
-
* },
|
|
282
|
-
* validators: [ Validators.minLength(10) ],
|
|
283
|
-
* errorMessageHeader: 'TestingTestingTesting',
|
|
284
|
-
* errorNameErrorMessageMap: [
|
|
285
|
-
* { errorName: 'minlength', errorMessage: 'Name is too short' }
|
|
286
|
-
* ],
|
|
287
|
-
* field: "name"
|
|
288
|
-
* }
|
|
289
|
-
*
|
|
290
|
-
* To use with a new renderer, extend this class, do not override agInit, or call super.agInit(params) first.
|
|
291
|
-
* (You can use agInit2 instead, called right after agInit).
|
|
292
|
-
*
|
|
293
|
-
* To display a tooltip with the error messages, include an element with a matTooltip pointing to this.errorMessage, like:
|
|
294
|
-
* <div [matTooltip]="this.errorMessage" [matTooltipShowDelay]="300" [matTooltipHideDelay]="300" ...
|
|
295
|
-
* For cell highlighting, you can add a CSS class something like :
|
|
296
|
-
* .error {
|
|
297
|
-
* background: linear-gradient(rgba(255,0,0,0.25), rgba(255,0,0,0.25), rgba(255,0,0,0.25));
|
|
298
|
-
* border: solid red 2px;
|
|
299
|
-
* }
|
|
300
|
-
* and a conditional class on an element in the template, like :
|
|
301
|
-
* class="{{this.errorMessage && this.errorMessage !== '' ? 'error' : ''}}"
|
|
302
|
-
*/
|
|
303
|
-
class CellRendererValidation {
|
|
304
|
-
constructor() {
|
|
305
|
-
this.errorMessage = "";
|
|
306
|
-
}
|
|
307
|
-
agInit(params) {
|
|
308
|
-
this.params = params;
|
|
309
|
-
this.formBuilder = new UntypedFormBuilder();
|
|
310
|
-
if (this.params
|
|
311
|
-
&& this.params.node
|
|
312
|
-
&& this.params.node.gridApi
|
|
313
|
-
&& this.params.node.gridApi.formGroup === undefined) {
|
|
314
|
-
let foundDelayValidationProperty = false;
|
|
315
|
-
for (let columnDef of params.node.gridApi.columnController.columnDefs) {
|
|
316
|
-
if (columnDef.delayValidation && columnDef.delayValidation === true) {
|
|
317
|
-
foundDelayValidationProperty = true;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
if (!foundDelayValidationProperty) {
|
|
321
|
-
this.determineIfAllRowsNeedValidationInAdvance();
|
|
322
|
-
this.createAllFormControls();
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
this.getErrorMessage();
|
|
326
|
-
this.agInit2(params);
|
|
327
|
-
}
|
|
328
|
-
refresh(params) {
|
|
329
|
-
return false;
|
|
330
|
-
}
|
|
331
|
-
// This function iterates over every cell in the grid and prepares all their needed formGroups and formControls.
|
|
332
|
-
//
|
|
333
|
-
// This was done this way (in the cell renderer) for three reasons :
|
|
334
|
-
// 1. We need to wait until the column and row data have been provided to the grid
|
|
335
|
-
// 2. We don't want the programmer to have to implement it themselves every time they create a grid
|
|
336
|
-
// 3. The grid does not create all the cell renderers in advance, just those that fit on the screen
|
|
337
|
-
// (plus a few nearby) meaning we can't just use the cell renderer's constructor, since we don't
|
|
338
|
-
// know if the information we start with is valid on every screen, and because we have some calls
|
|
339
|
-
// that send back the entire grid's worth of data.
|
|
340
|
-
//
|
|
341
|
-
// There may be a better way to do this, in which case this should probably be replaced!
|
|
342
|
-
createAllFormControls() {
|
|
343
|
-
if (this.params
|
|
344
|
-
&& this.params.column
|
|
345
|
-
&& this.params.column.colDef
|
|
346
|
-
&& this.params.data
|
|
347
|
-
&& this.params.node
|
|
348
|
-
&& this.params.node.gridApi
|
|
349
|
-
&& this.params.node.gridApi.getModel()) {
|
|
350
|
-
if (this.params.node.gridApi.gridOptionsWrapper
|
|
351
|
-
&& this.params.node.gridApi.gridOptionsWrapper.gridOptions
|
|
352
|
-
&& !this.params.node.gridApi.gridOptionsWrapper.gridOptions._eventsChangedByCellRendererValidation) {
|
|
353
|
-
this.changeGridOptionsEvents();
|
|
354
|
-
this.params.node.gridApi.gridOptionsWrapper.gridOptions._eventsChangedByCellRendererValidation = true;
|
|
355
|
-
}
|
|
356
|
-
let allNodes = [];
|
|
357
|
-
if (this.params.node.gridApi.mode_needToValidateOnlyRenderedCells) {
|
|
358
|
-
allNodes = this.params.node.gridApi.getRenderedNodes();
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
allNodes = this.params.node.gridApi.getModel().rowsToDisplay;
|
|
362
|
-
}
|
|
363
|
-
if (!this.params.node.gridApi.formGroup
|
|
364
|
-
|| (this.params.node.gridApi.formGroup
|
|
365
|
-
&& this.params.node.gridApi.formGroup.controls
|
|
366
|
-
&& this.params.node.gridApi.formGroup.controls.length != allNodes.length)) {
|
|
367
|
-
this.params.node.gridApi.formGroup = new UntypedFormGroup({});
|
|
368
|
-
}
|
|
369
|
-
if (this.params.node.gridApi.columnController
|
|
370
|
-
&& this.params.node.gridApi.columnController.columnDefs) {
|
|
371
|
-
for (let columnDef of this.params.node.gridApi.columnController.columnDefs) {
|
|
372
|
-
if (columnDef.outerForm && columnDef.formName) {
|
|
373
|
-
if (!columnDef.outerForm.get(columnDef.formName)) {
|
|
374
|
-
columnDef.outerForm.addControl(columnDef.formName, this.params.node.gridApi.formGroup);
|
|
375
|
-
}
|
|
376
|
-
else {
|
|
377
|
-
columnDef.outerForm.setControl(columnDef.formName, this.params.node.gridApi.formGroup);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
let columns;
|
|
383
|
-
if (this.params && this.params.columnApi && this.params.columnApi.columnController) {
|
|
384
|
-
columns = this.params.columnApi.columnController.gridColumns.filter((column) => {
|
|
385
|
-
return column.colDef
|
|
386
|
-
&& column.colDef.field
|
|
387
|
-
&& (column.colDef.validators || column.colDef.setErrors);
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
for (let node of allNodes) {
|
|
391
|
-
for (let column of columns) {
|
|
392
|
-
if (column.colDef
|
|
393
|
-
&& column.colDef.field
|
|
394
|
-
&& (column.colDef.validators || column.colDef.setErrors)) {
|
|
395
|
-
node[column.colDef.field + "_errorMessage"] = '';
|
|
396
|
-
let formControl = new UntypedFormControl(column.colDef.field + '_formControl', []);
|
|
397
|
-
if (!node.formGroup) {
|
|
398
|
-
node.formGroup = new UntypedFormGroup({});
|
|
399
|
-
}
|
|
400
|
-
node.formGroup.addControl(column.colDef.field + '_formControl', formControl);
|
|
401
|
-
if (!Array.isArray(column.colDef.validators)) {
|
|
402
|
-
column.colDef.validators = [column.colDef.validators];
|
|
403
|
-
}
|
|
404
|
-
formControl.setValidators(column.colDef.validators);
|
|
405
|
-
this.updateErrorMessage(formControl, node, column.colDef);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
if (!this.params.node.gridApi.formGroup.contains('RowGroup_' + node.rowIndex)) {
|
|
409
|
-
if (!node.formGroup) {
|
|
410
|
-
node.formGroup = new UntypedFormGroup({});
|
|
411
|
-
}
|
|
412
|
-
this.params.node.gridApi.formGroup.addControl('RowGroup_' + node.rowIndex, node.formGroup);
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
changeGridOptionsEvents() {
|
|
418
|
-
if (!this.params
|
|
419
|
-
|| !this.params.node
|
|
420
|
-
|| !this.params.node.gridApi
|
|
421
|
-
|| !this.params.node.gridApi.gridOptionsWrapper
|
|
422
|
-
|| !this.params.node.gridApi.gridOptionsWrapper.gridOptions) {
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
if (this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged) {
|
|
426
|
-
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged2 = this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged;
|
|
427
|
-
}
|
|
428
|
-
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged = ((event) => {
|
|
429
|
-
this.createAllFormControls();
|
|
430
|
-
this.fetchErrorMessagesForCurrentlyRenderedCells();
|
|
431
|
-
if (this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged2) {
|
|
432
|
-
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged2(event);
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
if (this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged) {
|
|
436
|
-
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged2 = this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged;
|
|
437
|
-
}
|
|
438
|
-
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged = ((event) => {
|
|
439
|
-
this.determineIfAllRowsNeedValidationInAdvance();
|
|
440
|
-
this.createAllFormControls();
|
|
441
|
-
this.fetchErrorMessagesForCurrentlyRenderedCells();
|
|
442
|
-
if (this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged2) {
|
|
443
|
-
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged2(event);
|
|
444
|
-
}
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
getErrorMessage() {
|
|
448
|
-
if (this.params
|
|
449
|
-
&& this.params.node
|
|
450
|
-
&& this.params.node.formGroup
|
|
451
|
-
&& this.params.column
|
|
452
|
-
&& this.params.column.colDef
|
|
453
|
-
&& this.params.column.colDef.field) {
|
|
454
|
-
let formControl = this.params.node.formGroup.get(this.params.column.colDef.field + '_formControl');
|
|
455
|
-
this.updateErrorMessage(formControl, this.params.node, this.params.column.colDef);
|
|
456
|
-
this.errorMessage = this.params.node[this.params.column.colDef.field + "_errorMessage"];
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
refreshFormControlValue(formControl, data, fieldName) {
|
|
460
|
-
if (formControl && data && fieldName && data[fieldName] !== undefined) {
|
|
461
|
-
formControl.setValue(data[fieldName]);
|
|
462
|
-
formControl.updateValueAndValidity();
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
updateErrorMessage(formControl, node, columnDefinition) {
|
|
466
|
-
if (!formControl || !node || !columnDefinition) {
|
|
467
|
-
return '';
|
|
468
|
-
}
|
|
469
|
-
let customErrorMessage = '';
|
|
470
|
-
if (columnDefinition.setErrors) {
|
|
471
|
-
customErrorMessage = columnDefinition.setErrors(node.data[columnDefinition.field], node.data, node, columnDefinition, node.rowIndex, node.gridApi);
|
|
472
|
-
}
|
|
473
|
-
let errorMessageName = columnDefinition.field + "_errorMessage";
|
|
474
|
-
this.refreshFormControlValue(formControl, node.data, columnDefinition.field);
|
|
475
|
-
node[errorMessageName] = '';
|
|
476
|
-
if (formControl.invalid || (customErrorMessage && customErrorMessage !== '')) {
|
|
477
|
-
if (columnDefinition.errorMessageHeader) {
|
|
478
|
-
node[errorMessageName] += '' + columnDefinition.errorMessageHeader + '\n';
|
|
479
|
-
}
|
|
480
|
-
else {
|
|
481
|
-
node[errorMessageName] +=
|
|
482
|
-
'Invalid value "' + node.data[columnDefinition.field] + '" for field (' + columnDefinition.field + ')\n';
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
if (columnDefinition.errorNameErrorMessageMap) {
|
|
486
|
-
if (!Array.isArray(columnDefinition.errorNameErrorMessageMap)) {
|
|
487
|
-
columnDefinition.errorNameErrorMessageMap = [columnDefinition.errorNameErrorMessageMap];
|
|
488
|
-
}
|
|
489
|
-
for (let errorNameErrorMessagePair of columnDefinition.errorNameErrorMessageMap) {
|
|
490
|
-
if (!!errorNameErrorMessagePair.errorName && !!errorNameErrorMessagePair.errorMessage) {
|
|
491
|
-
if (formControl.hasError(errorNameErrorMessagePair.errorName)) {
|
|
492
|
-
node[errorMessageName] += errorNameErrorMessagePair.errorMessage + '\n';
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
node[errorMessageName] += customErrorMessage;
|
|
498
|
-
return node[errorMessageName];
|
|
499
|
-
}
|
|
500
|
-
determineIfAllRowsNeedValidationInAdvance() {
|
|
501
|
-
if (this.params
|
|
502
|
-
&& this.params.node
|
|
503
|
-
&& this.params.node.gridApi
|
|
504
|
-
&& this.params.columnApi
|
|
505
|
-
&& this.params.columnApi.columnController
|
|
506
|
-
&& this.params.columnApi.columnController.gridColumns) {
|
|
507
|
-
let columns = this.params.columnApi.columnController.gridColumns.filter((column) => {
|
|
508
|
-
return column.colDef
|
|
509
|
-
&& column.colDef.field
|
|
510
|
-
&& (column.colDef.validators || column.colDef.setErrors)
|
|
511
|
-
&& column.colDef.editable === true
|
|
512
|
-
&& !(column.colDef.validateOnlyRenderedCells
|
|
513
|
-
&& column.colDef.validateOnlyRenderedCells === true);
|
|
514
|
-
});
|
|
515
|
-
this.params.node.gridApi.mode_needToValidateOnlyRenderedCells = Array.isArray(columns) && columns.length === 0;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
fetchErrorMessagesForCurrentlyRenderedCells() {
|
|
519
|
-
if (this.params
|
|
520
|
-
&& this.params.node
|
|
521
|
-
&& this.params.node.gridApi) {
|
|
522
|
-
let getCellRendererParams = { rowNodes: this.params.node.gridApi.getRenderedNodes() };
|
|
523
|
-
for (let cellRenderer of this.params.node.gridApi.getCellRendererInstances(getCellRendererParams)) {
|
|
524
|
-
if (cellRenderer._agAwareComponent && cellRenderer._agAwareComponent.getErrorMessage) {
|
|
525
|
-
cellRenderer._agAwareComponent.getErrorMessage();
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
updateValidation() {
|
|
531
|
-
console.log("Successfully reached!");
|
|
532
|
-
// add this form control
|
|
533
|
-
let columns = this.params.columnApi.columnController.gridColumns.filter((column) => {
|
|
534
|
-
return column.colDef
|
|
535
|
-
&& column.colDef.field
|
|
536
|
-
&& (column.colDef.validators || column.colDef.setErrors)
|
|
537
|
-
&& column.colDef.field === this.params.field;
|
|
538
|
-
});
|
|
539
|
-
if (this.params.colDef
|
|
540
|
-
&& this.params.colDef.field
|
|
541
|
-
&& (this.params.colDef.validators || this.params.colDef.setErrors)) {
|
|
542
|
-
this.params.node[this.params.colDef.field + "_errorMessage"] = '';
|
|
543
|
-
let formControl = new UntypedFormControl(this.params.colDef.field + '_formControl', []);
|
|
544
|
-
if (!this.params.node.formGroup) {
|
|
545
|
-
this.params.node.formGroup = new UntypedFormGroup({});
|
|
546
|
-
if (!this.params.node.gridApi.formGroup) {
|
|
547
|
-
this.params.node.gridApi.formGroup = new UntypedFormGroup({});
|
|
548
|
-
}
|
|
549
|
-
else {
|
|
550
|
-
// check for any removed nodes & remove their validators if needed.
|
|
551
|
-
for (let controlName of Object.keys(this.params.node.gridApi.formGroup.controls)) {
|
|
552
|
-
if (('' + controlName).toLowerCase().substr(0, 9) === 'rowgroup_') {
|
|
553
|
-
let found = false;
|
|
554
|
-
for (let node of this.params.node.gridApi.getModel().rowsToDisplay) {
|
|
555
|
-
if (('' + node.rowIndex) === ('' + controlName).substr(9)) {
|
|
556
|
-
found = true;
|
|
557
|
-
break;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
if (!found) {
|
|
561
|
-
this.params.node.gridApi.formGroup.removeControl(controlName);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
this.params.node.gridApi.formGroup.addControl('RowGroup_' + this.params.node.rowIndex, this.params.node.formGroup);
|
|
567
|
-
}
|
|
568
|
-
if (!this.params.node.formGroup.controls[this.params.colDef.field + '_formControl']) {
|
|
569
|
-
this.params.node.formGroup.addControl(this.params.colDef.field + '_formControl', formControl);
|
|
570
|
-
if (Array.isArray(this.params.colDef.validators)) {
|
|
571
|
-
this.params.node.formGroup.controls[this.params.colDef.field + '_formControl'].setValidators(this.params.colDef.validators);
|
|
572
|
-
}
|
|
573
|
-
if (this.params.node.gridApi.columnController
|
|
574
|
-
&& this.params.node.gridApi.columnController.columnDefs) {
|
|
575
|
-
for (let columnDef of this.params.node.gridApi.columnController.columnDefs) {
|
|
576
|
-
if (columnDef.outerForm && columnDef.formName) {
|
|
577
|
-
if (!columnDef.outerForm.get(columnDef.formName)) {
|
|
578
|
-
columnDef.outerForm.addControl(columnDef.formName, this.params.node.gridApi.formGroup);
|
|
579
|
-
}
|
|
580
|
-
else {
|
|
581
|
-
columnDef.outerForm.setControl(columnDef.formName, this.params.node.gridApi.formGroup);
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
this.updateErrorMessage(formControl, this.params.node, this.params.colDef);
|
|
588
|
-
}
|
|
589
|
-
// add column control groups if needed
|
|
590
|
-
// add row control groups if needed
|
|
591
|
-
// setup grid control group if needed
|
|
592
|
-
// Might need to trigger cell validation to run with the new validation.
|
|
593
|
-
}
|
|
252
|
+
/**
|
|
253
|
+
* This class' purpose is to place FormControls on cells in the grid, and to link them by rows, and rows to the grid as a whole.
|
|
254
|
+
* It allows you to add validators for a cells' value and link an error type to an error message to display in a tooltip, or
|
|
255
|
+
* you can provide a function to test some information about the row and provide an error message.
|
|
256
|
+
*
|
|
257
|
+
* The class works off of a number of properties added to the columnDefs in the ag-grid.
|
|
258
|
+
*
|
|
259
|
+
* We are looking for the following properties:
|
|
260
|
+
* 1. errorMessageHeader : a string to display at the top of the list of any errors found for the cell
|
|
261
|
+
* 2. validators : an array of angular validators to describe the cell value
|
|
262
|
+
* 3. errorNameErrorMessageMap : an array of objects with "errorName"s and "errorMessage"s that are used to create a displayed list for the user
|
|
263
|
+
* 4. setErrors: a function with the signature:
|
|
264
|
+
* (value: any, data: any, node: any, colDef: any, rowIndex: any, gridApi: any) => string
|
|
265
|
+
* which is called to generate a custom error message, if needed. An empty or null string
|
|
266
|
+
* is treated as not being an error.
|
|
267
|
+
*
|
|
268
|
+
* Example column definition:
|
|
269
|
+
* {
|
|
270
|
+
* headerName: "Name",
|
|
271
|
+
* editable: false,
|
|
272
|
+
* width: 600,
|
|
273
|
+
* cellRendererFramework: TextAlignLeftMiddleRenderer,
|
|
274
|
+
* setErrors: (value: any,
|
|
275
|
+
* data: any,
|
|
276
|
+
* node: any,
|
|
277
|
+
* colDef: any,
|
|
278
|
+
* rowIndex: any,
|
|
279
|
+
* gridApi: any) => {
|
|
280
|
+
* return (value && value === 'TEST') ? 'Invalid name' : '';
|
|
281
|
+
* },
|
|
282
|
+
* validators: [ Validators.minLength(10) ],
|
|
283
|
+
* errorMessageHeader: 'TestingTestingTesting',
|
|
284
|
+
* errorNameErrorMessageMap: [
|
|
285
|
+
* { errorName: 'minlength', errorMessage: 'Name is too short' }
|
|
286
|
+
* ],
|
|
287
|
+
* field: "name"
|
|
288
|
+
* }
|
|
289
|
+
*
|
|
290
|
+
* To use with a new renderer, extend this class, do not override agInit, or call super.agInit(params) first.
|
|
291
|
+
* (You can use agInit2 instead, called right after agInit).
|
|
292
|
+
*
|
|
293
|
+
* To display a tooltip with the error messages, include an element with a matTooltip pointing to this.errorMessage, like:
|
|
294
|
+
* <div [matTooltip]="this.errorMessage" [matTooltipShowDelay]="300" [matTooltipHideDelay]="300" ...
|
|
295
|
+
* For cell highlighting, you can add a CSS class something like :
|
|
296
|
+
* .error {
|
|
297
|
+
* background: linear-gradient(rgba(255,0,0,0.25), rgba(255,0,0,0.25), rgba(255,0,0,0.25));
|
|
298
|
+
* border: solid red 2px;
|
|
299
|
+
* }
|
|
300
|
+
* and a conditional class on an element in the template, like :
|
|
301
|
+
* class="{{this.errorMessage && this.errorMessage !== '' ? 'error' : ''}}"
|
|
302
|
+
*/
|
|
303
|
+
class CellRendererValidation {
|
|
304
|
+
constructor() {
|
|
305
|
+
this.errorMessage = "";
|
|
306
|
+
}
|
|
307
|
+
agInit(params) {
|
|
308
|
+
this.params = params;
|
|
309
|
+
this.formBuilder = new UntypedFormBuilder();
|
|
310
|
+
if (this.params
|
|
311
|
+
&& this.params.node
|
|
312
|
+
&& this.params.node.gridApi
|
|
313
|
+
&& this.params.node.gridApi.formGroup === undefined) {
|
|
314
|
+
let foundDelayValidationProperty = false;
|
|
315
|
+
for (let columnDef of params.node.gridApi.columnController.columnDefs) {
|
|
316
|
+
if (columnDef.delayValidation && columnDef.delayValidation === true) {
|
|
317
|
+
foundDelayValidationProperty = true;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
if (!foundDelayValidationProperty) {
|
|
321
|
+
this.determineIfAllRowsNeedValidationInAdvance();
|
|
322
|
+
this.createAllFormControls();
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
this.getErrorMessage();
|
|
326
|
+
this.agInit2(params);
|
|
327
|
+
}
|
|
328
|
+
refresh(params) {
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
// This function iterates over every cell in the grid and prepares all their needed formGroups and formControls.
|
|
332
|
+
//
|
|
333
|
+
// This was done this way (in the cell renderer) for three reasons :
|
|
334
|
+
// 1. We need to wait until the column and row data have been provided to the grid
|
|
335
|
+
// 2. We don't want the programmer to have to implement it themselves every time they create a grid
|
|
336
|
+
// 3. The grid does not create all the cell renderers in advance, just those that fit on the screen
|
|
337
|
+
// (plus a few nearby) meaning we can't just use the cell renderer's constructor, since we don't
|
|
338
|
+
// know if the information we start with is valid on every screen, and because we have some calls
|
|
339
|
+
// that send back the entire grid's worth of data.
|
|
340
|
+
//
|
|
341
|
+
// There may be a better way to do this, in which case this should probably be replaced!
|
|
342
|
+
createAllFormControls() {
|
|
343
|
+
if (this.params
|
|
344
|
+
&& this.params.column
|
|
345
|
+
&& this.params.column.colDef
|
|
346
|
+
&& this.params.data
|
|
347
|
+
&& this.params.node
|
|
348
|
+
&& this.params.node.gridApi
|
|
349
|
+
&& this.params.node.gridApi.getModel()) {
|
|
350
|
+
if (this.params.node.gridApi.gridOptionsWrapper
|
|
351
|
+
&& this.params.node.gridApi.gridOptionsWrapper.gridOptions
|
|
352
|
+
&& !this.params.node.gridApi.gridOptionsWrapper.gridOptions._eventsChangedByCellRendererValidation) {
|
|
353
|
+
this.changeGridOptionsEvents();
|
|
354
|
+
this.params.node.gridApi.gridOptionsWrapper.gridOptions._eventsChangedByCellRendererValidation = true;
|
|
355
|
+
}
|
|
356
|
+
let allNodes = [];
|
|
357
|
+
if (this.params.node.gridApi.mode_needToValidateOnlyRenderedCells) {
|
|
358
|
+
allNodes = this.params.node.gridApi.getRenderedNodes();
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
allNodes = this.params.node.gridApi.getModel().rowsToDisplay;
|
|
362
|
+
}
|
|
363
|
+
if (!this.params.node.gridApi.formGroup
|
|
364
|
+
|| (this.params.node.gridApi.formGroup
|
|
365
|
+
&& this.params.node.gridApi.formGroup.controls
|
|
366
|
+
&& this.params.node.gridApi.formGroup.controls.length != allNodes.length)) {
|
|
367
|
+
this.params.node.gridApi.formGroup = new UntypedFormGroup({});
|
|
368
|
+
}
|
|
369
|
+
if (this.params.node.gridApi.columnController
|
|
370
|
+
&& this.params.node.gridApi.columnController.columnDefs) {
|
|
371
|
+
for (let columnDef of this.params.node.gridApi.columnController.columnDefs) {
|
|
372
|
+
if (columnDef.outerForm && columnDef.formName) {
|
|
373
|
+
if (!columnDef.outerForm.get(columnDef.formName)) {
|
|
374
|
+
columnDef.outerForm.addControl(columnDef.formName, this.params.node.gridApi.formGroup);
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
columnDef.outerForm.setControl(columnDef.formName, this.params.node.gridApi.formGroup);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
let columns;
|
|
383
|
+
if (this.params && this.params.columnApi && this.params.columnApi.columnController) {
|
|
384
|
+
columns = this.params.columnApi.columnController.gridColumns.filter((column) => {
|
|
385
|
+
return column.colDef
|
|
386
|
+
&& column.colDef.field
|
|
387
|
+
&& (column.colDef.validators || column.colDef.setErrors);
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
for (let node of allNodes) {
|
|
391
|
+
for (let column of columns) {
|
|
392
|
+
if (column.colDef
|
|
393
|
+
&& column.colDef.field
|
|
394
|
+
&& (column.colDef.validators || column.colDef.setErrors)) {
|
|
395
|
+
node[column.colDef.field + "_errorMessage"] = '';
|
|
396
|
+
let formControl = new UntypedFormControl(column.colDef.field + '_formControl', []);
|
|
397
|
+
if (!node.formGroup) {
|
|
398
|
+
node.formGroup = new UntypedFormGroup({});
|
|
399
|
+
}
|
|
400
|
+
node.formGroup.addControl(column.colDef.field + '_formControl', formControl);
|
|
401
|
+
if (!Array.isArray(column.colDef.validators)) {
|
|
402
|
+
column.colDef.validators = [column.colDef.validators];
|
|
403
|
+
}
|
|
404
|
+
formControl.setValidators(column.colDef.validators);
|
|
405
|
+
this.updateErrorMessage(formControl, node, column.colDef);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
if (!this.params.node.gridApi.formGroup.contains('RowGroup_' + node.rowIndex)) {
|
|
409
|
+
if (!node.formGroup) {
|
|
410
|
+
node.formGroup = new UntypedFormGroup({});
|
|
411
|
+
}
|
|
412
|
+
this.params.node.gridApi.formGroup.addControl('RowGroup_' + node.rowIndex, node.formGroup);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
changeGridOptionsEvents() {
|
|
418
|
+
if (!this.params
|
|
419
|
+
|| !this.params.node
|
|
420
|
+
|| !this.params.node.gridApi
|
|
421
|
+
|| !this.params.node.gridApi.gridOptionsWrapper
|
|
422
|
+
|| !this.params.node.gridApi.gridOptionsWrapper.gridOptions) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
if (this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged) {
|
|
426
|
+
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged2 = this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged;
|
|
427
|
+
}
|
|
428
|
+
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged = ((event) => {
|
|
429
|
+
this.createAllFormControls();
|
|
430
|
+
this.fetchErrorMessagesForCurrentlyRenderedCells();
|
|
431
|
+
if (this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged2) {
|
|
432
|
+
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onRowDataChanged2(event);
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
if (this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged) {
|
|
436
|
+
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged2 = this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged;
|
|
437
|
+
}
|
|
438
|
+
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged = ((event) => {
|
|
439
|
+
this.determineIfAllRowsNeedValidationInAdvance();
|
|
440
|
+
this.createAllFormControls();
|
|
441
|
+
this.fetchErrorMessagesForCurrentlyRenderedCells();
|
|
442
|
+
if (this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged2) {
|
|
443
|
+
this.params.node.gridApi.gridOptionsWrapper.gridOptions.onGridColumnsChanged2(event);
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
getErrorMessage() {
|
|
448
|
+
if (this.params
|
|
449
|
+
&& this.params.node
|
|
450
|
+
&& this.params.node.formGroup
|
|
451
|
+
&& this.params.column
|
|
452
|
+
&& this.params.column.colDef
|
|
453
|
+
&& this.params.column.colDef.field) {
|
|
454
|
+
let formControl = this.params.node.formGroup.get(this.params.column.colDef.field + '_formControl');
|
|
455
|
+
this.updateErrorMessage(formControl, this.params.node, this.params.column.colDef);
|
|
456
|
+
this.errorMessage = this.params.node[this.params.column.colDef.field + "_errorMessage"];
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
refreshFormControlValue(formControl, data, fieldName) {
|
|
460
|
+
if (formControl && data && fieldName && data[fieldName] !== undefined) {
|
|
461
|
+
formControl.setValue(data[fieldName]);
|
|
462
|
+
formControl.updateValueAndValidity();
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
updateErrorMessage(formControl, node, columnDefinition) {
|
|
466
|
+
if (!formControl || !node || !columnDefinition) {
|
|
467
|
+
return '';
|
|
468
|
+
}
|
|
469
|
+
let customErrorMessage = '';
|
|
470
|
+
if (columnDefinition.setErrors) {
|
|
471
|
+
customErrorMessage = columnDefinition.setErrors(node.data[columnDefinition.field], node.data, node, columnDefinition, node.rowIndex, node.gridApi);
|
|
472
|
+
}
|
|
473
|
+
let errorMessageName = columnDefinition.field + "_errorMessage";
|
|
474
|
+
this.refreshFormControlValue(formControl, node.data, columnDefinition.field);
|
|
475
|
+
node[errorMessageName] = '';
|
|
476
|
+
if (formControl.invalid || (customErrorMessage && customErrorMessage !== '')) {
|
|
477
|
+
if (columnDefinition.errorMessageHeader) {
|
|
478
|
+
node[errorMessageName] += '' + columnDefinition.errorMessageHeader + '\n';
|
|
479
|
+
}
|
|
480
|
+
else {
|
|
481
|
+
node[errorMessageName] +=
|
|
482
|
+
'Invalid value "' + node.data[columnDefinition.field] + '" for field (' + columnDefinition.field + ')\n';
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
if (columnDefinition.errorNameErrorMessageMap) {
|
|
486
|
+
if (!Array.isArray(columnDefinition.errorNameErrorMessageMap)) {
|
|
487
|
+
columnDefinition.errorNameErrorMessageMap = [columnDefinition.errorNameErrorMessageMap];
|
|
488
|
+
}
|
|
489
|
+
for (let errorNameErrorMessagePair of columnDefinition.errorNameErrorMessageMap) {
|
|
490
|
+
if (!!errorNameErrorMessagePair.errorName && !!errorNameErrorMessagePair.errorMessage) {
|
|
491
|
+
if (formControl.hasError(errorNameErrorMessagePair.errorName)) {
|
|
492
|
+
node[errorMessageName] += errorNameErrorMessagePair.errorMessage + '\n';
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
node[errorMessageName] += customErrorMessage;
|
|
498
|
+
return node[errorMessageName];
|
|
499
|
+
}
|
|
500
|
+
determineIfAllRowsNeedValidationInAdvance() {
|
|
501
|
+
if (this.params
|
|
502
|
+
&& this.params.node
|
|
503
|
+
&& this.params.node.gridApi
|
|
504
|
+
&& this.params.columnApi
|
|
505
|
+
&& this.params.columnApi.columnController
|
|
506
|
+
&& this.params.columnApi.columnController.gridColumns) {
|
|
507
|
+
let columns = this.params.columnApi.columnController.gridColumns.filter((column) => {
|
|
508
|
+
return column.colDef
|
|
509
|
+
&& column.colDef.field
|
|
510
|
+
&& (column.colDef.validators || column.colDef.setErrors)
|
|
511
|
+
&& column.colDef.editable === true
|
|
512
|
+
&& !(column.colDef.validateOnlyRenderedCells
|
|
513
|
+
&& column.colDef.validateOnlyRenderedCells === true);
|
|
514
|
+
});
|
|
515
|
+
this.params.node.gridApi.mode_needToValidateOnlyRenderedCells = Array.isArray(columns) && columns.length === 0;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
fetchErrorMessagesForCurrentlyRenderedCells() {
|
|
519
|
+
if (this.params
|
|
520
|
+
&& this.params.node
|
|
521
|
+
&& this.params.node.gridApi) {
|
|
522
|
+
let getCellRendererParams = { rowNodes: this.params.node.gridApi.getRenderedNodes() };
|
|
523
|
+
for (let cellRenderer of this.params.node.gridApi.getCellRendererInstances(getCellRendererParams)) {
|
|
524
|
+
if (cellRenderer._agAwareComponent && cellRenderer._agAwareComponent.getErrorMessage) {
|
|
525
|
+
cellRenderer._agAwareComponent.getErrorMessage();
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
updateValidation() {
|
|
531
|
+
console.log("Successfully reached!");
|
|
532
|
+
// add this form control
|
|
533
|
+
let columns = this.params.columnApi.columnController.gridColumns.filter((column) => {
|
|
534
|
+
return column.colDef
|
|
535
|
+
&& column.colDef.field
|
|
536
|
+
&& (column.colDef.validators || column.colDef.setErrors)
|
|
537
|
+
&& column.colDef.field === this.params.field;
|
|
538
|
+
});
|
|
539
|
+
if (this.params.colDef
|
|
540
|
+
&& this.params.colDef.field
|
|
541
|
+
&& (this.params.colDef.validators || this.params.colDef.setErrors)) {
|
|
542
|
+
this.params.node[this.params.colDef.field + "_errorMessage"] = '';
|
|
543
|
+
let formControl = new UntypedFormControl(this.params.colDef.field + '_formControl', []);
|
|
544
|
+
if (!this.params.node.formGroup) {
|
|
545
|
+
this.params.node.formGroup = new UntypedFormGroup({});
|
|
546
|
+
if (!this.params.node.gridApi.formGroup) {
|
|
547
|
+
this.params.node.gridApi.formGroup = new UntypedFormGroup({});
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
// check for any removed nodes & remove their validators if needed.
|
|
551
|
+
for (let controlName of Object.keys(this.params.node.gridApi.formGroup.controls)) {
|
|
552
|
+
if (('' + controlName).toLowerCase().substr(0, 9) === 'rowgroup_') {
|
|
553
|
+
let found = false;
|
|
554
|
+
for (let node of this.params.node.gridApi.getModel().rowsToDisplay) {
|
|
555
|
+
if (('' + node.rowIndex) === ('' + controlName).substr(9)) {
|
|
556
|
+
found = true;
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
if (!found) {
|
|
561
|
+
this.params.node.gridApi.formGroup.removeControl(controlName);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
this.params.node.gridApi.formGroup.addControl('RowGroup_' + this.params.node.rowIndex, this.params.node.formGroup);
|
|
567
|
+
}
|
|
568
|
+
if (!this.params.node.formGroup.controls[this.params.colDef.field + '_formControl']) {
|
|
569
|
+
this.params.node.formGroup.addControl(this.params.colDef.field + '_formControl', formControl);
|
|
570
|
+
if (Array.isArray(this.params.colDef.validators)) {
|
|
571
|
+
this.params.node.formGroup.controls[this.params.colDef.field + '_formControl'].setValidators(this.params.colDef.validators);
|
|
572
|
+
}
|
|
573
|
+
if (this.params.node.gridApi.columnController
|
|
574
|
+
&& this.params.node.gridApi.columnController.columnDefs) {
|
|
575
|
+
for (let columnDef of this.params.node.gridApi.columnController.columnDefs) {
|
|
576
|
+
if (columnDef.outerForm && columnDef.formName) {
|
|
577
|
+
if (!columnDef.outerForm.get(columnDef.formName)) {
|
|
578
|
+
columnDef.outerForm.addControl(columnDef.formName, this.params.node.gridApi.formGroup);
|
|
579
|
+
}
|
|
580
|
+
else {
|
|
581
|
+
columnDef.outerForm.setControl(columnDef.formName, this.params.node.gridApi.formGroup);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
this.updateErrorMessage(formControl, this.params.node, this.params.colDef);
|
|
588
|
+
}
|
|
589
|
+
// add column control groups if needed
|
|
590
|
+
// add row control groups if needed
|
|
591
|
+
// setup grid control group if needed
|
|
592
|
+
// Might need to trigger cell validation to run with the new validation.
|
|
593
|
+
}
|
|
594
594
|
}
|
|
595
595
|
|
|
596
|
-
class SelectRenderer extends CellRendererValidation {
|
|
597
|
-
agInit2(params) {
|
|
598
|
-
this.options = [];
|
|
599
|
-
this.value = "";
|
|
600
|
-
this.optionsValueField = "";
|
|
601
|
-
this.optionsDisplayField = "";
|
|
602
|
-
this.defaultDisplayField = "";
|
|
603
|
-
this.defaultDisplayValue = "";
|
|
604
|
-
if (this.params) {
|
|
605
|
-
if (this.params.value) {
|
|
606
|
-
this.value = this.params.value;
|
|
607
|
-
}
|
|
608
|
-
else {
|
|
609
|
-
this.value = "";
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
if (this.params && this.params.column && this.params.column.colDef) {
|
|
613
|
-
if (this.params.column.colDef.rendererOptions) {
|
|
614
|
-
this.options = this.params.column.colDef.rendererOptions;
|
|
615
|
-
}
|
|
616
|
-
else {
|
|
617
|
-
this.options = this.params.column.colDef.selectOptions;
|
|
618
|
-
}
|
|
619
|
-
this.optionsValueField = this.params.column.colDef.selectOptionsValueField;
|
|
620
|
-
this.optionsDisplayField = this.params.column.colDef.selectOptionsDisplayField;
|
|
621
|
-
this.defaultDisplayField = this.params.column.colDef.defaultDisplayField;
|
|
622
|
-
this.defaultDisplayValue = this.params.column.colDef.defaultDisplayValue;
|
|
623
|
-
}
|
|
624
|
-
if (this.defaultDisplayField) {
|
|
625
|
-
for (let option of this.options) {
|
|
626
|
-
if (option[this.defaultDisplayField] === this.defaultDisplayValue) {
|
|
627
|
-
this.defaultOption = option;
|
|
628
|
-
break;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
if (this.value && this.value != ""
|
|
633
|
-
&& this.options && this.options.length > 0
|
|
634
|
-
&& this.optionsValueField && this.optionsValueField != ""
|
|
635
|
-
&& this.optionsDisplayField && this.optionsDisplayField != "") {
|
|
636
|
-
let foundOption = false;
|
|
637
|
-
for (let option of this.options) {
|
|
638
|
-
if (option[this.optionsValueField] && option[this.optionsValueField] === this.value) {
|
|
639
|
-
if (option[this.optionsDisplayField]) {
|
|
640
|
-
this.display = option[this.optionsDisplayField];
|
|
641
|
-
foundOption = true;
|
|
642
|
-
}
|
|
643
|
-
else {
|
|
644
|
-
this.display = this.value;
|
|
645
|
-
}
|
|
646
|
-
break;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
// if we didn't find the item in the dictionary, check if the items are strings in different cases
|
|
650
|
-
if (!foundOption) {
|
|
651
|
-
for (let option of this.options) {
|
|
652
|
-
if (option[this.optionsValueField] && ("" + option[this.optionsValueField]).toLowerCase() === ("" + this.value).toLowerCase()) {
|
|
653
|
-
if (option[this.optionsDisplayField]) {
|
|
654
|
-
this.display = option[this.optionsDisplayField];
|
|
655
|
-
foundOption = true;
|
|
656
|
-
}
|
|
657
|
-
else {
|
|
658
|
-
this.display = this.value;
|
|
659
|
-
}
|
|
660
|
-
break;
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
// if we still didn't find the item, at least display the id.
|
|
665
|
-
if (!foundOption) {
|
|
666
|
-
this.display = this.value;
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
else if (this.defaultOption && this.value != "") {
|
|
670
|
-
this.display = this.defaultOption[this.optionsDisplayField];
|
|
671
|
-
}
|
|
672
|
-
else {
|
|
673
|
-
this.display = this.value;
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
refresh() {
|
|
677
|
-
return false;
|
|
678
|
-
}
|
|
679
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
680
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
596
|
+
class SelectRenderer extends CellRendererValidation {
|
|
597
|
+
agInit2(params) {
|
|
598
|
+
this.options = [];
|
|
599
|
+
this.value = "";
|
|
600
|
+
this.optionsValueField = "";
|
|
601
|
+
this.optionsDisplayField = "";
|
|
602
|
+
this.defaultDisplayField = "";
|
|
603
|
+
this.defaultDisplayValue = "";
|
|
604
|
+
if (this.params) {
|
|
605
|
+
if (this.params.value) {
|
|
606
|
+
this.value = this.params.value;
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
this.value = "";
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
if (this.params && this.params.column && this.params.column.colDef) {
|
|
613
|
+
if (this.params.column.colDef.rendererOptions) {
|
|
614
|
+
this.options = this.params.column.colDef.rendererOptions;
|
|
615
|
+
}
|
|
616
|
+
else {
|
|
617
|
+
this.options = this.params.column.colDef.selectOptions;
|
|
618
|
+
}
|
|
619
|
+
this.optionsValueField = this.params.column.colDef.selectOptionsValueField;
|
|
620
|
+
this.optionsDisplayField = this.params.column.colDef.selectOptionsDisplayField;
|
|
621
|
+
this.defaultDisplayField = this.params.column.colDef.defaultDisplayField;
|
|
622
|
+
this.defaultDisplayValue = this.params.column.colDef.defaultDisplayValue;
|
|
623
|
+
}
|
|
624
|
+
if (this.defaultDisplayField) {
|
|
625
|
+
for (let option of this.options) {
|
|
626
|
+
if (option[this.defaultDisplayField] === this.defaultDisplayValue) {
|
|
627
|
+
this.defaultOption = option;
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
if (this.value && this.value != ""
|
|
633
|
+
&& this.options && this.options.length > 0
|
|
634
|
+
&& this.optionsValueField && this.optionsValueField != ""
|
|
635
|
+
&& this.optionsDisplayField && this.optionsDisplayField != "") {
|
|
636
|
+
let foundOption = false;
|
|
637
|
+
for (let option of this.options) {
|
|
638
|
+
if (option[this.optionsValueField] && option[this.optionsValueField] === this.value) {
|
|
639
|
+
if (option[this.optionsDisplayField]) {
|
|
640
|
+
this.display = option[this.optionsDisplayField];
|
|
641
|
+
foundOption = true;
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
this.display = this.value;
|
|
645
|
+
}
|
|
646
|
+
break;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
// if we didn't find the item in the dictionary, check if the items are strings in different cases
|
|
650
|
+
if (!foundOption) {
|
|
651
|
+
for (let option of this.options) {
|
|
652
|
+
if (option[this.optionsValueField] && ("" + option[this.optionsValueField]).toLowerCase() === ("" + this.value).toLowerCase()) {
|
|
653
|
+
if (option[this.optionsDisplayField]) {
|
|
654
|
+
this.display = option[this.optionsDisplayField];
|
|
655
|
+
foundOption = true;
|
|
656
|
+
}
|
|
657
|
+
else {
|
|
658
|
+
this.display = this.value;
|
|
659
|
+
}
|
|
660
|
+
break;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
// if we still didn't find the item, at least display the id.
|
|
665
|
+
if (!foundOption) {
|
|
666
|
+
this.display = this.value;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
else if (this.defaultOption && this.value != "") {
|
|
670
|
+
this.display = this.defaultOption[this.optionsDisplayField];
|
|
671
|
+
}
|
|
672
|
+
else {
|
|
673
|
+
this.display = this.value;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
refresh() {
|
|
677
|
+
return false;
|
|
678
|
+
}
|
|
679
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SelectRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
680
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SelectRenderer, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
681
681
|
<!--<div [matTooltip]="this.errorMessage"
|
|
682
682
|
[matTooltipShowDelay]="300"
|
|
683
683
|
[matTooltipHideDelay]="300"
|
|
@@ -691,10 +691,10 @@ class SelectRenderer extends CellRendererValidation {
|
|
|
691
691
|
</div>
|
|
692
692
|
</div>
|
|
693
693
|
</div>
|
|
694
|
-
`, isInline: true, styles: [".t{display:table}.tr{display:table-row}.td{display:table-cell}.cell-text-container{vertical-align:middle;padding-left:.3rem}.full-width{width:100%}.full-height{height:100%}.fix-table{table-layout:fixed}.ellipsis{overflow:hidden;text-overflow:ellipsis}.error{background:linear-gradient(#ff000040,#ff000040,#ff000040);border:solid red 2px}\n"] }); }
|
|
695
|
-
}
|
|
696
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
697
|
-
type: Component,
|
|
694
|
+
`, isInline: true, styles: [".t{display:table}.tr{display:table-row}.td{display:table-cell}.cell-text-container{vertical-align:middle;padding-left:.3rem}.full-width{width:100%}.full-height{height:100%}.fix-table{table-layout:fixed}.ellipsis{overflow:hidden;text-overflow:ellipsis}.error{background:linear-gradient(#ff000040,#ff000040,#ff000040);border:solid red 2px}\n"] }); }
|
|
695
|
+
}
|
|
696
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SelectRenderer, decorators: [{
|
|
697
|
+
type: Component,
|
|
698
698
|
args: [{ template: `
|
|
699
699
|
<!--<div [matTooltip]="this.errorMessage"
|
|
700
700
|
[matTooltipShowDelay]="300"
|
|
@@ -709,140 +709,140 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
709
709
|
</div>
|
|
710
710
|
</div>
|
|
711
711
|
</div>
|
|
712
|
-
`, styles: [".t{display:table}.tr{display:table-row}.td{display:table-cell}.cell-text-container{vertical-align:middle;padding-left:.3rem}.full-width{width:100%}.full-height{height:100%}.fix-table{table-layout:fixed}.ellipsis{overflow:hidden;text-overflow:ellipsis}.error{background:linear-gradient(#ff000040,#ff000040,#ff000040);border:solid red 2px}\n"] }]
|
|
712
|
+
`, styles: [".t{display:table}.tr{display:table-row}.td{display:table-cell}.cell-text-container{vertical-align:middle;padding-left:.3rem}.full-width{width:100%}.full-height{height:100%}.fix-table{table-layout:fixed}.ellipsis{overflow:hidden;text-overflow:ellipsis}.error{background:linear-gradient(#ff000040,#ff000040,#ff000040);border:solid red 2px}\n"] }]
|
|
713
713
|
}] });
|
|
714
714
|
|
|
715
|
-
//import {MatDialog, MatDialogConfig, MatDialogRef} from "@angular/material/dialog";
|
|
716
|
-
//import {SpinnerDialogComponent} from "../popup/spinner-dialog.component";
|
|
717
|
-
class SelectEditor {
|
|
718
|
-
get options() {
|
|
719
|
-
if (this.using_selectOptionsPerRowFilterFunction) {
|
|
720
|
-
return this._filteredOptions;
|
|
721
|
-
}
|
|
722
|
-
else {
|
|
723
|
-
return this._options;
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
set options(value) {
|
|
727
|
-
this._options = value;
|
|
728
|
-
}
|
|
729
|
-
// private spinnerDialogRefs: MatDialogRef<SpinnerDialogComponent>[] = [];
|
|
730
|
-
constructor() {
|
|
731
|
-
this.using_selectOptionsPerRowFilterFunction = false;
|
|
732
|
-
this._spinnerDialogIsOpen = false;
|
|
733
|
-
}
|
|
734
|
-
agInit(params) {
|
|
735
|
-
this.params = params;
|
|
736
|
-
this.options = [];
|
|
737
|
-
this.optionsValueField = "";
|
|
738
|
-
this.optionsDisplayField = "";
|
|
739
|
-
if (this.params && this.params.column && this.params.column.colDef) {
|
|
740
|
-
this.gridValueField = this.params.column.colDef.field;
|
|
741
|
-
this.options = this.params.column.colDef.selectOptions;
|
|
742
|
-
this.optionsValueField = this.params.column.colDef.selectOptionsValueField;
|
|
743
|
-
this.optionsDisplayField = this.params.column.colDef.selectOptionsDisplayField;
|
|
744
|
-
if (this.params.column.colDef.selectOptionsPerRowFilterFunction) {
|
|
745
|
-
let backup = this.selectOptionsPerRowFilterFunction;
|
|
746
|
-
try {
|
|
747
|
-
this.selectOptionsPerRowFilterFunction = this.params.column.colDef.selectOptionsPerRowFilterFunction;
|
|
748
|
-
this.using_selectOptionsPerRowFilterFunction = !!this.selectOptionsPerRowFilterFunction;
|
|
749
|
-
}
|
|
750
|
-
catch (e) {
|
|
751
|
-
console.error("selectOptionsPerRowFilterFunction option has wrong signature for column : " + this.params.column.colDef.headerName + "\n"
|
|
752
|
-
+ " Requires signature (context:any, rowData: any, option: any) => boolean");
|
|
753
|
-
this.selectOptionsPerRowFilterFunction = backup;
|
|
754
|
-
this.using_selectOptionsPerRowFilterFunction = !!backup;
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
this.context = this.params.column.colDef.context;
|
|
758
|
-
this.fillGroupAttribute = this.params.column.colDef.fillGroupAttribute;
|
|
759
|
-
this.fillAll = this.params.column.colDef.fillAll && ("" + this.params.column.colDef.fillAll).toLowerCase() !== "false";
|
|
760
|
-
this.showFillButton = this.params.column.colDef.showFillButton && ("" + this.params.column.colDef.showFillButton).toLowerCase() !== "false";
|
|
761
|
-
if (this._options
|
|
762
|
-
&& this.params.node
|
|
763
|
-
&& this.params.node.data
|
|
764
|
-
&& this.using_selectOptionsPerRowFilterFunction) {
|
|
765
|
-
this._filteredOptions = this._options.filter((option) => {
|
|
766
|
-
return this.selectOptionsPerRowFilterFunction(this.context, this.params.node.data, option);
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
if (this.params) {
|
|
771
|
-
this.value = this.params.value ? "" + this.params.value : "";
|
|
772
|
-
}
|
|
773
|
-
if (this.showFillButton && !this.fillAll && (!this.fillGroupAttribute || this.fillGroupAttribute === "")) {
|
|
774
|
-
throw new Error("Invalid state, cannot use fill button without specifying the fillGroupAttribute or fillAll.");
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
ngOnDestroy() {
|
|
778
|
-
if (this.params && this.params.node && this.params.node[(this.gridValueField + "_originalValue")]) {
|
|
779
|
-
this.value = this.params.node[(this.gridValueField + "_originalValue")];
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
onChange(event) {
|
|
783
|
-
if (event && event.currentTarget) {
|
|
784
|
-
if (this.params && this.params.node && !this.params.node[(this.gridValueField + "_originalValue")]) {
|
|
785
|
-
this.params.node[(this.gridValueField + "_originalValue")] = this.value;
|
|
786
|
-
}
|
|
787
|
-
// This looks unnecessary, since this.value is linked to the value of the select component, but
|
|
788
|
-
// because this also ends editing, it also queues the destruction of this component and the call to getValue.
|
|
789
|
-
// The problem was that this.value isn't updated with the new value before this event fires,
|
|
790
|
-
// so we need to update it manually here.
|
|
791
|
-
this.value = event.currentTarget.value;
|
|
792
|
-
this.params.node.setDataValue(this.gridValueField, this.value);
|
|
793
|
-
}
|
|
794
|
-
if (this.params) {
|
|
795
|
-
// If the fill button, which is part of the editor, is activated, don't stop editing
|
|
796
|
-
// immediately after making a selection.
|
|
797
|
-
if (!this.showFillButton) {
|
|
798
|
-
this.params.stopEditing();
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
getValue() {
|
|
803
|
-
return this.value ? this.value : "";
|
|
804
|
-
}
|
|
805
|
-
isPopup() {
|
|
806
|
-
return false;
|
|
807
|
-
}
|
|
808
|
-
onFillButtonClicked() {
|
|
809
|
-
if (!this.fillAll && (!this.fillGroupAttribute || this.fillGroupAttribute === "")) {
|
|
810
|
-
throw new Error('No column attribute "fillGroupAttribute" or "fillAll" specified. This is required to use the Fill functionality.');
|
|
811
|
-
}
|
|
812
|
-
if (this.params && this.params.column && this.params.column.gridApi && this.params.node && (this.fillAll || (this.fillGroupAttribute && this.fillGroupAttribute !== ""))) {
|
|
813
|
-
let thisRowNode = this.params.node;
|
|
814
|
-
//this.startSpinnerDialog();
|
|
815
|
-
this.params.column.gridApi.forEachNodeAfterFilter((rowNode) => {
|
|
816
|
-
if (rowNode && rowNode.data && thisRowNode && thisRowNode.data && (this.fillAll || rowNode.data[this.fillGroupAttribute] === thisRowNode.data[this.fillGroupAttribute])) {
|
|
817
|
-
let spoofedEvent = {
|
|
818
|
-
api: this.params.column.gridApi,
|
|
819
|
-
colDef: this.params.column.colDef,
|
|
820
|
-
column: this.params.column,
|
|
821
|
-
columnApi: this.params.column.columnApi,
|
|
822
|
-
context: undefined,
|
|
823
|
-
data: rowNode.data,
|
|
824
|
-
event: null,
|
|
825
|
-
newValue: this.value,
|
|
826
|
-
node: rowNode,
|
|
827
|
-
oldValue: rowNode.data[this.gridValueField],
|
|
828
|
-
rowIndex: rowNode.rowIndex,
|
|
829
|
-
rowPinned: undefined,
|
|
830
|
-
type: "cellValueChanged",
|
|
831
|
-
value: this.value
|
|
832
|
-
};
|
|
833
|
-
rowNode.data[this.gridValueField] = this.value;
|
|
834
|
-
rowNode.setDataValue(this.gridValueField, this.value);
|
|
835
|
-
this.params.column.gridApi.dispatchEvent(spoofedEvent);
|
|
836
|
-
}
|
|
837
|
-
});
|
|
838
|
-
this.params.column.gridApi.refreshCells();
|
|
839
|
-
setTimeout(() => {
|
|
840
|
-
//this.stopSpinnerDialogs();
|
|
841
|
-
});
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
845
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
715
|
+
//import {MatDialog, MatDialogConfig, MatDialogRef} from "@angular/material/dialog";
|
|
716
|
+
//import {SpinnerDialogComponent} from "../popup/spinner-dialog.component";
|
|
717
|
+
class SelectEditor {
|
|
718
|
+
get options() {
|
|
719
|
+
if (this.using_selectOptionsPerRowFilterFunction) {
|
|
720
|
+
return this._filteredOptions;
|
|
721
|
+
}
|
|
722
|
+
else {
|
|
723
|
+
return this._options;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
set options(value) {
|
|
727
|
+
this._options = value;
|
|
728
|
+
}
|
|
729
|
+
// private spinnerDialogRefs: MatDialogRef<SpinnerDialogComponent>[] = [];
|
|
730
|
+
constructor() {
|
|
731
|
+
this.using_selectOptionsPerRowFilterFunction = false;
|
|
732
|
+
this._spinnerDialogIsOpen = false;
|
|
733
|
+
}
|
|
734
|
+
agInit(params) {
|
|
735
|
+
this.params = params;
|
|
736
|
+
this.options = [];
|
|
737
|
+
this.optionsValueField = "";
|
|
738
|
+
this.optionsDisplayField = "";
|
|
739
|
+
if (this.params && this.params.column && this.params.column.colDef) {
|
|
740
|
+
this.gridValueField = this.params.column.colDef.field;
|
|
741
|
+
this.options = this.params.column.colDef.selectOptions;
|
|
742
|
+
this.optionsValueField = this.params.column.colDef.selectOptionsValueField;
|
|
743
|
+
this.optionsDisplayField = this.params.column.colDef.selectOptionsDisplayField;
|
|
744
|
+
if (this.params.column.colDef.selectOptionsPerRowFilterFunction) {
|
|
745
|
+
let backup = this.selectOptionsPerRowFilterFunction;
|
|
746
|
+
try {
|
|
747
|
+
this.selectOptionsPerRowFilterFunction = this.params.column.colDef.selectOptionsPerRowFilterFunction;
|
|
748
|
+
this.using_selectOptionsPerRowFilterFunction = !!this.selectOptionsPerRowFilterFunction;
|
|
749
|
+
}
|
|
750
|
+
catch (e) {
|
|
751
|
+
console.error("selectOptionsPerRowFilterFunction option has wrong signature for column : " + this.params.column.colDef.headerName + "\n"
|
|
752
|
+
+ " Requires signature (context:any, rowData: any, option: any) => boolean");
|
|
753
|
+
this.selectOptionsPerRowFilterFunction = backup;
|
|
754
|
+
this.using_selectOptionsPerRowFilterFunction = !!backup;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
this.context = this.params.column.colDef.context;
|
|
758
|
+
this.fillGroupAttribute = this.params.column.colDef.fillGroupAttribute;
|
|
759
|
+
this.fillAll = this.params.column.colDef.fillAll && ("" + this.params.column.colDef.fillAll).toLowerCase() !== "false";
|
|
760
|
+
this.showFillButton = this.params.column.colDef.showFillButton && ("" + this.params.column.colDef.showFillButton).toLowerCase() !== "false";
|
|
761
|
+
if (this._options
|
|
762
|
+
&& this.params.node
|
|
763
|
+
&& this.params.node.data
|
|
764
|
+
&& this.using_selectOptionsPerRowFilterFunction) {
|
|
765
|
+
this._filteredOptions = this._options.filter((option) => {
|
|
766
|
+
return this.selectOptionsPerRowFilterFunction(this.context, this.params.node.data, option);
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
if (this.params) {
|
|
771
|
+
this.value = this.params.value ? "" + this.params.value : "";
|
|
772
|
+
}
|
|
773
|
+
if (this.showFillButton && !this.fillAll && (!this.fillGroupAttribute || this.fillGroupAttribute === "")) {
|
|
774
|
+
throw new Error("Invalid state, cannot use fill button without specifying the fillGroupAttribute or fillAll.");
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
ngOnDestroy() {
|
|
778
|
+
if (this.params && this.params.node && this.params.node[(this.gridValueField + "_originalValue")]) {
|
|
779
|
+
this.value = this.params.node[(this.gridValueField + "_originalValue")];
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
onChange(event) {
|
|
783
|
+
if (event && event.currentTarget) {
|
|
784
|
+
if (this.params && this.params.node && !this.params.node[(this.gridValueField + "_originalValue")]) {
|
|
785
|
+
this.params.node[(this.gridValueField + "_originalValue")] = this.value;
|
|
786
|
+
}
|
|
787
|
+
// This looks unnecessary, since this.value is linked to the value of the select component, but
|
|
788
|
+
// because this also ends editing, it also queues the destruction of this component and the call to getValue.
|
|
789
|
+
// The problem was that this.value isn't updated with the new value before this event fires,
|
|
790
|
+
// so we need to update it manually here.
|
|
791
|
+
this.value = event.currentTarget.value;
|
|
792
|
+
this.params.node.setDataValue(this.gridValueField, this.value);
|
|
793
|
+
}
|
|
794
|
+
if (this.params) {
|
|
795
|
+
// If the fill button, which is part of the editor, is activated, don't stop editing
|
|
796
|
+
// immediately after making a selection.
|
|
797
|
+
if (!this.showFillButton) {
|
|
798
|
+
this.params.stopEditing();
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
getValue() {
|
|
803
|
+
return this.value ? this.value : "";
|
|
804
|
+
}
|
|
805
|
+
isPopup() {
|
|
806
|
+
return false;
|
|
807
|
+
}
|
|
808
|
+
onFillButtonClicked() {
|
|
809
|
+
if (!this.fillAll && (!this.fillGroupAttribute || this.fillGroupAttribute === "")) {
|
|
810
|
+
throw new Error('No column attribute "fillGroupAttribute" or "fillAll" specified. This is required to use the Fill functionality.');
|
|
811
|
+
}
|
|
812
|
+
if (this.params && this.params.column && this.params.column.gridApi && this.params.node && (this.fillAll || (this.fillGroupAttribute && this.fillGroupAttribute !== ""))) {
|
|
813
|
+
let thisRowNode = this.params.node;
|
|
814
|
+
//this.startSpinnerDialog();
|
|
815
|
+
this.params.column.gridApi.forEachNodeAfterFilter((rowNode) => {
|
|
816
|
+
if (rowNode && rowNode.data && thisRowNode && thisRowNode.data && (this.fillAll || rowNode.data[this.fillGroupAttribute] === thisRowNode.data[this.fillGroupAttribute])) {
|
|
817
|
+
let spoofedEvent = {
|
|
818
|
+
api: this.params.column.gridApi,
|
|
819
|
+
colDef: this.params.column.colDef,
|
|
820
|
+
column: this.params.column,
|
|
821
|
+
columnApi: this.params.column.columnApi,
|
|
822
|
+
context: undefined,
|
|
823
|
+
data: rowNode.data,
|
|
824
|
+
event: null,
|
|
825
|
+
newValue: this.value,
|
|
826
|
+
node: rowNode,
|
|
827
|
+
oldValue: rowNode.data[this.gridValueField],
|
|
828
|
+
rowIndex: rowNode.rowIndex,
|
|
829
|
+
rowPinned: undefined,
|
|
830
|
+
type: "cellValueChanged",
|
|
831
|
+
value: this.value
|
|
832
|
+
};
|
|
833
|
+
rowNode.data[this.gridValueField] = this.value;
|
|
834
|
+
rowNode.setDataValue(this.gridValueField, this.value);
|
|
835
|
+
this.params.column.gridApi.dispatchEvent(spoofedEvent);
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
this.params.column.gridApi.refreshCells();
|
|
839
|
+
setTimeout(() => {
|
|
840
|
+
//this.stopSpinnerDialogs();
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SelectEditor, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
845
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: SelectEditor, selector: "ng-component", ngImport: i0, template: `
|
|
846
846
|
<div class="full-width full-height flex-column-container">
|
|
847
847
|
<div class="full-height flex-stretch flex-row">
|
|
848
848
|
<select class="full-width full-height" [(value)]="value" (change)="onChange($event)">
|
|
@@ -860,10 +860,10 @@ class SelectEditor {
|
|
|
860
860
|
<button class="full-height" (click)="onFillButtonClicked()">Fill</button>
|
|
861
861
|
</div>
|
|
862
862
|
</div>
|
|
863
|
-
`, isInline: true, styles: [".full-width{width:100%}.full-height{height:100%}.flex-column-container{display:flex;flex-direction:row}.flex-row{display:flex}.flex-stretch{display:flex;flex:1}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] }); }
|
|
864
|
-
}
|
|
865
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
866
|
-
type: Component,
|
|
863
|
+
`, isInline: true, styles: [".full-width{width:100%}.full-height{height:100%}.flex-column-container{display:flex;flex-direction:row}.flex-row{display:flex}.flex-stretch{display:flex;flex:1}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] }); }
|
|
864
|
+
}
|
|
865
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: SelectEditor, decorators: [{
|
|
866
|
+
type: Component,
|
|
867
867
|
args: [{ template: `
|
|
868
868
|
<div class="full-width full-height flex-column-container">
|
|
869
869
|
<div class="full-height flex-stretch flex-row">
|
|
@@ -882,77 +882,77 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
882
882
|
<button class="full-height" (click)="onFillButtonClicked()">Fill</button>
|
|
883
883
|
</div>
|
|
884
884
|
</div>
|
|
885
|
-
`, styles: [".full-width{width:100%}.full-height{height:100%}.flex-column-container{display:flex;flex-direction:row}.flex-row{display:flex}.flex-stretch{display:flex;flex:1}\n"] }]
|
|
886
|
-
}], ctorParameters:
|
|
885
|
+
`, styles: [".full-width{width:100%}.full-height{height:100%}.flex-column-container{display:flex;flex-direction:row}.flex-row{display:flex}.flex-stretch{display:flex;flex:1}\n"] }]
|
|
886
|
+
}], ctorParameters: () => [] });
|
|
887
887
|
|
|
888
|
-
class NewRowComponent {
|
|
889
|
-
get colDefs() {
|
|
890
|
-
return this._colDefs;
|
|
891
|
-
}
|
|
892
|
-
set colDefs(value) {
|
|
893
|
-
this._colDefs = value;
|
|
894
|
-
this.newRow[0]["editOrNew"] = "new"; //needed for editable function
|
|
895
|
-
for (let colDef of this.colDefs) {
|
|
896
|
-
this.newRow[0][colDef.field] = "";
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
constructor(activeModalSearch) {
|
|
900
|
-
this.activeModalSearch = activeModalSearch;
|
|
901
|
-
this.newRowSubject = new Subject();
|
|
902
|
-
this.newRow = [{}];
|
|
903
|
-
this.gridOptions = {
|
|
904
|
-
context: {
|
|
905
|
-
componentParent: this
|
|
906
|
-
}
|
|
907
|
-
};
|
|
908
|
-
}
|
|
909
|
-
save() {
|
|
910
|
-
// get contents of row
|
|
911
|
-
//making sure the grid has stopped editing when user clicks save
|
|
912
|
-
// waiting a tick to make sure that async event has finished
|
|
913
|
-
this.gridApi.stopEditing();
|
|
914
|
-
setTimeout(() => {
|
|
915
|
-
let newData = [];
|
|
916
|
-
this.gridApi.forEachNode((node) => {
|
|
917
|
-
newData.push(node.data);
|
|
918
|
-
});
|
|
919
|
-
// validate the contents of row
|
|
920
|
-
let isValid = true;
|
|
921
|
-
for (let colDef of this.colDefs) {
|
|
922
|
-
if (colDef.dictionaryDisplay == true && !newData[0][colDef.field]) {
|
|
923
|
-
let displayDictField = null;
|
|
924
|
-
if (this.gridOptions.context && this.gridOptions.context.componentParent
|
|
925
|
-
&& this.gridOptions.context.componentParent.dictionary) {
|
|
926
|
-
let dictFields = this.gridOptions.context.componentParent.dictionary.fields;
|
|
927
|
-
displayDictField = dictFields.find(field => (field.dictionaryDisplay === true));
|
|
928
|
-
}
|
|
929
|
-
//don't require displayField if it is readonly when making a new entry
|
|
930
|
-
if (displayDictField && displayDictField.protectionType === "Read Only") {
|
|
931
|
-
isValid = true;
|
|
932
|
-
}
|
|
933
|
-
else {
|
|
934
|
-
isValid = false;
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
if (isValid) {
|
|
939
|
-
// send contents of row to other ag-grid
|
|
940
|
-
this.newRowSubject.next(newData);
|
|
941
|
-
this.activeModalSearch.dismiss("Cancel");
|
|
942
|
-
}
|
|
943
|
-
else {
|
|
944
|
-
// signal they need to fill out the row
|
|
945
|
-
alert("The display value is required, please enter a value and then save again.");
|
|
946
|
-
}
|
|
947
|
-
});
|
|
948
|
-
}
|
|
949
|
-
onSamplesGridReady(event) {
|
|
950
|
-
event.api.setColumnDefs(this.colDefs);
|
|
951
|
-
event.api.sizeColumnsToFit();
|
|
952
|
-
this.gridApi = event.api;
|
|
953
|
-
}
|
|
954
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
955
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
888
|
+
class NewRowComponent {
|
|
889
|
+
get colDefs() {
|
|
890
|
+
return this._colDefs;
|
|
891
|
+
}
|
|
892
|
+
set colDefs(value) {
|
|
893
|
+
this._colDefs = value;
|
|
894
|
+
this.newRow[0]["editOrNew"] = "new"; //needed for editable function
|
|
895
|
+
for (let colDef of this.colDefs) {
|
|
896
|
+
this.newRow[0][colDef.field] = "";
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
constructor(activeModalSearch) {
|
|
900
|
+
this.activeModalSearch = activeModalSearch;
|
|
901
|
+
this.newRowSubject = new Subject();
|
|
902
|
+
this.newRow = [{}];
|
|
903
|
+
this.gridOptions = {
|
|
904
|
+
context: {
|
|
905
|
+
componentParent: this
|
|
906
|
+
}
|
|
907
|
+
};
|
|
908
|
+
}
|
|
909
|
+
save() {
|
|
910
|
+
// get contents of row
|
|
911
|
+
//making sure the grid has stopped editing when user clicks save
|
|
912
|
+
// waiting a tick to make sure that async event has finished
|
|
913
|
+
this.gridApi.stopEditing();
|
|
914
|
+
setTimeout(() => {
|
|
915
|
+
let newData = [];
|
|
916
|
+
this.gridApi.forEachNode((node) => {
|
|
917
|
+
newData.push(node.data);
|
|
918
|
+
});
|
|
919
|
+
// validate the contents of row
|
|
920
|
+
let isValid = true;
|
|
921
|
+
for (let colDef of this.colDefs) {
|
|
922
|
+
if (colDef.dictionaryDisplay == true && !newData[0][colDef.field]) {
|
|
923
|
+
let displayDictField = null;
|
|
924
|
+
if (this.gridOptions.context && this.gridOptions.context.componentParent
|
|
925
|
+
&& this.gridOptions.context.componentParent.dictionary) {
|
|
926
|
+
let dictFields = this.gridOptions.context.componentParent.dictionary.fields;
|
|
927
|
+
displayDictField = dictFields.find(field => (field.dictionaryDisplay === true));
|
|
928
|
+
}
|
|
929
|
+
//don't require displayField if it is readonly when making a new entry
|
|
930
|
+
if (displayDictField && displayDictField.protectionType === "Read Only") {
|
|
931
|
+
isValid = true;
|
|
932
|
+
}
|
|
933
|
+
else {
|
|
934
|
+
isValid = false;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
if (isValid) {
|
|
939
|
+
// send contents of row to other ag-grid
|
|
940
|
+
this.newRowSubject.next(newData);
|
|
941
|
+
this.activeModalSearch.dismiss("Cancel");
|
|
942
|
+
}
|
|
943
|
+
else {
|
|
944
|
+
// signal they need to fill out the row
|
|
945
|
+
alert("The display value is required, please enter a value and then save again.");
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
onSamplesGridReady(event) {
|
|
950
|
+
event.api.setColumnDefs(this.colDefs);
|
|
951
|
+
event.api.sizeColumnsToFit();
|
|
952
|
+
this.gridApi = event.api;
|
|
953
|
+
}
|
|
954
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: NewRowComponent, deps: [{ token: i1$2.NgbActiveModal }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
955
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: NewRowComponent, selector: "new-row", ngImport: i0, template: `
|
|
956
956
|
<div class="d-flex flex-column" style="height:11em; width:58vw;">
|
|
957
957
|
<div class="d-flex flex-row">
|
|
958
958
|
<div class="flex-grow-1"></div>
|
|
@@ -986,10 +986,10 @@ class NewRowComponent {
|
|
|
986
986
|
</button>
|
|
987
987
|
</div>
|
|
988
988
|
</div>
|
|
989
|
-
`, isInline: true, styles: [".full-height{height:100%}.full-width{width:100%}:host ::ng-deep .ag-ltr .ag-cell{border-right-color:gray}\n"], dependencies: [{ kind: "component", type: i2$1.AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "suppressMenuHide", "enableBrowserTooltips", "tooltipShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "maintainColumnOrder", "suppressFieldDotNotation", "deltaColumnMode", "applyColumnDefOrder", "immutableColumns", "suppressSetColumnStateEvents", "suppressColumnStateEvents", "colWidth", "minColWidth", "maxColWidth", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "components", "frameworkComponents", "editType", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterMovesDown", "enterMovesDownAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "stopEditingWhenGridLosesFocus", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "defaultExportParams", "quickFilterText", "cacheQuickFilter", "excludeChildrenWhenTreeDataFiltering", "enableCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "enableChartToolPanelsButton", "chartToolPanelsDef", "loadingCellRenderer", "loadingCellRendererFramework", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererFramework", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressParentsInRowNodes", "suppressTouch", "suppressFocusAfterRefresh", "suppressAsyncEvents", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentFramework", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentFramework", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "pagination", "paginationPageSize", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "suppressAggFuncInHeader", "suppressAggAtRootLevel", "aggregateOnlyChangedColumns", "suppressAggFilteredOnly", "removePivotHeaderRowWhenSingleValueColumn", "animateRows", "enableCellChangeFlash", "cellFlashDelay", "cellFadeDelay", "allowShowChangeAfterFilter", "domLayout", "ensureDomOrder", "enableRtl", "suppressColumnVirtualisation", "suppressMaxRenderedRowRestriction", "suppressRowVirtualisation", "rowDragManaged", "suppressRowDrag", "suppressMoveWhenRowDragging", "rowDragEntireRow", "rowDragMultiRow", "rowDragText", "fullWidthCellRenderer", "fullWidthCellRendererFramework", "fullWidthCellRendererParams", "embedFullWidthRows", "deprecatedEmbedFullWidthRows", "groupDisplayType", "groupDefaultExpanded", "autoGroupColumnDef", "groupMaintainOrder", "groupSelectsChildren", "groupAggFiltering", "groupIncludeFooter", "groupIncludeTotalFooter", "groupSuppressBlankHeader", "groupSelectsFiltered", "showOpenedGroup", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "groupHideOpenParents", "rowGroupPanelShow", "groupRowRenderer", "groupRowRendererFramework", "groupRowRendererParams", "suppressMakeColumnVisibleAfterUnGroup", "treeData", "rowGroupPanelSuppressSort", "groupRowsSticky", "groupRowInnerRenderer", "groupRowInnerRendererFramework", "groupMultiAutoColumn", "groupUseEntireRow", "groupSuppressAutoColumn", "rememberGroupStateWhenNewData", "pinnedTopRowData", "pinnedBottomRowData", "rowModelType", "rowData", "immutableData", "asyncTransactionWaitMillis", "suppressModelUpdateAfterUpdateTransaction", "deltaRowDataMode", "batchUpdateWaitMillis", "datasource", "cacheOverflowSize", "infiniteInitialRowCount", "serverSideInitialRowCount", "serverSideStoreType", "serverSideInfiniteScroll", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideFilterAllLevels", "serverSideSortOnServer", "serverSideFilterOnServer", "serverSideSortingAlwaysResets", "serverSideFilteringAlwaysResets", "suppressEnterpriseResetOnNewColumns", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellSelection", "suppressCellFocus", "suppressMultiRangeSelection", "enableCellTextSelection", "enableRangeSelection", "enableRangeHandle", "enableFillHandle", "fillHandleDirection", "suppressClearOnFillReduction", "sortingOrder", "accentedSort", "unSortIcon", "suppressMultiSort", "alwaysMultiSort", "multiSortKey", "suppressMaintainUnsortedOrder", "icons", "rowHeight", "rowStyle", "rowClass", "rowClassRules", "suppressRowHoverHighlight", "suppressRowTransform", "columnHoverHighlight", "deltaSort", "treeDataDisplayType", "angularCompileRows", "angularCompileFilters", "functionsPassive", "enableGroupEdit", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "navigateToNextHeader", "tabToNextHeader", "navigateToNextCell", "tabToNextCell", "suppressKeyboardEvent", "localeTextFunc", "getLocaleText", "getDocument", "paginationNumberFormatter", "groupRowAggNodes", "getGroupRowAgg", "isGroupOpenByDefault", "initialGroupOrderComparator", "defaultGroupOrderComparator", "processSecondaryColDef", "processSecondaryColGroupDef", "processPivotResultColDef", "processPivotResultColGroupDef", "getDataPath", "defaultGroupSortComparator", "getChildCount", "getServerSideGroupLevelParams", "getServerSideStoreParams", "isServerSideGroupOpenByDefault", "isApplyServerSideTransaction", "isServerSideGroup", "getServerSideGroupKey", "getBusinessKeyForNode", "getRowNodeId", "getRowId", "resetRowDataOnUpdate", "processRowPostCreate", "isRowSelectable", "isRowMaster", "fillOperation", "postSort", "postSortRows", "getRowStyle", "getRowClass", "getRowHeight", "isFullWidthCell", "isFullWidthRow"], outputs: ["toolPanelVisibleChanged", "toolPanelSizeChanged", "pasteStart", "pasteEnd", "columnVisible", "columnPinned", "columnResized", "columnMoved", "columnValueChanged", "columnPivotModeChanged", "columnPivotChanged", "columnGroupOpened", "newColumnsLoaded", "gridColumnsChanged", "displayedColumnsChanged", "virtualColumnsChanged", "columnEverythingChanged", "componentStateChanged", "cellValueChanged", "cellEditRequest", "rowValueChanged", "cellEditingStarted", "cellEditingStopped", "rowEditingStarted", "rowEditingStopped", "filterOpened", "filterChanged", "filterModified", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "cellKeyPress", "gridReady", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pinnedRowDataChanged", "rowDataChanged", "rowDataUpdated", "asyncTransactionsFlushed", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "sortChanged", "columnRowGroupChangeRequest", "columnPivotChangeRequest", "columnValueChangeRequest", "columnAggFuncChangeRequest"] }] }); }
|
|
990
|
-
}
|
|
991
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
992
|
-
type: Component,
|
|
989
|
+
`, isInline: true, styles: [".full-height{height:100%}.full-width{width:100%}:host ::ng-deep .ag-ltr .ag-cell{border-right-color:gray}\n"], dependencies: [{ kind: "component", type: i2$1.AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "suppressMenuHide", "enableBrowserTooltips", "tooltipShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "maintainColumnOrder", "suppressFieldDotNotation", "deltaColumnMode", "applyColumnDefOrder", "immutableColumns", "suppressSetColumnStateEvents", "suppressColumnStateEvents", "colWidth", "minColWidth", "maxColWidth", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "components", "frameworkComponents", "editType", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterMovesDown", "enterMovesDownAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "stopEditingWhenGridLosesFocus", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "defaultExportParams", "quickFilterText", "cacheQuickFilter", "excludeChildrenWhenTreeDataFiltering", "enableCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "enableChartToolPanelsButton", "chartToolPanelsDef", "loadingCellRenderer", "loadingCellRendererFramework", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererFramework", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressParentsInRowNodes", "suppressTouch", "suppressFocusAfterRefresh", "suppressAsyncEvents", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentFramework", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentFramework", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "pagination", "paginationPageSize", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "suppressAggFuncInHeader", "suppressAggAtRootLevel", "aggregateOnlyChangedColumns", "suppressAggFilteredOnly", "removePivotHeaderRowWhenSingleValueColumn", "animateRows", "enableCellChangeFlash", "cellFlashDelay", "cellFadeDelay", "allowShowChangeAfterFilter", "domLayout", "ensureDomOrder", "enableRtl", "suppressColumnVirtualisation", "suppressMaxRenderedRowRestriction", "suppressRowVirtualisation", "rowDragManaged", "suppressRowDrag", "suppressMoveWhenRowDragging", "rowDragEntireRow", "rowDragMultiRow", "rowDragText", "fullWidthCellRenderer", "fullWidthCellRendererFramework", "fullWidthCellRendererParams", "embedFullWidthRows", "deprecatedEmbedFullWidthRows", "groupDisplayType", "groupDefaultExpanded", "autoGroupColumnDef", "groupMaintainOrder", "groupSelectsChildren", "groupAggFiltering", "groupIncludeFooter", "groupIncludeTotalFooter", "groupSuppressBlankHeader", "groupSelectsFiltered", "showOpenedGroup", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "groupHideOpenParents", "rowGroupPanelShow", "groupRowRenderer", "groupRowRendererFramework", "groupRowRendererParams", "suppressMakeColumnVisibleAfterUnGroup", "treeData", "rowGroupPanelSuppressSort", "groupRowsSticky", "groupRowInnerRenderer", "groupRowInnerRendererFramework", "groupMultiAutoColumn", "groupUseEntireRow", "groupSuppressAutoColumn", "rememberGroupStateWhenNewData", "pinnedTopRowData", "pinnedBottomRowData", "rowModelType", "rowData", "immutableData", "asyncTransactionWaitMillis", "suppressModelUpdateAfterUpdateTransaction", "deltaRowDataMode", "batchUpdateWaitMillis", "datasource", "cacheOverflowSize", "infiniteInitialRowCount", "serverSideInitialRowCount", "serverSideStoreType", "serverSideInfiniteScroll", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideFilterAllLevels", "serverSideSortOnServer", "serverSideFilterOnServer", "serverSideSortingAlwaysResets", "serverSideFilteringAlwaysResets", "suppressEnterpriseResetOnNewColumns", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellSelection", "suppressCellFocus", "suppressMultiRangeSelection", "enableCellTextSelection", "enableRangeSelection", "enableRangeHandle", "enableFillHandle", "fillHandleDirection", "suppressClearOnFillReduction", "sortingOrder", "accentedSort", "unSortIcon", "suppressMultiSort", "alwaysMultiSort", "multiSortKey", "suppressMaintainUnsortedOrder", "icons", "rowHeight", "rowStyle", "rowClass", "rowClassRules", "suppressRowHoverHighlight", "suppressRowTransform", "columnHoverHighlight", "deltaSort", "treeDataDisplayType", "angularCompileRows", "angularCompileFilters", "functionsPassive", "enableGroupEdit", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "navigateToNextHeader", "tabToNextHeader", "navigateToNextCell", "tabToNextCell", "suppressKeyboardEvent", "localeTextFunc", "getLocaleText", "getDocument", "paginationNumberFormatter", "groupRowAggNodes", "getGroupRowAgg", "isGroupOpenByDefault", "initialGroupOrderComparator", "defaultGroupOrderComparator", "processSecondaryColDef", "processSecondaryColGroupDef", "processPivotResultColDef", "processPivotResultColGroupDef", "getDataPath", "defaultGroupSortComparator", "getChildCount", "getServerSideGroupLevelParams", "getServerSideStoreParams", "isServerSideGroupOpenByDefault", "isApplyServerSideTransaction", "isServerSideGroup", "getServerSideGroupKey", "getBusinessKeyForNode", "getRowNodeId", "getRowId", "resetRowDataOnUpdate", "processRowPostCreate", "isRowSelectable", "isRowMaster", "fillOperation", "postSort", "postSortRows", "getRowStyle", "getRowClass", "getRowHeight", "isFullWidthCell", "isFullWidthRow"], outputs: ["toolPanelVisibleChanged", "toolPanelSizeChanged", "pasteStart", "pasteEnd", "columnVisible", "columnPinned", "columnResized", "columnMoved", "columnValueChanged", "columnPivotModeChanged", "columnPivotChanged", "columnGroupOpened", "newColumnsLoaded", "gridColumnsChanged", "displayedColumnsChanged", "virtualColumnsChanged", "columnEverythingChanged", "componentStateChanged", "cellValueChanged", "cellEditRequest", "rowValueChanged", "cellEditingStarted", "cellEditingStopped", "rowEditingStarted", "rowEditingStopped", "filterOpened", "filterChanged", "filterModified", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "cellKeyPress", "gridReady", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pinnedRowDataChanged", "rowDataChanged", "rowDataUpdated", "asyncTransactionsFlushed", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "sortChanged", "columnRowGroupChangeRequest", "columnPivotChangeRequest", "columnValueChangeRequest", "columnAggFuncChangeRequest"] }] }); }
|
|
990
|
+
}
|
|
991
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: NewRowComponent, decorators: [{
|
|
992
|
+
type: Component,
|
|
993
993
|
args: [{ selector: "new-row", template: `
|
|
994
994
|
<div class="d-flex flex-column" style="height:11em; width:58vw;">
|
|
995
995
|
<div class="d-flex flex-row">
|
|
@@ -1024,64 +1024,64 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1024
1024
|
</button>
|
|
1025
1025
|
</div>
|
|
1026
1026
|
</div>
|
|
1027
|
-
`, styles: [".full-height{height:100%}.full-width{width:100%}:host ::ng-deep .ag-ltr .ag-cell{border-right-color:gray}\n"] }]
|
|
1028
|
-
}], ctorParameters:
|
|
1027
|
+
`, styles: [".full-height{height:100%}.full-width{width:100%}:host ::ng-deep .ag-ltr .ag-cell{border-right-color:gray}\n"] }]
|
|
1028
|
+
}], ctorParameters: () => [{ type: i1$2.NgbActiveModal }] });
|
|
1029
1029
|
|
|
1030
|
-
class DateRenderer extends CellRendererValidation {
|
|
1031
|
-
constructor(datePipe) {
|
|
1032
|
-
super();
|
|
1033
|
-
this.datePipe = datePipe;
|
|
1034
|
-
}
|
|
1035
|
-
agInit2(params) {
|
|
1036
|
-
this.value = undefined;
|
|
1037
|
-
if (this.params) {
|
|
1038
|
-
if (this.params.value) {
|
|
1039
|
-
this.value = this.params.value;
|
|
1040
|
-
}
|
|
1041
|
-
else {
|
|
1042
|
-
this.value = undefined;
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
this.display = this.getDateString(this.value);
|
|
1046
|
-
}
|
|
1047
|
-
getDateString(date) {
|
|
1048
|
-
if (date instanceof Date) {
|
|
1049
|
-
if (!isNaN(date.getTime())) {
|
|
1050
|
-
return this.datePipe.transform(date, "yyyy-MM-dd");
|
|
1051
|
-
}
|
|
1052
|
-
else {
|
|
1053
|
-
return "";
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
else if (moment.isMoment(date)) {
|
|
1057
|
-
if (date.isValid()) {
|
|
1058
|
-
return date.format("YYYY-MM-DD");
|
|
1059
|
-
}
|
|
1060
|
-
else {
|
|
1061
|
-
return "";
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
else if (typeof date == "number") {
|
|
1065
|
-
if (date > 0) {
|
|
1066
|
-
let temp = new Date(date);
|
|
1067
|
-
return this.datePipe.transform(temp, "yyyy-MM-dd");
|
|
1068
|
-
}
|
|
1069
|
-
else {
|
|
1070
|
-
return "";
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
else if (typeof date == "string") {
|
|
1074
|
-
return date;
|
|
1075
|
-
}
|
|
1076
|
-
else {
|
|
1077
|
-
return "";
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
refresh() {
|
|
1081
|
-
return false;
|
|
1082
|
-
}
|
|
1083
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1084
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1030
|
+
class DateRenderer extends CellRendererValidation {
|
|
1031
|
+
constructor(datePipe) {
|
|
1032
|
+
super();
|
|
1033
|
+
this.datePipe = datePipe;
|
|
1034
|
+
}
|
|
1035
|
+
agInit2(params) {
|
|
1036
|
+
this.value = undefined;
|
|
1037
|
+
if (this.params) {
|
|
1038
|
+
if (this.params.value) {
|
|
1039
|
+
this.value = this.params.value;
|
|
1040
|
+
}
|
|
1041
|
+
else {
|
|
1042
|
+
this.value = undefined;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
this.display = this.getDateString(this.value);
|
|
1046
|
+
}
|
|
1047
|
+
getDateString(date) {
|
|
1048
|
+
if (date instanceof Date) {
|
|
1049
|
+
if (!isNaN(date.getTime())) {
|
|
1050
|
+
return this.datePipe.transform(date, "yyyy-MM-dd");
|
|
1051
|
+
}
|
|
1052
|
+
else {
|
|
1053
|
+
return "";
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
else if (moment.isMoment(date)) {
|
|
1057
|
+
if (date.isValid()) {
|
|
1058
|
+
return date.format("YYYY-MM-DD");
|
|
1059
|
+
}
|
|
1060
|
+
else {
|
|
1061
|
+
return "";
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
else if (typeof date == "number") {
|
|
1065
|
+
if (date > 0) {
|
|
1066
|
+
let temp = new Date(date);
|
|
1067
|
+
return this.datePipe.transform(temp, "yyyy-MM-dd");
|
|
1068
|
+
}
|
|
1069
|
+
else {
|
|
1070
|
+
return "";
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
else if (typeof date == "string") {
|
|
1074
|
+
return date;
|
|
1075
|
+
}
|
|
1076
|
+
else {
|
|
1077
|
+
return "";
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
refresh() {
|
|
1081
|
+
return false;
|
|
1082
|
+
}
|
|
1083
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DateRenderer, deps: [{ token: i1$1.DatePipe }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1084
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: DateRenderer, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
1085
1085
|
<div class="t full-width full-height fix-table">
|
|
1086
1086
|
<div class="tr">
|
|
1087
1087
|
<div class="td cell-text-container ellipsis">
|
|
@@ -1089,10 +1089,10 @@ class DateRenderer extends CellRendererValidation {
|
|
|
1089
1089
|
</div>
|
|
1090
1090
|
</div>
|
|
1091
1091
|
</div>
|
|
1092
|
-
`, isInline: true, styles: [".t{display:table}.tr{display:table-row}.td{display:table-cell}.cell-text-container{vertical-align:middle;padding-left:.3rem}.full-width{width:100%}.full-height{height:100%}.fix-table{table-layout:fixed}.ellipsis{overflow:hidden;text-overflow:ellipsis}\n"] }); }
|
|
1093
|
-
}
|
|
1094
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1095
|
-
type: Component,
|
|
1092
|
+
`, isInline: true, styles: [".t{display:table}.tr{display:table-row}.td{display:table-cell}.cell-text-container{vertical-align:middle;padding-left:.3rem}.full-width{width:100%}.full-height{height:100%}.fix-table{table-layout:fixed}.ellipsis{overflow:hidden;text-overflow:ellipsis}\n"] }); }
|
|
1093
|
+
}
|
|
1094
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DateRenderer, decorators: [{
|
|
1095
|
+
type: Component,
|
|
1096
1096
|
args: [{ template: `
|
|
1097
1097
|
<div class="t full-width full-height fix-table">
|
|
1098
1098
|
<div class="tr">
|
|
@@ -1101,63 +1101,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1101
1101
|
</div>
|
|
1102
1102
|
</div>
|
|
1103
1103
|
</div>
|
|
1104
|
-
`, styles: [".t{display:table}.tr{display:table-row}.td{display:table-cell}.cell-text-container{vertical-align:middle;padding-left:.3rem}.full-width{width:100%}.full-height{height:100%}.fix-table{table-layout:fixed}.ellipsis{overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
1105
|
-
}], ctorParameters:
|
|
1104
|
+
`, styles: [".t{display:table}.tr{display:table-row}.td{display:table-cell}.cell-text-container{vertical-align:middle;padding-left:.3rem}.full-width{width:100%}.full-height{height:100%}.fix-table{table-layout:fixed}.ellipsis{overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
1105
|
+
}], ctorParameters: () => [{ type: i1$1.DatePipe }] });
|
|
1106
1106
|
|
|
1107
|
-
class DatepickerComponent {
|
|
1108
|
-
constructor() {
|
|
1109
|
-
this.invalid = false;
|
|
1110
|
-
}
|
|
1111
|
-
ngOnInit() {
|
|
1112
|
-
}
|
|
1113
|
-
// onChange(newValue) {
|
|
1114
|
-
// this.value = newValue;
|
|
1115
|
-
// this.valueChange.emit(newValue);
|
|
1116
|
-
// }
|
|
1117
|
-
clear() {
|
|
1118
|
-
this.value = undefined;
|
|
1119
|
-
// this.valueChange.emit();
|
|
1120
|
-
}
|
|
1121
|
-
// Clear input field if entered data is invalid (Mat library sets value to null if invalid but doesn't clear input)
|
|
1122
|
-
onBlur(newValue) {
|
|
1123
|
-
if (!this.value) {
|
|
1124
|
-
this.value = undefined;
|
|
1125
|
-
// this.valueChange.emit();
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
writeValue(value) {
|
|
1129
|
-
if (value !== undefined) {
|
|
1130
|
-
this.value = value;
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
registerOnChange(fn) {
|
|
1134
|
-
this.onChange = () => {
|
|
1135
|
-
fn(this.value);
|
|
1136
|
-
};
|
|
1137
|
-
}
|
|
1138
|
-
registerOnTouched(fn) { }
|
|
1139
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1140
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1141
|
-
{ provide: MAT_DATE_LOCALE, useValue: "en-GB" },
|
|
1142
|
-
{
|
|
1143
|
-
provide: MAT_DATE_FORMATS,
|
|
1144
|
-
useValue: {
|
|
1145
|
-
parse: {
|
|
1146
|
-
dateInput: ["YYYY-MM-DD"],
|
|
1147
|
-
},
|
|
1148
|
-
display: {
|
|
1149
|
-
dateInput: "YYYY-MM-DD",
|
|
1150
|
-
monthYearLabel: "MMM YYYY",
|
|
1151
|
-
dateA11yLabel: "YYYY-MM-DD",
|
|
1152
|
-
monthYearA11yLabel: "MMMM YYYY",
|
|
1153
|
-
},
|
|
1154
|
-
},
|
|
1155
|
-
},
|
|
1156
|
-
{
|
|
1157
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1158
|
-
useExisting: forwardRef(() => DatepickerComponent),
|
|
1159
|
-
multi: true
|
|
1160
|
-
}
|
|
1107
|
+
class DatepickerComponent {
|
|
1108
|
+
constructor() {
|
|
1109
|
+
this.invalid = false;
|
|
1110
|
+
}
|
|
1111
|
+
ngOnInit() {
|
|
1112
|
+
}
|
|
1113
|
+
// onChange(newValue) {
|
|
1114
|
+
// this.value = newValue;
|
|
1115
|
+
// this.valueChange.emit(newValue);
|
|
1116
|
+
// }
|
|
1117
|
+
clear() {
|
|
1118
|
+
this.value = undefined;
|
|
1119
|
+
// this.valueChange.emit();
|
|
1120
|
+
}
|
|
1121
|
+
// Clear input field if entered data is invalid (Mat library sets value to null if invalid but doesn't clear input)
|
|
1122
|
+
onBlur(newValue) {
|
|
1123
|
+
if (!this.value) {
|
|
1124
|
+
this.value = undefined;
|
|
1125
|
+
// this.valueChange.emit();
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
writeValue(value) {
|
|
1129
|
+
if (value !== undefined) {
|
|
1130
|
+
this.value = value;
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
registerOnChange(fn) {
|
|
1134
|
+
this.onChange = () => {
|
|
1135
|
+
fn(this.value);
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
registerOnTouched(fn) { }
|
|
1139
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1140
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: DatepickerComponent, selector: "hci-dict-datepicker", inputs: { placeholder: "placeholder", invalid: "invalid" }, providers: [
|
|
1141
|
+
{ provide: MAT_DATE_LOCALE, useValue: "en-GB" },
|
|
1142
|
+
{
|
|
1143
|
+
provide: MAT_DATE_FORMATS,
|
|
1144
|
+
useValue: {
|
|
1145
|
+
parse: {
|
|
1146
|
+
dateInput: ["YYYY-MM-DD"],
|
|
1147
|
+
},
|
|
1148
|
+
display: {
|
|
1149
|
+
dateInput: "YYYY-MM-DD",
|
|
1150
|
+
monthYearLabel: "MMM YYYY",
|
|
1151
|
+
dateA11yLabel: "YYYY-MM-DD",
|
|
1152
|
+
monthYearA11yLabel: "MMMM YYYY",
|
|
1153
|
+
},
|
|
1154
|
+
},
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1158
|
+
useExisting: forwardRef(() => DatepickerComponent),
|
|
1159
|
+
multi: true
|
|
1160
|
+
}
|
|
1161
1161
|
], ngImport: i0, template: `
|
|
1162
1162
|
<div class="d-flex" style="width: 100%;">
|
|
1163
1163
|
<input matInput [matDatepicker]="picker" class="form-control" [placeholder]="placeholder" [(ngModel)]="value" (ngModelChange)="onChange($event)"
|
|
@@ -1167,10 +1167,10 @@ class DatepickerComponent {
|
|
|
1167
1167
|
<button class="btn btn-outline-secondary" type="button" (click)="picker.open()" style="height:32px; width:32px;"><i class="fas fa-calendar-alt"></i></button>
|
|
1168
1168
|
<mat-datepicker panelClass="ag-custom-component-popup" #picker ></mat-datepicker>
|
|
1169
1169
|
</div>
|
|
1170
|
-
`, isInline: true, styles: ["#clearIcon{cursor:pointer}#clearIcon:Hover{background-color:#495057;color:#e9ecef}\n"], dependencies: [{ kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }] }); }
|
|
1171
|
-
}
|
|
1172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1173
|
-
type: Component,
|
|
1170
|
+
`, isInline: true, styles: ["#clearIcon{cursor:pointer}#clearIcon:Hover{background-color:#495057;color:#e9ecef}\n"], dependencies: [{ kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i3$1.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }] }); }
|
|
1171
|
+
}
|
|
1172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DatepickerComponent, decorators: [{
|
|
1173
|
+
type: Component,
|
|
1174
1174
|
args: [{ selector: "hci-dict-datepicker", template: `
|
|
1175
1175
|
<div class="d-flex" style="width: 100%;">
|
|
1176
1176
|
<input matInput [matDatepicker]="picker" class="form-control" [placeholder]="placeholder" [(ngModel)]="value" (ngModelChange)="onChange($event)"
|
|
@@ -1180,627 +1180,627 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1180
1180
|
<button class="btn btn-outline-secondary" type="button" (click)="picker.open()" style="height:32px; width:32px;"><i class="fas fa-calendar-alt"></i></button>
|
|
1181
1181
|
<mat-datepicker panelClass="ag-custom-component-popup" #picker ></mat-datepicker>
|
|
1182
1182
|
</div>
|
|
1183
|
-
`, providers: [
|
|
1184
|
-
{ provide: MAT_DATE_LOCALE, useValue: "en-GB" },
|
|
1185
|
-
{
|
|
1186
|
-
provide: MAT_DATE_FORMATS,
|
|
1187
|
-
useValue: {
|
|
1188
|
-
parse: {
|
|
1189
|
-
dateInput: ["YYYY-MM-DD"],
|
|
1190
|
-
},
|
|
1191
|
-
display: {
|
|
1192
|
-
dateInput: "YYYY-MM-DD",
|
|
1193
|
-
monthYearLabel: "MMM YYYY",
|
|
1194
|
-
dateA11yLabel: "YYYY-MM-DD",
|
|
1195
|
-
monthYearA11yLabel: "MMMM YYYY",
|
|
1196
|
-
},
|
|
1197
|
-
},
|
|
1198
|
-
},
|
|
1199
|
-
{
|
|
1200
|
-
provide: NG_VALUE_ACCESSOR,
|
|
1201
|
-
useExisting: forwardRef(() => DatepickerComponent),
|
|
1202
|
-
multi: true
|
|
1203
|
-
}
|
|
1204
|
-
], styles: ["#clearIcon{cursor:pointer}#clearIcon:Hover{background-color:#495057;color:#e9ecef}\n"] }]
|
|
1205
|
-
}], propDecorators: { placeholder: [{
|
|
1206
|
-
type: Input
|
|
1207
|
-
}], invalid: [{
|
|
1208
|
-
type: Input
|
|
1183
|
+
`, providers: [
|
|
1184
|
+
{ provide: MAT_DATE_LOCALE, useValue: "en-GB" },
|
|
1185
|
+
{
|
|
1186
|
+
provide: MAT_DATE_FORMATS,
|
|
1187
|
+
useValue: {
|
|
1188
|
+
parse: {
|
|
1189
|
+
dateInput: ["YYYY-MM-DD"],
|
|
1190
|
+
},
|
|
1191
|
+
display: {
|
|
1192
|
+
dateInput: "YYYY-MM-DD",
|
|
1193
|
+
monthYearLabel: "MMM YYYY",
|
|
1194
|
+
dateA11yLabel: "YYYY-MM-DD",
|
|
1195
|
+
monthYearA11yLabel: "MMMM YYYY",
|
|
1196
|
+
},
|
|
1197
|
+
},
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1201
|
+
useExisting: forwardRef(() => DatepickerComponent),
|
|
1202
|
+
multi: true
|
|
1203
|
+
}
|
|
1204
|
+
], styles: ["#clearIcon{cursor:pointer}#clearIcon:Hover{background-color:#495057;color:#e9ecef}\n"] }]
|
|
1205
|
+
}], propDecorators: { placeholder: [{
|
|
1206
|
+
type: Input
|
|
1207
|
+
}], invalid: [{
|
|
1208
|
+
type: Input
|
|
1209
1209
|
}] } });
|
|
1210
1210
|
|
|
1211
|
-
class AgGridDateCellEditorComponent {
|
|
1212
|
-
agInit(params) {
|
|
1213
|
-
console.log("agInit Date Picker");
|
|
1214
|
-
console.log(params);
|
|
1215
|
-
this.params = params;
|
|
1216
|
-
this.value = this.params.value;
|
|
1217
|
-
}
|
|
1218
|
-
getValue() {
|
|
1219
|
-
return this.value;
|
|
1220
|
-
}
|
|
1221
|
-
isPopup() {
|
|
1222
|
-
return true;
|
|
1223
|
-
}
|
|
1224
|
-
;
|
|
1225
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1226
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1211
|
+
class AgGridDateCellEditorComponent {
|
|
1212
|
+
agInit(params) {
|
|
1213
|
+
console.log("agInit Date Picker");
|
|
1214
|
+
console.log(params);
|
|
1215
|
+
this.params = params;
|
|
1216
|
+
this.value = this.params.value;
|
|
1217
|
+
}
|
|
1218
|
+
getValue() {
|
|
1219
|
+
return this.value;
|
|
1220
|
+
}
|
|
1221
|
+
isPopup() {
|
|
1222
|
+
return true;
|
|
1223
|
+
}
|
|
1224
|
+
;
|
|
1225
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AgGridDateCellEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1226
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: AgGridDateCellEditorComponent, selector: "ag-grid-date-cell-editor", ngImport: i0, template: `
|
|
1227
1227
|
<hci-dict-datepicker [(ngModel)]="value" placeholder="Select Date"></hci-dict-datepicker>
|
|
1228
1228
|
|
|
1229
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: DatepickerComponent, selector: "hci-dict-datepicker", inputs: ["placeholder", "invalid"] }] }); }
|
|
1230
|
-
}
|
|
1231
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1232
|
-
type: Component,
|
|
1233
|
-
args: [{
|
|
1234
|
-
selector: "ag-grid-date-cell-editor",
|
|
1229
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: DatepickerComponent, selector: "hci-dict-datepicker", inputs: ["placeholder", "invalid"] }] }); }
|
|
1230
|
+
}
|
|
1231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AgGridDateCellEditorComponent, decorators: [{
|
|
1232
|
+
type: Component,
|
|
1233
|
+
args: [{
|
|
1234
|
+
selector: "ag-grid-date-cell-editor",
|
|
1235
1235
|
template: `
|
|
1236
1236
|
<hci-dict-datepicker [(ngModel)]="value" placeholder="Select Date"></hci-dict-datepicker>
|
|
1237
1237
|
|
|
1238
|
-
`
|
|
1239
|
-
}]
|
|
1238
|
+
`
|
|
1239
|
+
}]
|
|
1240
1240
|
}] });
|
|
1241
1241
|
|
|
1242
|
-
/**
|
|
1243
|
-
* When a dictionary is selected this component is shown. There is a top grid which for its data shows all the columns
|
|
1244
|
-
* for the dictionary. Currently, keep this for reference only and have non-editable.
|
|
1245
|
-
* The bottom grid will show those columns as actual columns and its data are all the dictionary values. Rows can be
|
|
1246
|
-
* added. For deleting, need to make sure the id is not used anywhere. For editing, need to make sure the code or anything
|
|
1247
|
-
* else isn't being referenced.
|
|
1248
|
-
*
|
|
1249
|
-
* @since 1.0.0
|
|
1250
|
-
*/
|
|
1251
|
-
class DictionaryEditorDetailComponent {
|
|
1252
|
-
constructor(route, modalService, dictionaryService, dictionaryEndpoint) {
|
|
1253
|
-
this.route = route;
|
|
1254
|
-
this.modalService = modalService;
|
|
1255
|
-
this.dictionaryService = dictionaryService;
|
|
1256
|
-
this.dictionaryEndpoint = dictionaryEndpoint;
|
|
1257
|
-
this.classList = "outlet-column y-auto";
|
|
1258
|
-
this.dictionaryEntries = [];
|
|
1259
|
-
this.selectedRows = [];
|
|
1260
|
-
this.loadingSubjects = [];
|
|
1261
|
-
this.metaGridOptions = {
|
|
1262
|
-
rowStyle: {
|
|
1263
|
-
"font-family": "Prompt, sans-serif"
|
|
1264
|
-
},
|
|
1265
|
-
enableCellTextSelection: true,
|
|
1266
|
-
ensureDomOrder: true
|
|
1267
|
-
};
|
|
1268
|
-
this.gridOptions = {
|
|
1269
|
-
context: {
|
|
1270
|
-
componentParent: this
|
|
1271
|
-
},
|
|
1272
|
-
onGridReady: DictionaryEditorDetailComponent.onSamplesGridReady,
|
|
1273
|
-
onGridSizeChanged: DictionaryEditorDetailComponent.onGridSizeChanged,
|
|
1274
|
-
suppressHorizontalScroll: false,
|
|
1275
|
-
selectionMode: "multiple",
|
|
1276
|
-
stopEditingWhenGridLosesFocus: true,
|
|
1277
|
-
enableSorting: true,
|
|
1278
|
-
enableFilter: true
|
|
1279
|
-
};
|
|
1280
|
-
}
|
|
1281
|
-
/**
|
|
1282
|
-
* Based on the route class name, make the call to fetch the dictionary data. Since this component is route based,
|
|
1283
|
-
* when the dictionary class in the route changes, this component is reloaded.
|
|
1284
|
-
*/
|
|
1285
|
-
ngOnInit() {
|
|
1286
|
-
this.boundNewRowPostCall = this.newRowPost.bind(this);
|
|
1287
|
-
this.loadingSubjects.push(new BehaviorSubject(false));
|
|
1288
|
-
this.loadingSubjects.push(new BehaviorSubject(false));
|
|
1289
|
-
this.route.params.subscribe(params => {
|
|
1290
|
-
let className = params["className"];
|
|
1291
|
-
this.getDictionary(className);
|
|
1292
|
-
});
|
|
1293
|
-
}
|
|
1294
|
-
openModal(modal) {
|
|
1295
|
-
this.modalService.open(modal, { windowClass: "modal-xl" }).result.then((result) => {
|
|
1296
|
-
}, (reason) => {
|
|
1297
|
-
});
|
|
1298
|
-
}
|
|
1299
|
-
ngAfterViewInit() {
|
|
1300
|
-
this.gridOptions.api.sizeColumnsToFit();
|
|
1301
|
-
}
|
|
1302
|
-
columnDefMeta() {
|
|
1303
|
-
return [
|
|
1304
|
-
{ field: "name", headerName: "Name", width: 175, sortable: true, resizable: true, editable: false },
|
|
1305
|
-
{ field: "description", headerName: "Description", width: 250, sortable: true, resizable: true, editable: false },
|
|
1306
|
-
{ field: "id", headerName: "Id", width: 60, sortable: true, resizable: true, editable: false },
|
|
1307
|
-
{ field: "type", headerName: "Type", sortable: true, resizable: true, editable: false },
|
|
1308
|
-
{ field: "protectionType", headerName: "ProtectionType", sortable: true, resizable: true, editable: false },
|
|
1309
|
-
{ field: "filterDictionaryClass", headerName: "FilterDictionaryClass", width: 180, sortable: true, resizable: true, editable: false },
|
|
1310
|
-
{ field: "notNull", headerName: "NotNull", sortable: true, resizable: true, editable: false },
|
|
1311
|
-
{ field: "integer", headerName: "Integer", width: 75, sortable: true, resizable: true, editable: false },
|
|
1312
|
-
{ field: "min", headerName: "Min", width: 60, sortable: true, resizable: true, editable: false },
|
|
1313
|
-
{ field: "max", headerName: "Max", width: 60, sortable: true, resizable: true, editable: false },
|
|
1314
|
-
{ field: "fraction", headerName: "Fraction", sortable: true, resizable: true, editable: false },
|
|
1315
|
-
{ field: "dictionaryTooltip", headerName: "DictionaryTooltip", width: 200, sortable: true, resizable: true, editable: false },
|
|
1316
|
-
{ field: "dictionaryDisplay", headerName: "DictionaryDisplay", width: 175, sortable: true, resizable: true, editable: false },
|
|
1317
|
-
{ field: "filterable", headerName: "Filterable", sortable: true, resizable: true, editable: false },
|
|
1318
|
-
{ field: "displayName", headerName: "DisplayName", width: 175, sortable: true, resizable: true, editable: false },
|
|
1319
|
-
{ field: "displayOrder", headerName: "DisplayOrder", width: 60, sortable: true, resizable: true, editable: false },
|
|
1320
|
-
{ field: "cellStyle", headerName: "CellStyle", sortable: true, resizable: true, editable: false },
|
|
1321
|
-
]; // the widths for the last 2 could be wrong.
|
|
1322
|
-
}
|
|
1323
|
-
onMetaGridReady(params) {
|
|
1324
|
-
this.gridApiMeta = params.api;
|
|
1325
|
-
this.gridApiMeta.setColumnDefs(this.columnDefMeta());
|
|
1326
|
-
this.gridApiMeta.setRowData(this.dictionary?.fields);
|
|
1327
|
-
// this.gridApiMeta.sizeColumnsToFit();
|
|
1328
|
-
}
|
|
1329
|
-
openAreYouSureModal(modal) {
|
|
1330
|
-
this.modalService.open(modal).result.then((result) => {
|
|
1331
|
-
if (result === "Delete") {
|
|
1332
|
-
this.deleteDictionaryEntries();
|
|
1333
|
-
}
|
|
1334
|
-
}, (reason) => {
|
|
1335
|
-
});
|
|
1336
|
-
}
|
|
1337
|
-
/**
|
|
1338
|
-
* Fetch the dictionary metadata and dictionary entries based upon the dictionary class name.
|
|
1339
|
-
*
|
|
1340
|
-
* @param {string} className
|
|
1341
|
-
*/
|
|
1342
|
-
getDictionary(className) {
|
|
1343
|
-
// When Selecting A New Dictionary, Navigate To First Page
|
|
1344
|
-
if (this.gridOptions && this.gridOptions.api) {
|
|
1345
|
-
this.gridOptions.api.paginationGoToFirstPage();
|
|
1346
|
-
}
|
|
1347
|
-
this.className = className;
|
|
1348
|
-
this.dataColumns = undefined;
|
|
1349
|
-
this.loadingSubjects[0].next(true);
|
|
1350
|
-
this.dictionaryService.getDictionary(className)
|
|
1351
|
-
.pipe(finalize(() => {
|
|
1352
|
-
this.loadingSubjects[0].next(false);
|
|
1353
|
-
})).subscribe((dictionary) => {
|
|
1354
|
-
this.setUpDictionaryGrid(dictionary);
|
|
1355
|
-
this.loadingSubjects[0].next(false);
|
|
1356
|
-
});
|
|
1357
|
-
this.getDictionaryEntries();
|
|
1358
|
-
}
|
|
1359
|
-
getDictionaryEntries() {
|
|
1360
|
-
this.loadingSubjects[1].next(true);
|
|
1361
|
-
this.dictionaryService.getDictionaryEntries(this.className)
|
|
1362
|
-
.pipe(finalize(() => {
|
|
1363
|
-
this.loadingSubjects[1].next(false);
|
|
1364
|
-
})).subscribe((dictionaryEntries) => {
|
|
1365
|
-
this.dictionaryEntries = dictionaryEntries;
|
|
1366
|
-
this.gridOptions.api.setRowData(dictionaryEntries);
|
|
1367
|
-
this.gridOptions.api.sizeColumnsToFit();
|
|
1368
|
-
this.loadingSubjects[1].next(false);
|
|
1369
|
-
});
|
|
1370
|
-
}
|
|
1371
|
-
/**
|
|
1372
|
-
* Set the dictionary metadata. This is used to build the columns for the dictionary entries. The names, validation,
|
|
1373
|
-
* and filter classes build the column definition.
|
|
1374
|
-
*
|
|
1375
|
-
* @param dictionary
|
|
1376
|
-
*/
|
|
1377
|
-
setUpDictionaryGrid(dictionary) {
|
|
1378
|
-
if (isDevMode()) {
|
|
1379
|
-
console.debug("DictionaryEditorDetailComponent.setDictionary");
|
|
1380
|
-
console.debug(dictionary);
|
|
1381
|
-
}
|
|
1382
|
-
this.dictionary = dictionary;
|
|
1383
|
-
this.secondaryDictionaryEntries = [];
|
|
1384
|
-
let dictionaryClassNames = [];
|
|
1385
|
-
for (let field of dictionary.fields) {
|
|
1386
|
-
if (field.filterDictionaryClass) {
|
|
1387
|
-
dictionaryClassNames.push(field.filterDictionaryClass);
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
this.getSecondaryDictionaries(dictionaryClassNames);
|
|
1391
|
-
}
|
|
1392
|
-
getSecondaryDictionaries(dictionaryNames) {
|
|
1393
|
-
if (dictionaryNames.length == 0) {
|
|
1394
|
-
this.finishColumnSetup();
|
|
1395
|
-
}
|
|
1396
|
-
else {
|
|
1397
|
-
let dictionaryName = dictionaryNames.pop();
|
|
1398
|
-
this.dictionaryService.getDictionaryDropdownEntries(dictionaryName).subscribe((response) => {
|
|
1399
|
-
this.secondaryDictionaryEntries.push({ dictionaryName: dictionaryName, entries: response });
|
|
1400
|
-
this.getSecondaryDictionaries(dictionaryNames);
|
|
1401
|
-
});
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
finishColumnSetup() {
|
|
1405
|
-
this.displayName = this.dictionary.displayName;
|
|
1406
|
-
// This establishes the readOnly functionality
|
|
1407
|
-
let cols = [];
|
|
1408
|
-
// Process Columns And Create Column Definition
|
|
1409
|
-
for (let field of this.dictionary.fields) {
|
|
1410
|
-
if (field.id && (isNullOrUndefined(field.code) || field.code == false)) {
|
|
1411
|
-
continue;
|
|
1412
|
-
}
|
|
1413
|
-
let col;
|
|
1414
|
-
if (field.filterDictionaryClass) {
|
|
1415
|
-
// this is a dropdown of another dictionary
|
|
1416
|
-
let options = this.secondaryDictionaryEntries.find((a) => {
|
|
1417
|
-
return a.dictionaryName === field.filterDictionaryClass;
|
|
1418
|
-
});
|
|
1419
|
-
col = {
|
|
1420
|
-
field: field.name,
|
|
1421
|
-
headerName: field.displayName,
|
|
1422
|
-
editable: this.isEditable.bind(this),
|
|
1423
|
-
cellRendererFramework: SelectRenderer,
|
|
1424
|
-
cellEditorFramework: SelectEditor,
|
|
1425
|
-
selectOptionsDisplayField: "display",
|
|
1426
|
-
selectOptionsValueField: "id",
|
|
1427
|
-
sortable: true,
|
|
1428
|
-
resizable: true,
|
|
1429
|
-
filter: true,
|
|
1430
|
-
filterValueGetter: this.comboFilterValueGetter,
|
|
1431
|
-
selectOptions: [],
|
|
1432
|
-
comparator: (valueA, valueB, nodeA, nodeB, isInverted) => {
|
|
1433
|
-
return 0;
|
|
1434
|
-
}
|
|
1435
|
-
};
|
|
1436
|
-
if (options && options.entries) {
|
|
1437
|
-
col.selectOptions = options.entries.sort((optionA, optionB) => {
|
|
1438
|
-
if (optionA && !optionB) {
|
|
1439
|
-
return 1;
|
|
1440
|
-
}
|
|
1441
|
-
if (optionB && !optionA) {
|
|
1442
|
-
return -1;
|
|
1443
|
-
}
|
|
1444
|
-
if (!optionA && !optionB) {
|
|
1445
|
-
return 0;
|
|
1446
|
-
}
|
|
1447
|
-
if (optionA.display.toLowerCase() > optionB.display.toLowerCase()) {
|
|
1448
|
-
return 1;
|
|
1449
|
-
}
|
|
1450
|
-
else if ((optionB.display.toLowerCase() > optionA.display.toLowerCase())) {
|
|
1451
|
-
return -1;
|
|
1452
|
-
}
|
|
1453
|
-
else {
|
|
1454
|
-
return 0;
|
|
1455
|
-
}
|
|
1456
|
-
});
|
|
1457
|
-
col.comparator = (valueA, valueB, nodeA, nodeB, isInverted) => {
|
|
1458
|
-
if (!options.entries) {
|
|
1459
|
-
return 0;
|
|
1460
|
-
}
|
|
1461
|
-
if (valueA && !valueB) {
|
|
1462
|
-
return 1;
|
|
1463
|
-
}
|
|
1464
|
-
if (valueB && !valueA) {
|
|
1465
|
-
return -1;
|
|
1466
|
-
}
|
|
1467
|
-
if (!valueA && !valueB) {
|
|
1468
|
-
return 0;
|
|
1469
|
-
}
|
|
1470
|
-
let optionA = options.entries.find((entry) => ("" + entry.id === "" + valueA));
|
|
1471
|
-
let optionB = options.entries.find((entry) => ("" + entry.id === "" + valueB));
|
|
1472
|
-
if (optionA && !optionB) {
|
|
1473
|
-
return 1;
|
|
1474
|
-
}
|
|
1475
|
-
if (optionB && !optionA) {
|
|
1476
|
-
return -1;
|
|
1477
|
-
}
|
|
1478
|
-
if (!optionA && !optionB) {
|
|
1479
|
-
return 0;
|
|
1480
|
-
}
|
|
1481
|
-
if (optionA.display.toLowerCase() > optionB.display.toLowerCase()) {
|
|
1482
|
-
return 1;
|
|
1483
|
-
}
|
|
1484
|
-
else if ((optionB.display.toLowerCase() > optionA.display.toLowerCase())) {
|
|
1485
|
-
return -1;
|
|
1486
|
-
}
|
|
1487
|
-
else {
|
|
1488
|
-
return 0;
|
|
1489
|
-
}
|
|
1490
|
-
};
|
|
1491
|
-
}
|
|
1492
|
-
col.cellStyle = params => {
|
|
1493
|
-
let column = {};
|
|
1494
|
-
for (let field of params.context.componentParent.dictionary.fields) {
|
|
1495
|
-
if (params.colDef.field == field.name) {
|
|
1496
|
-
column = field;
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
if (params.data.editOrNew && params.data.editOrNew == "new") {
|
|
1500
|
-
if (params.context.readOnly || column.readOnly ||
|
|
1501
|
-
column.protectionType == "Read Only") {
|
|
1502
|
-
return { color: "#8a9499" };
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
else {
|
|
1506
|
-
if (params.context.readOnly || column.readOnly ||
|
|
1507
|
-
column.protectionType == "Read Only" || column.createOnly ||
|
|
1508
|
-
column.protectionType == "Create Only" || column.code) {
|
|
1509
|
-
return { color: "#8a9499" };
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
};
|
|
1513
|
-
col.displayOrder = field.displayOrder;
|
|
1514
|
-
col.dictionaryDisplay = field.dictionaryDisplay;
|
|
1515
|
-
col.dictionaryTooltip = field.dictionaryTooltip;
|
|
1516
|
-
// Set default filter as compare by text/number
|
|
1517
|
-
// col.filterRenderer = CompareFilterRenderer;
|
|
1518
|
-
}
|
|
1519
|
-
else if (field.type && field.type == "Date") {
|
|
1520
|
-
//date value
|
|
1521
|
-
col = {
|
|
1522
|
-
field: field.name,
|
|
1523
|
-
headerName: field.displayName,
|
|
1524
|
-
cellRendererFramework: DateRenderer,
|
|
1525
|
-
cellEditorFramework: AgGridDateCellEditorComponent,
|
|
1526
|
-
editable: this.isEditable.bind(this),
|
|
1527
|
-
sortable: true,
|
|
1528
|
-
resizable: true,
|
|
1529
|
-
filter: true,
|
|
1530
|
-
dictionaryDisplay: field.dictionaryDisplay
|
|
1531
|
-
};
|
|
1532
|
-
col.comparator = (valueA, valueB, nodeA, nodeB, isInverted) => {
|
|
1533
|
-
let num = this.dateComparator(valueA, valueB);
|
|
1534
|
-
return isInverted ? -1 * num : num; //don't have to do anything with inverted?
|
|
1535
|
-
};
|
|
1536
|
-
col.cellStyle = params => {
|
|
1537
|
-
var column = {};
|
|
1538
|
-
for (let field of params.context.componentParent.dictionary.fields) {
|
|
1539
|
-
if (params.colDef.field == field.name) {
|
|
1540
|
-
column = field;
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
if (params.data.editOrNew && params.data.editOrNew == "new") {
|
|
1544
|
-
if (params.context.readOnly || column.readOnly ||
|
|
1545
|
-
column.protectionType == "Read Only") {
|
|
1546
|
-
return { color: "#8a9499" };
|
|
1547
|
-
}
|
|
1548
|
-
}
|
|
1549
|
-
else {
|
|
1550
|
-
if (params.context.readOnly || column.readOnly ||
|
|
1551
|
-
column.protectionType == "Read Only" || column.createOnly ||
|
|
1552
|
-
column.protectionType == "Create Only" || column.code) {
|
|
1553
|
-
return { color: "#8a9499" };
|
|
1554
|
-
}
|
|
1555
|
-
}
|
|
1556
|
-
};
|
|
1557
|
-
col.displayOrder = field.displayOrder;
|
|
1558
|
-
}
|
|
1559
|
-
else {
|
|
1560
|
-
// this is a string value
|
|
1561
|
-
col = {
|
|
1562
|
-
field: field.name,
|
|
1563
|
-
headerName: field.displayName,
|
|
1564
|
-
editable: this.isEditable.bind(this),
|
|
1565
|
-
sortable: true,
|
|
1566
|
-
resizable: true,
|
|
1567
|
-
filter: true,
|
|
1568
|
-
dictionaryDisplay: field.dictionaryDisplay
|
|
1569
|
-
};
|
|
1570
|
-
col.comparator = (valueA, valueB, nodeA, nodeB, isInverted) => {
|
|
1571
|
-
if (valueA && !valueB) {
|
|
1572
|
-
return 1;
|
|
1573
|
-
}
|
|
1574
|
-
if (valueB && !valueA) {
|
|
1575
|
-
return -1;
|
|
1576
|
-
}
|
|
1577
|
-
if (!valueA && !valueB) {
|
|
1578
|
-
return 0;
|
|
1579
|
-
}
|
|
1580
|
-
if (valueA.toLowerCase() > valueB.toLowerCase()) {
|
|
1581
|
-
return 1;
|
|
1582
|
-
}
|
|
1583
|
-
else if ((valueB.toLowerCase() > valueA.toLowerCase())) {
|
|
1584
|
-
return -1;
|
|
1585
|
-
}
|
|
1586
|
-
else {
|
|
1587
|
-
return 0;
|
|
1588
|
-
}
|
|
1589
|
-
};
|
|
1590
|
-
col.cellStyle = params => {
|
|
1591
|
-
var column = {};
|
|
1592
|
-
for (let field of params.context.componentParent.dictionary.fields) {
|
|
1593
|
-
if (params.colDef.field == field.name) {
|
|
1594
|
-
column = field;
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
if (params.data.editOrNew && params.data.editOrNew == "new") {
|
|
1598
|
-
if (params.context.readOnly || column.readOnly ||
|
|
1599
|
-
column.protectionType == "Read Only") {
|
|
1600
|
-
return { color: "#8a9499" };
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
else {
|
|
1604
|
-
if (params.context.readOnly || column.readOnly ||
|
|
1605
|
-
column.protectionType == "Read Only" || column.createOnly ||
|
|
1606
|
-
column.protectionType == "Create Only" || column.code) {
|
|
1607
|
-
return { color: "#8a9499" };
|
|
1608
|
-
}
|
|
1609
|
-
}
|
|
1610
|
-
};
|
|
1611
|
-
col.displayOrder = field.displayOrder;
|
|
1612
|
-
// Set default filter as compare by text/number
|
|
1613
|
-
// col.filterRenderer = CompareFilterRenderer;
|
|
1614
|
-
}
|
|
1615
|
-
cols.push(col);
|
|
1616
|
-
}
|
|
1617
|
-
// Now we need to sort the columns
|
|
1618
|
-
if (!this.dictionary.fields[0].hasOwnProperty("displayOrder")) {
|
|
1619
|
-
// default case, no displayOrder
|
|
1620
|
-
cols = cols.sort((a, b) => {
|
|
1621
|
-
if (!a.headerName && b.headerName) {
|
|
1622
|
-
return 1;
|
|
1623
|
-
}
|
|
1624
|
-
else if (!b.headerName && a.headerName) {
|
|
1625
|
-
return -1;
|
|
1626
|
-
}
|
|
1627
|
-
else if (a.dictionaryDisplay === true && b.dictionaryDisplay === false) {
|
|
1628
|
-
return -1;
|
|
1629
|
-
}
|
|
1630
|
-
else if (b.dictionaryDisplay === true && a.dictionaryDisplay === false) {
|
|
1631
|
-
return 1;
|
|
1632
|
-
}
|
|
1633
|
-
else if (a.dictionaryTooltip === true && b.dictionaryTooltip === false) {
|
|
1634
|
-
return -1;
|
|
1635
|
-
}
|
|
1636
|
-
else if (b.dictionaryTooltip === true && a.dictionaryTooltip === false) {
|
|
1637
|
-
return 1;
|
|
1638
|
-
}
|
|
1639
|
-
else {
|
|
1640
|
-
return 0;
|
|
1641
|
-
}
|
|
1642
|
-
});
|
|
1643
|
-
}
|
|
1644
|
-
else {
|
|
1645
|
-
// DisplayOrder case
|
|
1646
|
-
// I think this works? Check later
|
|
1647
|
-
cols = cols.sort((a, b) => {
|
|
1648
|
-
if (!a.headerName && b.headerName) {
|
|
1649
|
-
return 1;
|
|
1650
|
-
}
|
|
1651
|
-
else if (!b.headerName && a.headerName) {
|
|
1652
|
-
return -1;
|
|
1653
|
-
}
|
|
1654
|
-
else {
|
|
1655
|
-
return a.displayOrder - b.displayOrder;
|
|
1656
|
-
}
|
|
1657
|
-
});
|
|
1658
|
-
}
|
|
1659
|
-
// After Columns Have Been Sorted
|
|
1660
|
-
// Dictionary Grid Will Sort The Grid Ascending Order By First Column
|
|
1661
|
-
if (cols && cols.length != 0) {
|
|
1662
|
-
cols[0].sort = "asc";
|
|
1663
|
-
}
|
|
1664
|
-
this.dataColumns = cols;
|
|
1665
|
-
if (Array.isArray(this.dataColumns) && this.gridOptions && this.gridOptions.api) {
|
|
1666
|
-
this.gridOptions.api.setColumnDefs(this.dataColumns);
|
|
1667
|
-
this.gridOptions.api.sizeColumnsToFit();
|
|
1668
|
-
}
|
|
1669
|
-
}
|
|
1670
|
-
isEditable(params) {
|
|
1671
|
-
let isEditable;
|
|
1672
|
-
let column = {};
|
|
1673
|
-
for (let field of this.dictionary.fields) {
|
|
1674
|
-
if (params.colDef.field == field.name) {
|
|
1675
|
-
column = field;
|
|
1676
|
-
}
|
|
1677
|
-
}
|
|
1678
|
-
if (params.data.editOrNew && params.data.editOrNew == "new") {
|
|
1679
|
-
// console.log("new editable?");
|
|
1680
|
-
isEditable = !(this.dictionary.readOnly || column.readOnly ||
|
|
1681
|
-
column.protectionType == "Read Only");
|
|
1682
|
-
}
|
|
1683
|
-
else {
|
|
1684
|
-
// console.log("edit editable?");
|
|
1685
|
-
isEditable = !(this.dictionary.readOnly || column.readOnly ||
|
|
1686
|
-
column.protectionType == "Read Only" || column.createOnly ||
|
|
1687
|
-
column.protectionType == "Create Only" || column.code);
|
|
1688
|
-
}
|
|
1689
|
-
return isEditable;
|
|
1690
|
-
}
|
|
1691
|
-
deleteDictionaryEntries() {
|
|
1692
|
-
let deleteRows = this.gridOptions.api.getSelectedRows();
|
|
1693
|
-
for (let deleteId of this.selectedRows) {
|
|
1694
|
-
for (let entry of this.dictionaryEntries) {
|
|
1695
|
-
if (entry[this.idColumn] === deleteId) {
|
|
1696
|
-
deleteRows.push(entry);
|
|
1697
|
-
break;
|
|
1698
|
-
}
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
this.dictionaryService.deleteDictionaryEntries(this.className, deleteRows).subscribe((response) => {
|
|
1702
|
-
this.getDictionaryEntries();
|
|
1703
|
-
});
|
|
1704
|
-
}
|
|
1705
|
-
updateDictionary(event) {
|
|
1706
|
-
// Important to note this will not update cells to the demo but will when imported to CORE or other applications.
|
|
1707
|
-
this.dictionaryService.updateDictionaryEntries(this.className, [event.data]).subscribe((data) => {
|
|
1708
|
-
this.getDictionaryEntries();
|
|
1709
|
-
});
|
|
1710
|
-
}
|
|
1711
|
-
setSelectedEntries() {
|
|
1712
|
-
this.selectedRows = this.gridOptions.api.getSelectedRows();
|
|
1713
|
-
}
|
|
1714
|
-
newRowPost(data) {
|
|
1715
|
-
return this.dictionaryService.addDictionaryEntries(this.className, [data])
|
|
1716
|
-
.pipe(map((data) => {
|
|
1717
|
-
if (data && data.length === 1) {
|
|
1718
|
-
return data[0];
|
|
1719
|
-
}
|
|
1720
|
-
else {
|
|
1721
|
-
return data;
|
|
1722
|
-
}
|
|
1723
|
-
}));
|
|
1724
|
-
}
|
|
1725
|
-
static onSamplesGridReady(event) {
|
|
1726
|
-
event.api.sizeColumnsToFit();
|
|
1727
|
-
}
|
|
1728
|
-
static onGridSizeChanged(event) {
|
|
1729
|
-
if (event && event.api) {
|
|
1730
|
-
event.api.sizeColumnsToFit();
|
|
1731
|
-
}
|
|
1732
|
-
}
|
|
1733
|
-
get disableAddRow() {
|
|
1734
|
-
if (!this.dictionary) {
|
|
1735
|
-
return true;
|
|
1736
|
-
}
|
|
1737
|
-
return this.dictionary.readOnly && this.dictionary.readOnly === true;
|
|
1738
|
-
}
|
|
1739
|
-
get disableDelete() {
|
|
1740
|
-
if (!this.dictionary) {
|
|
1741
|
-
return true;
|
|
1742
|
-
}
|
|
1743
|
-
if (this.dictionary.readOnly && this.dictionary.readOnly === true) {
|
|
1744
|
-
return true;
|
|
1745
|
-
}
|
|
1746
|
-
if (this.gridOptions && this.gridOptions.api && this.gridOptions.api.getSelectedRows()) {
|
|
1747
|
-
return this.gridOptions.api.getSelectedRows().length === 0;
|
|
1748
|
-
}
|
|
1749
|
-
else {
|
|
1750
|
-
return true;
|
|
1751
|
-
}
|
|
1752
|
-
}
|
|
1753
|
-
comboFilterValueGetter(params) {
|
|
1754
|
-
let value = params.data[params.colDef.field];
|
|
1755
|
-
if (value) {
|
|
1756
|
-
let option = params.colDef.selectOptions.find((entry) => (entry[params.colDef.selectOptionsValueField] === value));
|
|
1757
|
-
return option ? option[params.colDef.selectOptionsDisplayField] : "";
|
|
1758
|
-
}
|
|
1759
|
-
return "";
|
|
1760
|
-
}
|
|
1761
|
-
onClickAddRow() {
|
|
1762
|
-
const modalRef = this.modalService.open(NewRowComponent, {
|
|
1763
|
-
size: "lg",
|
|
1764
|
-
keyboard: false,
|
|
1765
|
-
backdrop: "static",
|
|
1766
|
-
centered: true,
|
|
1767
|
-
});
|
|
1768
|
-
modalRef.componentInstance.colDefs = this.dataColumns;
|
|
1769
|
-
modalRef.componentInstance.dictionary = this.dictionary;
|
|
1770
|
-
if (!this.newRowSubscription) {
|
|
1771
|
-
// tell other ag-grid to add row to it
|
|
1772
|
-
this.newRowSubscription = modalRef.componentInstance.newRowSubject.subscribe((theNewRow) => {
|
|
1773
|
-
this.dictionaryEntries = theNewRow.concat(this.dictionaryEntries);
|
|
1774
|
-
this.gridOptions.api.setRowData(this.dictionaryEntries);
|
|
1775
|
-
this.newRowSubscription = null;
|
|
1776
|
-
// Important to note this will not add rows to the demo but will when imported to CORE or other applications.
|
|
1777
|
-
this.newRowPost(theNewRow[0]).subscribe(() => {
|
|
1778
|
-
this.getDictionaryEntries();
|
|
1779
|
-
});
|
|
1780
|
-
});
|
|
1781
|
-
}
|
|
1782
|
-
}
|
|
1783
|
-
/**
|
|
1784
|
-
* Comparater To Compare 2 Dates
|
|
1785
|
-
* @param date1 Date 1
|
|
1786
|
-
* @param date2 Date 2
|
|
1787
|
-
*/
|
|
1788
|
-
dateComparator(date1, date2) {
|
|
1789
|
-
let date1Number = monthToComparableNumber(date1);
|
|
1790
|
-
let date2Number = monthToComparableNumber(date2);
|
|
1791
|
-
if (date1Number === null && date2Number === null) {
|
|
1792
|
-
return 0;
|
|
1793
|
-
}
|
|
1794
|
-
if (date1Number === null) {
|
|
1795
|
-
return -1;
|
|
1796
|
-
}
|
|
1797
|
-
if (date2Number === null) {
|
|
1798
|
-
return 1;
|
|
1799
|
-
}
|
|
1800
|
-
return date1Number - date2Number;
|
|
1801
|
-
}
|
|
1802
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1803
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1242
|
+
/**
|
|
1243
|
+
* When a dictionary is selected this component is shown. There is a top grid which for its data shows all the columns
|
|
1244
|
+
* for the dictionary. Currently, keep this for reference only and have non-editable.
|
|
1245
|
+
* The bottom grid will show those columns as actual columns and its data are all the dictionary values. Rows can be
|
|
1246
|
+
* added. For deleting, need to make sure the id is not used anywhere. For editing, need to make sure the code or anything
|
|
1247
|
+
* else isn't being referenced.
|
|
1248
|
+
*
|
|
1249
|
+
* @since 1.0.0
|
|
1250
|
+
*/
|
|
1251
|
+
class DictionaryEditorDetailComponent {
|
|
1252
|
+
constructor(route, modalService, dictionaryService, dictionaryEndpoint) {
|
|
1253
|
+
this.route = route;
|
|
1254
|
+
this.modalService = modalService;
|
|
1255
|
+
this.dictionaryService = dictionaryService;
|
|
1256
|
+
this.dictionaryEndpoint = dictionaryEndpoint;
|
|
1257
|
+
this.classList = "outlet-column y-auto";
|
|
1258
|
+
this.dictionaryEntries = [];
|
|
1259
|
+
this.selectedRows = [];
|
|
1260
|
+
this.loadingSubjects = [];
|
|
1261
|
+
this.metaGridOptions = {
|
|
1262
|
+
rowStyle: {
|
|
1263
|
+
"font-family": "Prompt, sans-serif"
|
|
1264
|
+
},
|
|
1265
|
+
enableCellTextSelection: true,
|
|
1266
|
+
ensureDomOrder: true
|
|
1267
|
+
};
|
|
1268
|
+
this.gridOptions = {
|
|
1269
|
+
context: {
|
|
1270
|
+
componentParent: this
|
|
1271
|
+
},
|
|
1272
|
+
onGridReady: DictionaryEditorDetailComponent.onSamplesGridReady,
|
|
1273
|
+
onGridSizeChanged: DictionaryEditorDetailComponent.onGridSizeChanged,
|
|
1274
|
+
suppressHorizontalScroll: false,
|
|
1275
|
+
selectionMode: "multiple",
|
|
1276
|
+
stopEditingWhenGridLosesFocus: true,
|
|
1277
|
+
enableSorting: true,
|
|
1278
|
+
enableFilter: true
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
/**
|
|
1282
|
+
* Based on the route class name, make the call to fetch the dictionary data. Since this component is route based,
|
|
1283
|
+
* when the dictionary class in the route changes, this component is reloaded.
|
|
1284
|
+
*/
|
|
1285
|
+
ngOnInit() {
|
|
1286
|
+
this.boundNewRowPostCall = this.newRowPost.bind(this);
|
|
1287
|
+
this.loadingSubjects.push(new BehaviorSubject(false));
|
|
1288
|
+
this.loadingSubjects.push(new BehaviorSubject(false));
|
|
1289
|
+
this.route.params.subscribe(params => {
|
|
1290
|
+
let className = params["className"];
|
|
1291
|
+
this.getDictionary(className);
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
openModal(modal) {
|
|
1295
|
+
this.modalService.open(modal, { windowClass: "modal-xl" }).result.then((result) => {
|
|
1296
|
+
}, (reason) => {
|
|
1297
|
+
});
|
|
1298
|
+
}
|
|
1299
|
+
ngAfterViewInit() {
|
|
1300
|
+
this.gridOptions.api.sizeColumnsToFit();
|
|
1301
|
+
}
|
|
1302
|
+
columnDefMeta() {
|
|
1303
|
+
return [
|
|
1304
|
+
{ field: "name", headerName: "Name", width: 175, sortable: true, resizable: true, editable: false },
|
|
1305
|
+
{ field: "description", headerName: "Description", width: 250, sortable: true, resizable: true, editable: false },
|
|
1306
|
+
{ field: "id", headerName: "Id", width: 60, sortable: true, resizable: true, editable: false },
|
|
1307
|
+
{ field: "type", headerName: "Type", sortable: true, resizable: true, editable: false },
|
|
1308
|
+
{ field: "protectionType", headerName: "ProtectionType", sortable: true, resizable: true, editable: false },
|
|
1309
|
+
{ field: "filterDictionaryClass", headerName: "FilterDictionaryClass", width: 180, sortable: true, resizable: true, editable: false },
|
|
1310
|
+
{ field: "notNull", headerName: "NotNull", sortable: true, resizable: true, editable: false },
|
|
1311
|
+
{ field: "integer", headerName: "Integer", width: 75, sortable: true, resizable: true, editable: false },
|
|
1312
|
+
{ field: "min", headerName: "Min", width: 60, sortable: true, resizable: true, editable: false },
|
|
1313
|
+
{ field: "max", headerName: "Max", width: 60, sortable: true, resizable: true, editable: false },
|
|
1314
|
+
{ field: "fraction", headerName: "Fraction", sortable: true, resizable: true, editable: false },
|
|
1315
|
+
{ field: "dictionaryTooltip", headerName: "DictionaryTooltip", width: 200, sortable: true, resizable: true, editable: false },
|
|
1316
|
+
{ field: "dictionaryDisplay", headerName: "DictionaryDisplay", width: 175, sortable: true, resizable: true, editable: false },
|
|
1317
|
+
{ field: "filterable", headerName: "Filterable", sortable: true, resizable: true, editable: false },
|
|
1318
|
+
{ field: "displayName", headerName: "DisplayName", width: 175, sortable: true, resizable: true, editable: false },
|
|
1319
|
+
{ field: "displayOrder", headerName: "DisplayOrder", width: 60, sortable: true, resizable: true, editable: false },
|
|
1320
|
+
{ field: "cellStyle", headerName: "CellStyle", sortable: true, resizable: true, editable: false },
|
|
1321
|
+
]; // the widths for the last 2 could be wrong.
|
|
1322
|
+
}
|
|
1323
|
+
onMetaGridReady(params) {
|
|
1324
|
+
this.gridApiMeta = params.api;
|
|
1325
|
+
this.gridApiMeta.setColumnDefs(this.columnDefMeta());
|
|
1326
|
+
this.gridApiMeta.setRowData(this.dictionary?.fields);
|
|
1327
|
+
// this.gridApiMeta.sizeColumnsToFit();
|
|
1328
|
+
}
|
|
1329
|
+
openAreYouSureModal(modal) {
|
|
1330
|
+
this.modalService.open(modal).result.then((result) => {
|
|
1331
|
+
if (result === "Delete") {
|
|
1332
|
+
this.deleteDictionaryEntries();
|
|
1333
|
+
}
|
|
1334
|
+
}, (reason) => {
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
/**
|
|
1338
|
+
* Fetch the dictionary metadata and dictionary entries based upon the dictionary class name.
|
|
1339
|
+
*
|
|
1340
|
+
* @param {string} className
|
|
1341
|
+
*/
|
|
1342
|
+
getDictionary(className) {
|
|
1343
|
+
// When Selecting A New Dictionary, Navigate To First Page
|
|
1344
|
+
if (this.gridOptions && this.gridOptions.api) {
|
|
1345
|
+
this.gridOptions.api.paginationGoToFirstPage();
|
|
1346
|
+
}
|
|
1347
|
+
this.className = className;
|
|
1348
|
+
this.dataColumns = undefined;
|
|
1349
|
+
this.loadingSubjects[0].next(true);
|
|
1350
|
+
this.dictionaryService.getDictionary(className)
|
|
1351
|
+
.pipe(finalize(() => {
|
|
1352
|
+
this.loadingSubjects[0].next(false);
|
|
1353
|
+
})).subscribe((dictionary) => {
|
|
1354
|
+
this.setUpDictionaryGrid(dictionary);
|
|
1355
|
+
this.loadingSubjects[0].next(false);
|
|
1356
|
+
});
|
|
1357
|
+
this.getDictionaryEntries();
|
|
1358
|
+
}
|
|
1359
|
+
getDictionaryEntries() {
|
|
1360
|
+
this.loadingSubjects[1].next(true);
|
|
1361
|
+
this.dictionaryService.getDictionaryEntries(this.className)
|
|
1362
|
+
.pipe(finalize(() => {
|
|
1363
|
+
this.loadingSubjects[1].next(false);
|
|
1364
|
+
})).subscribe((dictionaryEntries) => {
|
|
1365
|
+
this.dictionaryEntries = dictionaryEntries;
|
|
1366
|
+
this.gridOptions.api.setRowData(dictionaryEntries);
|
|
1367
|
+
this.gridOptions.api.sizeColumnsToFit();
|
|
1368
|
+
this.loadingSubjects[1].next(false);
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
/**
|
|
1372
|
+
* Set the dictionary metadata. This is used to build the columns for the dictionary entries. The names, validation,
|
|
1373
|
+
* and filter classes build the column definition.
|
|
1374
|
+
*
|
|
1375
|
+
* @param dictionary
|
|
1376
|
+
*/
|
|
1377
|
+
setUpDictionaryGrid(dictionary) {
|
|
1378
|
+
if (isDevMode()) {
|
|
1379
|
+
console.debug("DictionaryEditorDetailComponent.setDictionary");
|
|
1380
|
+
console.debug(dictionary);
|
|
1381
|
+
}
|
|
1382
|
+
this.dictionary = dictionary;
|
|
1383
|
+
this.secondaryDictionaryEntries = [];
|
|
1384
|
+
let dictionaryClassNames = [];
|
|
1385
|
+
for (let field of dictionary.fields) {
|
|
1386
|
+
if (field.filterDictionaryClass) {
|
|
1387
|
+
dictionaryClassNames.push(field.filterDictionaryClass);
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
this.getSecondaryDictionaries(dictionaryClassNames);
|
|
1391
|
+
}
|
|
1392
|
+
getSecondaryDictionaries(dictionaryNames) {
|
|
1393
|
+
if (dictionaryNames.length == 0) {
|
|
1394
|
+
this.finishColumnSetup();
|
|
1395
|
+
}
|
|
1396
|
+
else {
|
|
1397
|
+
let dictionaryName = dictionaryNames.pop();
|
|
1398
|
+
this.dictionaryService.getDictionaryDropdownEntries(dictionaryName).subscribe((response) => {
|
|
1399
|
+
this.secondaryDictionaryEntries.push({ dictionaryName: dictionaryName, entries: response });
|
|
1400
|
+
this.getSecondaryDictionaries(dictionaryNames);
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
finishColumnSetup() {
|
|
1405
|
+
this.displayName = this.dictionary.displayName;
|
|
1406
|
+
// This establishes the readOnly functionality
|
|
1407
|
+
let cols = [];
|
|
1408
|
+
// Process Columns And Create Column Definition
|
|
1409
|
+
for (let field of this.dictionary.fields) {
|
|
1410
|
+
if (field.id && (isNullOrUndefined(field.code) || field.code == false)) {
|
|
1411
|
+
continue;
|
|
1412
|
+
}
|
|
1413
|
+
let col;
|
|
1414
|
+
if (field.filterDictionaryClass) {
|
|
1415
|
+
// this is a dropdown of another dictionary
|
|
1416
|
+
let options = this.secondaryDictionaryEntries.find((a) => {
|
|
1417
|
+
return a.dictionaryName === field.filterDictionaryClass;
|
|
1418
|
+
});
|
|
1419
|
+
col = {
|
|
1420
|
+
field: field.name,
|
|
1421
|
+
headerName: field.displayName,
|
|
1422
|
+
editable: this.isEditable.bind(this),
|
|
1423
|
+
cellRendererFramework: SelectRenderer,
|
|
1424
|
+
cellEditorFramework: SelectEditor,
|
|
1425
|
+
selectOptionsDisplayField: "display",
|
|
1426
|
+
selectOptionsValueField: "id",
|
|
1427
|
+
sortable: true,
|
|
1428
|
+
resizable: true,
|
|
1429
|
+
filter: true,
|
|
1430
|
+
filterValueGetter: this.comboFilterValueGetter,
|
|
1431
|
+
selectOptions: [],
|
|
1432
|
+
comparator: (valueA, valueB, nodeA, nodeB, isInverted) => {
|
|
1433
|
+
return 0;
|
|
1434
|
+
}
|
|
1435
|
+
};
|
|
1436
|
+
if (options && options.entries) {
|
|
1437
|
+
col.selectOptions = options.entries.sort((optionA, optionB) => {
|
|
1438
|
+
if (optionA && !optionB) {
|
|
1439
|
+
return 1;
|
|
1440
|
+
}
|
|
1441
|
+
if (optionB && !optionA) {
|
|
1442
|
+
return -1;
|
|
1443
|
+
}
|
|
1444
|
+
if (!optionA && !optionB) {
|
|
1445
|
+
return 0;
|
|
1446
|
+
}
|
|
1447
|
+
if (optionA.display.toLowerCase() > optionB.display.toLowerCase()) {
|
|
1448
|
+
return 1;
|
|
1449
|
+
}
|
|
1450
|
+
else if ((optionB.display.toLowerCase() > optionA.display.toLowerCase())) {
|
|
1451
|
+
return -1;
|
|
1452
|
+
}
|
|
1453
|
+
else {
|
|
1454
|
+
return 0;
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
col.comparator = (valueA, valueB, nodeA, nodeB, isInverted) => {
|
|
1458
|
+
if (!options.entries) {
|
|
1459
|
+
return 0;
|
|
1460
|
+
}
|
|
1461
|
+
if (valueA && !valueB) {
|
|
1462
|
+
return 1;
|
|
1463
|
+
}
|
|
1464
|
+
if (valueB && !valueA) {
|
|
1465
|
+
return -1;
|
|
1466
|
+
}
|
|
1467
|
+
if (!valueA && !valueB) {
|
|
1468
|
+
return 0;
|
|
1469
|
+
}
|
|
1470
|
+
let optionA = options.entries.find((entry) => ("" + entry.id === "" + valueA));
|
|
1471
|
+
let optionB = options.entries.find((entry) => ("" + entry.id === "" + valueB));
|
|
1472
|
+
if (optionA && !optionB) {
|
|
1473
|
+
return 1;
|
|
1474
|
+
}
|
|
1475
|
+
if (optionB && !optionA) {
|
|
1476
|
+
return -1;
|
|
1477
|
+
}
|
|
1478
|
+
if (!optionA && !optionB) {
|
|
1479
|
+
return 0;
|
|
1480
|
+
}
|
|
1481
|
+
if (optionA.display.toLowerCase() > optionB.display.toLowerCase()) {
|
|
1482
|
+
return 1;
|
|
1483
|
+
}
|
|
1484
|
+
else if ((optionB.display.toLowerCase() > optionA.display.toLowerCase())) {
|
|
1485
|
+
return -1;
|
|
1486
|
+
}
|
|
1487
|
+
else {
|
|
1488
|
+
return 0;
|
|
1489
|
+
}
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
col.cellStyle = params => {
|
|
1493
|
+
let column = {};
|
|
1494
|
+
for (let field of params.context.componentParent.dictionary.fields) {
|
|
1495
|
+
if (params.colDef.field == field.name) {
|
|
1496
|
+
column = field;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
if (params.data.editOrNew && params.data.editOrNew == "new") {
|
|
1500
|
+
if (params.context.readOnly || column.readOnly ||
|
|
1501
|
+
column.protectionType == "Read Only") {
|
|
1502
|
+
return { color: "#8a9499" };
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
else {
|
|
1506
|
+
if (params.context.readOnly || column.readOnly ||
|
|
1507
|
+
column.protectionType == "Read Only" || column.createOnly ||
|
|
1508
|
+
column.protectionType == "Create Only" || column.code) {
|
|
1509
|
+
return { color: "#8a9499" };
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
};
|
|
1513
|
+
col.displayOrder = field.displayOrder;
|
|
1514
|
+
col.dictionaryDisplay = field.dictionaryDisplay;
|
|
1515
|
+
col.dictionaryTooltip = field.dictionaryTooltip;
|
|
1516
|
+
// Set default filter as compare by text/number
|
|
1517
|
+
// col.filterRenderer = CompareFilterRenderer;
|
|
1518
|
+
}
|
|
1519
|
+
else if (field.type && field.type == "Date") {
|
|
1520
|
+
//date value
|
|
1521
|
+
col = {
|
|
1522
|
+
field: field.name,
|
|
1523
|
+
headerName: field.displayName,
|
|
1524
|
+
cellRendererFramework: DateRenderer,
|
|
1525
|
+
cellEditorFramework: AgGridDateCellEditorComponent,
|
|
1526
|
+
editable: this.isEditable.bind(this),
|
|
1527
|
+
sortable: true,
|
|
1528
|
+
resizable: true,
|
|
1529
|
+
filter: true,
|
|
1530
|
+
dictionaryDisplay: field.dictionaryDisplay
|
|
1531
|
+
};
|
|
1532
|
+
col.comparator = (valueA, valueB, nodeA, nodeB, isInverted) => {
|
|
1533
|
+
let num = this.dateComparator(valueA, valueB);
|
|
1534
|
+
return isInverted ? -1 * num : num; //don't have to do anything with inverted?
|
|
1535
|
+
};
|
|
1536
|
+
col.cellStyle = params => {
|
|
1537
|
+
var column = {};
|
|
1538
|
+
for (let field of params.context.componentParent.dictionary.fields) {
|
|
1539
|
+
if (params.colDef.field == field.name) {
|
|
1540
|
+
column = field;
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
if (params.data.editOrNew && params.data.editOrNew == "new") {
|
|
1544
|
+
if (params.context.readOnly || column.readOnly ||
|
|
1545
|
+
column.protectionType == "Read Only") {
|
|
1546
|
+
return { color: "#8a9499" };
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
else {
|
|
1550
|
+
if (params.context.readOnly || column.readOnly ||
|
|
1551
|
+
column.protectionType == "Read Only" || column.createOnly ||
|
|
1552
|
+
column.protectionType == "Create Only" || column.code) {
|
|
1553
|
+
return { color: "#8a9499" };
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
};
|
|
1557
|
+
col.displayOrder = field.displayOrder;
|
|
1558
|
+
}
|
|
1559
|
+
else {
|
|
1560
|
+
// this is a string value
|
|
1561
|
+
col = {
|
|
1562
|
+
field: field.name,
|
|
1563
|
+
headerName: field.displayName,
|
|
1564
|
+
editable: this.isEditable.bind(this),
|
|
1565
|
+
sortable: true,
|
|
1566
|
+
resizable: true,
|
|
1567
|
+
filter: true,
|
|
1568
|
+
dictionaryDisplay: field.dictionaryDisplay
|
|
1569
|
+
};
|
|
1570
|
+
col.comparator = (valueA, valueB, nodeA, nodeB, isInverted) => {
|
|
1571
|
+
if (valueA && !valueB) {
|
|
1572
|
+
return 1;
|
|
1573
|
+
}
|
|
1574
|
+
if (valueB && !valueA) {
|
|
1575
|
+
return -1;
|
|
1576
|
+
}
|
|
1577
|
+
if (!valueA && !valueB) {
|
|
1578
|
+
return 0;
|
|
1579
|
+
}
|
|
1580
|
+
if (valueA.toLowerCase() > valueB.toLowerCase()) {
|
|
1581
|
+
return 1;
|
|
1582
|
+
}
|
|
1583
|
+
else if ((valueB.toLowerCase() > valueA.toLowerCase())) {
|
|
1584
|
+
return -1;
|
|
1585
|
+
}
|
|
1586
|
+
else {
|
|
1587
|
+
return 0;
|
|
1588
|
+
}
|
|
1589
|
+
};
|
|
1590
|
+
col.cellStyle = params => {
|
|
1591
|
+
var column = {};
|
|
1592
|
+
for (let field of params.context.componentParent.dictionary.fields) {
|
|
1593
|
+
if (params.colDef.field == field.name) {
|
|
1594
|
+
column = field;
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
if (params.data.editOrNew && params.data.editOrNew == "new") {
|
|
1598
|
+
if (params.context.readOnly || column.readOnly ||
|
|
1599
|
+
column.protectionType == "Read Only") {
|
|
1600
|
+
return { color: "#8a9499" };
|
|
1601
|
+
}
|
|
1602
|
+
}
|
|
1603
|
+
else {
|
|
1604
|
+
if (params.context.readOnly || column.readOnly ||
|
|
1605
|
+
column.protectionType == "Read Only" || column.createOnly ||
|
|
1606
|
+
column.protectionType == "Create Only" || column.code) {
|
|
1607
|
+
return { color: "#8a9499" };
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
};
|
|
1611
|
+
col.displayOrder = field.displayOrder;
|
|
1612
|
+
// Set default filter as compare by text/number
|
|
1613
|
+
// col.filterRenderer = CompareFilterRenderer;
|
|
1614
|
+
}
|
|
1615
|
+
cols.push(col);
|
|
1616
|
+
}
|
|
1617
|
+
// Now we need to sort the columns
|
|
1618
|
+
if (!this.dictionary.fields[0].hasOwnProperty("displayOrder")) {
|
|
1619
|
+
// default case, no displayOrder
|
|
1620
|
+
cols = cols.sort((a, b) => {
|
|
1621
|
+
if (!a.headerName && b.headerName) {
|
|
1622
|
+
return 1;
|
|
1623
|
+
}
|
|
1624
|
+
else if (!b.headerName && a.headerName) {
|
|
1625
|
+
return -1;
|
|
1626
|
+
}
|
|
1627
|
+
else if (a.dictionaryDisplay === true && b.dictionaryDisplay === false) {
|
|
1628
|
+
return -1;
|
|
1629
|
+
}
|
|
1630
|
+
else if (b.dictionaryDisplay === true && a.dictionaryDisplay === false) {
|
|
1631
|
+
return 1;
|
|
1632
|
+
}
|
|
1633
|
+
else if (a.dictionaryTooltip === true && b.dictionaryTooltip === false) {
|
|
1634
|
+
return -1;
|
|
1635
|
+
}
|
|
1636
|
+
else if (b.dictionaryTooltip === true && a.dictionaryTooltip === false) {
|
|
1637
|
+
return 1;
|
|
1638
|
+
}
|
|
1639
|
+
else {
|
|
1640
|
+
return 0;
|
|
1641
|
+
}
|
|
1642
|
+
});
|
|
1643
|
+
}
|
|
1644
|
+
else {
|
|
1645
|
+
// DisplayOrder case
|
|
1646
|
+
// I think this works? Check later
|
|
1647
|
+
cols = cols.sort((a, b) => {
|
|
1648
|
+
if (!a.headerName && b.headerName) {
|
|
1649
|
+
return 1;
|
|
1650
|
+
}
|
|
1651
|
+
else if (!b.headerName && a.headerName) {
|
|
1652
|
+
return -1;
|
|
1653
|
+
}
|
|
1654
|
+
else {
|
|
1655
|
+
return a.displayOrder - b.displayOrder;
|
|
1656
|
+
}
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
// After Columns Have Been Sorted
|
|
1660
|
+
// Dictionary Grid Will Sort The Grid Ascending Order By First Column
|
|
1661
|
+
if (cols && cols.length != 0) {
|
|
1662
|
+
cols[0].sort = "asc";
|
|
1663
|
+
}
|
|
1664
|
+
this.dataColumns = cols;
|
|
1665
|
+
if (Array.isArray(this.dataColumns) && this.gridOptions && this.gridOptions.api) {
|
|
1666
|
+
this.gridOptions.api.setColumnDefs(this.dataColumns);
|
|
1667
|
+
this.gridOptions.api.sizeColumnsToFit();
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
isEditable(params) {
|
|
1671
|
+
let isEditable;
|
|
1672
|
+
let column = {};
|
|
1673
|
+
for (let field of this.dictionary.fields) {
|
|
1674
|
+
if (params.colDef.field == field.name) {
|
|
1675
|
+
column = field;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
if (params.data.editOrNew && params.data.editOrNew == "new") {
|
|
1679
|
+
// console.log("new editable?");
|
|
1680
|
+
isEditable = !(this.dictionary.readOnly || column.readOnly ||
|
|
1681
|
+
column.protectionType == "Read Only");
|
|
1682
|
+
}
|
|
1683
|
+
else {
|
|
1684
|
+
// console.log("edit editable?");
|
|
1685
|
+
isEditable = !(this.dictionary.readOnly || column.readOnly ||
|
|
1686
|
+
column.protectionType == "Read Only" || column.createOnly ||
|
|
1687
|
+
column.protectionType == "Create Only" || column.code);
|
|
1688
|
+
}
|
|
1689
|
+
return isEditable;
|
|
1690
|
+
}
|
|
1691
|
+
deleteDictionaryEntries() {
|
|
1692
|
+
let deleteRows = this.gridOptions.api.getSelectedRows();
|
|
1693
|
+
for (let deleteId of this.selectedRows) {
|
|
1694
|
+
for (let entry of this.dictionaryEntries) {
|
|
1695
|
+
if (entry[this.idColumn] === deleteId) {
|
|
1696
|
+
deleteRows.push(entry);
|
|
1697
|
+
break;
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
this.dictionaryService.deleteDictionaryEntries(this.className, deleteRows).subscribe((response) => {
|
|
1702
|
+
this.getDictionaryEntries();
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
updateDictionary(event) {
|
|
1706
|
+
// Important to note this will not update cells to the demo but will when imported to CORE or other applications.
|
|
1707
|
+
this.dictionaryService.updateDictionaryEntries(this.className, [event.data]).subscribe((data) => {
|
|
1708
|
+
this.getDictionaryEntries();
|
|
1709
|
+
});
|
|
1710
|
+
}
|
|
1711
|
+
setSelectedEntries() {
|
|
1712
|
+
this.selectedRows = this.gridOptions.api.getSelectedRows();
|
|
1713
|
+
}
|
|
1714
|
+
newRowPost(data) {
|
|
1715
|
+
return this.dictionaryService.addDictionaryEntries(this.className, [data])
|
|
1716
|
+
.pipe(map((data) => {
|
|
1717
|
+
if (data && data.length === 1) {
|
|
1718
|
+
return data[0];
|
|
1719
|
+
}
|
|
1720
|
+
else {
|
|
1721
|
+
return data;
|
|
1722
|
+
}
|
|
1723
|
+
}));
|
|
1724
|
+
}
|
|
1725
|
+
static onSamplesGridReady(event) {
|
|
1726
|
+
event.api.sizeColumnsToFit();
|
|
1727
|
+
}
|
|
1728
|
+
static onGridSizeChanged(event) {
|
|
1729
|
+
if (event && event.api) {
|
|
1730
|
+
event.api.sizeColumnsToFit();
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
get disableAddRow() {
|
|
1734
|
+
if (!this.dictionary) {
|
|
1735
|
+
return true;
|
|
1736
|
+
}
|
|
1737
|
+
return this.dictionary.readOnly && this.dictionary.readOnly === true;
|
|
1738
|
+
}
|
|
1739
|
+
get disableDelete() {
|
|
1740
|
+
if (!this.dictionary) {
|
|
1741
|
+
return true;
|
|
1742
|
+
}
|
|
1743
|
+
if (this.dictionary.readOnly && this.dictionary.readOnly === true) {
|
|
1744
|
+
return true;
|
|
1745
|
+
}
|
|
1746
|
+
if (this.gridOptions && this.gridOptions.api && this.gridOptions.api.getSelectedRows()) {
|
|
1747
|
+
return this.gridOptions.api.getSelectedRows().length === 0;
|
|
1748
|
+
}
|
|
1749
|
+
else {
|
|
1750
|
+
return true;
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
comboFilterValueGetter(params) {
|
|
1754
|
+
let value = params.data[params.colDef.field];
|
|
1755
|
+
if (value) {
|
|
1756
|
+
let option = params.colDef.selectOptions.find((entry) => (entry[params.colDef.selectOptionsValueField] === value));
|
|
1757
|
+
return option ? option[params.colDef.selectOptionsDisplayField] : "";
|
|
1758
|
+
}
|
|
1759
|
+
return "";
|
|
1760
|
+
}
|
|
1761
|
+
onClickAddRow() {
|
|
1762
|
+
const modalRef = this.modalService.open(NewRowComponent, {
|
|
1763
|
+
size: "lg",
|
|
1764
|
+
keyboard: false,
|
|
1765
|
+
backdrop: "static",
|
|
1766
|
+
centered: true,
|
|
1767
|
+
});
|
|
1768
|
+
modalRef.componentInstance.colDefs = this.dataColumns;
|
|
1769
|
+
modalRef.componentInstance.dictionary = this.dictionary;
|
|
1770
|
+
if (!this.newRowSubscription) {
|
|
1771
|
+
// tell other ag-grid to add row to it
|
|
1772
|
+
this.newRowSubscription = modalRef.componentInstance.newRowSubject.subscribe((theNewRow) => {
|
|
1773
|
+
this.dictionaryEntries = theNewRow.concat(this.dictionaryEntries);
|
|
1774
|
+
this.gridOptions.api.setRowData(this.dictionaryEntries);
|
|
1775
|
+
this.newRowSubscription = null;
|
|
1776
|
+
// Important to note this will not add rows to the demo but will when imported to CORE or other applications.
|
|
1777
|
+
this.newRowPost(theNewRow[0]).subscribe(() => {
|
|
1778
|
+
this.getDictionaryEntries();
|
|
1779
|
+
});
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Comparater To Compare 2 Dates
|
|
1785
|
+
* @param date1 Date 1
|
|
1786
|
+
* @param date2 Date 2
|
|
1787
|
+
*/
|
|
1788
|
+
dateComparator(date1, date2) {
|
|
1789
|
+
let date1Number = monthToComparableNumber(date1);
|
|
1790
|
+
let date2Number = monthToComparableNumber(date2);
|
|
1791
|
+
if (date1Number === null && date2Number === null) {
|
|
1792
|
+
return 0;
|
|
1793
|
+
}
|
|
1794
|
+
if (date1Number === null) {
|
|
1795
|
+
return -1;
|
|
1796
|
+
}
|
|
1797
|
+
if (date2Number === null) {
|
|
1798
|
+
return 1;
|
|
1799
|
+
}
|
|
1800
|
+
return date1Number - date2Number;
|
|
1801
|
+
}
|
|
1802
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DictionaryEditorDetailComponent, deps: [{ token: i3.ActivatedRoute }, { token: i1$2.NgbModal }, { token: i1.DictionaryService }, { token: DICTIONARY_ENDPOINT }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1803
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.2", type: DictionaryEditorDetailComponent, selector: "hci-dictionary-editor-detail", host: { properties: { "class": "this.classList" } }, ngImport: i0, template: `
|
|
1804
1804
|
<div class="d-flex flex-column hci-dictionary-detail-body"
|
|
1805
1805
|
>
|
|
1806
1806
|
<hci-busy [busySubjects]="loadingSubjects"></hci-busy>
|
|
@@ -1884,10 +1884,10 @@ class DictionaryEditorDetailComponent {
|
|
|
1884
1884
|
</div>
|
|
1885
1885
|
</ng-template>
|
|
1886
1886
|
</div>
|
|
1887
|
-
`, isInline: true, styles: [".full-height{height:100%}.full-width{width:100%}.ag-theme-balham{font-family:Prompt;font-weight:500}.active-color{float:right;font-size:15px;color:var(--bluewarm-dark)}.deactivated-color{float:right;font-size:15px;color:var(--greywarm-medlight)}.dictionary-info-section{padding-top:10px}.dictionary-title{float:left;font-size:16px;padding-left:10px;padding-right:10px;padding-top:5px}.metadata-button{color:var(--white-lightest);float:left;font-size:15px}:host::ng-deep .ag-header-cell{background-color:var(--bluewarmvividfade-lightest);border:lightgray solid thin}:host::ng-deep .ag-cell{border-right:lightgray solid thin;border-left:lightgray solid thin}:host::ng-deep .ag-row{border-bottom:0;border-top:0}:host::ng-deep .ag-row-even{background-color:var(--white-medium)}.hci-dictionary-detail-body{height:100%;width:100%;background:linear-gradient(0deg,var(--white-lightest) 30%,var(--bluewarmvividfade-lighter) 100%)!important}.hci-dictoinary-display-grid{padding-right:5px;padding-left:5px;box-shadow:#00000059 0 5px 15px}:host::ng-deep .ag-row-hover{color:#666!important;background-color:var(--bluewarmvividfade-lighter)!important}:host::ng-deep .ag-row-selected .ag-cell{color:var(--white-lightest)!important}:host::ng-deep .ag-row-selected{color:var(--white-darker)!important;background-color:var(--bluewarmvivid-lighter)!important}\n"], dependencies: [{ kind: "component", type: i4$1.BusyComponent, selector: "hci-busy", inputs: ["busy", "busySubjects", "getBusySubjects", "parentSelector", "rootClass", "icon", "iconSize", "showIcon", "mxAuto", "myAuto", "text", "template", "config"] }, { kind: "component", type: i2$1.AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "suppressMenuHide", "enableBrowserTooltips", "tooltipShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "maintainColumnOrder", "suppressFieldDotNotation", "deltaColumnMode", "applyColumnDefOrder", "immutableColumns", "suppressSetColumnStateEvents", "suppressColumnStateEvents", "colWidth", "minColWidth", "maxColWidth", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "components", "frameworkComponents", "editType", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterMovesDown", "enterMovesDownAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "stopEditingWhenGridLosesFocus", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "defaultExportParams", "quickFilterText", "cacheQuickFilter", "excludeChildrenWhenTreeDataFiltering", "enableCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "enableChartToolPanelsButton", "chartToolPanelsDef", "loadingCellRenderer", "loadingCellRendererFramework", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererFramework", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressParentsInRowNodes", "suppressTouch", "suppressFocusAfterRefresh", "suppressAsyncEvents", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentFramework", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentFramework", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "pagination", "paginationPageSize", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "suppressAggFuncInHeader", "suppressAggAtRootLevel", "aggregateOnlyChangedColumns", "suppressAggFilteredOnly", "removePivotHeaderRowWhenSingleValueColumn", "animateRows", "enableCellChangeFlash", "cellFlashDelay", "cellFadeDelay", "allowShowChangeAfterFilter", "domLayout", "ensureDomOrder", "enableRtl", "suppressColumnVirtualisation", "suppressMaxRenderedRowRestriction", "suppressRowVirtualisation", "rowDragManaged", "suppressRowDrag", "suppressMoveWhenRowDragging", "rowDragEntireRow", "rowDragMultiRow", "rowDragText", "fullWidthCellRenderer", "fullWidthCellRendererFramework", "fullWidthCellRendererParams", "embedFullWidthRows", "deprecatedEmbedFullWidthRows", "groupDisplayType", "groupDefaultExpanded", "autoGroupColumnDef", "groupMaintainOrder", "groupSelectsChildren", "groupAggFiltering", "groupIncludeFooter", "groupIncludeTotalFooter", "groupSuppressBlankHeader", "groupSelectsFiltered", "showOpenedGroup", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "groupHideOpenParents", "rowGroupPanelShow", "groupRowRenderer", "groupRowRendererFramework", "groupRowRendererParams", "suppressMakeColumnVisibleAfterUnGroup", "treeData", "rowGroupPanelSuppressSort", "groupRowsSticky", "groupRowInnerRenderer", "groupRowInnerRendererFramework", "groupMultiAutoColumn", "groupUseEntireRow", "groupSuppressAutoColumn", "rememberGroupStateWhenNewData", "pinnedTopRowData", "pinnedBottomRowData", "rowModelType", "rowData", "immutableData", "asyncTransactionWaitMillis", "suppressModelUpdateAfterUpdateTransaction", "deltaRowDataMode", "batchUpdateWaitMillis", "datasource", "cacheOverflowSize", "infiniteInitialRowCount", "serverSideInitialRowCount", "serverSideStoreType", "serverSideInfiniteScroll", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideFilterAllLevels", "serverSideSortOnServer", "serverSideFilterOnServer", "serverSideSortingAlwaysResets", "serverSideFilteringAlwaysResets", "suppressEnterpriseResetOnNewColumns", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellSelection", "suppressCellFocus", "suppressMultiRangeSelection", "enableCellTextSelection", "enableRangeSelection", "enableRangeHandle", "enableFillHandle", "fillHandleDirection", "suppressClearOnFillReduction", "sortingOrder", "accentedSort", "unSortIcon", "suppressMultiSort", "alwaysMultiSort", "multiSortKey", "suppressMaintainUnsortedOrder", "icons", "rowHeight", "rowStyle", "rowClass", "rowClassRules", "suppressRowHoverHighlight", "suppressRowTransform", "columnHoverHighlight", "deltaSort", "treeDataDisplayType", "angularCompileRows", "angularCompileFilters", "functionsPassive", "enableGroupEdit", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "navigateToNextHeader", "tabToNextHeader", "navigateToNextCell", "tabToNextCell", "suppressKeyboardEvent", "localeTextFunc", "getLocaleText", "getDocument", "paginationNumberFormatter", "groupRowAggNodes", "getGroupRowAgg", "isGroupOpenByDefault", "initialGroupOrderComparator", "defaultGroupOrderComparator", "processSecondaryColDef", "processSecondaryColGroupDef", "processPivotResultColDef", "processPivotResultColGroupDef", "getDataPath", "defaultGroupSortComparator", "getChildCount", "getServerSideGroupLevelParams", "getServerSideStoreParams", "isServerSideGroupOpenByDefault", "isApplyServerSideTransaction", "isServerSideGroup", "getServerSideGroupKey", "getBusinessKeyForNode", "getRowNodeId", "getRowId", "resetRowDataOnUpdate", "processRowPostCreate", "isRowSelectable", "isRowMaster", "fillOperation", "postSort", "postSortRows", "getRowStyle", "getRowClass", "getRowHeight", "isFullWidthCell", "isFullWidthRow"], outputs: ["toolPanelVisibleChanged", "toolPanelSizeChanged", "pasteStart", "pasteEnd", "columnVisible", "columnPinned", "columnResized", "columnMoved", "columnValueChanged", "columnPivotModeChanged", "columnPivotChanged", "columnGroupOpened", "newColumnsLoaded", "gridColumnsChanged", "displayedColumnsChanged", "virtualColumnsChanged", "columnEverythingChanged", "componentStateChanged", "cellValueChanged", "cellEditRequest", "rowValueChanged", "cellEditingStarted", "cellEditingStopped", "rowEditingStarted", "rowEditingStopped", "filterOpened", "filterChanged", "filterModified", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "cellKeyPress", "gridReady", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pinnedRowDataChanged", "rowDataChanged", "rowDataUpdated", "asyncTransactionsFlushed", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "sortChanged", "columnRowGroupChangeRequest", "columnPivotChangeRequest", "columnValueChangeRequest", "columnAggFuncChangeRequest"] }] }); }
|
|
1888
|
-
}
|
|
1889
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1890
|
-
type: Component,
|
|
1887
|
+
`, isInline: true, styles: [".full-height{height:100%}.full-width{width:100%}.ag-theme-balham{font-family:Prompt;font-weight:500}.active-color{float:right;font-size:15px;color:var(--bluewarm-dark)}.deactivated-color{float:right;font-size:15px;color:var(--greywarm-medlight)}.dictionary-info-section{padding-top:10px}.dictionary-title{float:left;font-size:16px;padding-left:10px;padding-right:10px;padding-top:5px}.metadata-button{color:var(--white-lightest);float:left;font-size:15px}:host::ng-deep .ag-header-cell{background-color:var(--bluewarmvividfade-lightest);border:lightgray solid thin}:host::ng-deep .ag-cell{border-right:lightgray solid thin;border-left:lightgray solid thin}:host::ng-deep .ag-row{border-bottom:0;border-top:0}:host::ng-deep .ag-row-even{background-color:var(--white-medium)}.hci-dictionary-detail-body{height:100%;width:100%;background:linear-gradient(0deg,var(--white-lightest) 30%,var(--bluewarmvividfade-lighter) 100%)!important}.hci-dictoinary-display-grid{padding-right:5px;padding-left:5px;box-shadow:#00000059 0 5px 15px}:host::ng-deep .ag-row-hover{color:#666!important;background-color:var(--bluewarmvividfade-lighter)!important}:host::ng-deep .ag-row-selected .ag-cell{color:var(--white-lightest)!important}:host::ng-deep .ag-row-selected{color:var(--white-darker)!important;background-color:var(--bluewarmvivid-lighter)!important}\n"], dependencies: [{ kind: "component", type: i4$1.BusyComponent, selector: "hci-busy", inputs: ["busy", "busySubjects", "getBusySubjects", "parentSelector", "rootClass", "icon", "iconSize", "showIcon", "mxAuto", "myAuto", "text", "template", "config"] }, { kind: "component", type: i2$1.AgGridAngular, selector: "ag-grid-angular", inputs: ["gridOptions", "modules", "statusBar", "sideBar", "suppressContextMenu", "preventDefaultOnContextMenu", "allowContextMenuWithControlKey", "suppressMenuHide", "enableBrowserTooltips", "tooltipShowDelay", "tooltipHideDelay", "tooltipMouseTrack", "popupParent", "copyHeadersToClipboard", "copyGroupHeadersToClipboard", "clipboardDelimiter", "suppressCopyRowsToClipboard", "suppressCopySingleCellRanges", "suppressLastEmptyLineOnPaste", "suppressClipboardPaste", "suppressClipboardApi", "columnDefs", "defaultColDef", "defaultColGroupDef", "columnTypes", "maintainColumnOrder", "suppressFieldDotNotation", "deltaColumnMode", "applyColumnDefOrder", "immutableColumns", "suppressSetColumnStateEvents", "suppressColumnStateEvents", "colWidth", "minColWidth", "maxColWidth", "headerHeight", "groupHeaderHeight", "floatingFiltersHeight", "pivotHeaderHeight", "pivotGroupHeaderHeight", "allowDragFromColumnsToolPanel", "suppressMovableColumns", "suppressColumnMoveAnimation", "suppressDragLeaveHidesColumns", "suppressRowGroupHidesColumns", "colResizeDefault", "suppressAutoSize", "autoSizePadding", "skipHeaderOnAutoSize", "components", "frameworkComponents", "editType", "singleClickEdit", "suppressClickEdit", "readOnlyEdit", "stopEditingWhenCellsLoseFocus", "enterMovesDown", "enterMovesDownAfterEdit", "enableCellEditingOnBackspace", "undoRedoCellEditing", "undoRedoCellEditingLimit", "stopEditingWhenGridLosesFocus", "defaultCsvExportParams", "suppressCsvExport", "defaultExcelExportParams", "suppressExcelExport", "excelStyles", "defaultExportParams", "quickFilterText", "cacheQuickFilter", "excludeChildrenWhenTreeDataFiltering", "enableCharts", "chartThemes", "customChartThemes", "chartThemeOverrides", "enableChartToolPanelsButton", "chartToolPanelsDef", "loadingCellRenderer", "loadingCellRendererFramework", "loadingCellRendererParams", "loadingCellRendererSelector", "localeText", "masterDetail", "keepDetailRows", "keepDetailRowsCount", "detailCellRenderer", "detailCellRendererFramework", "detailCellRendererParams", "detailRowHeight", "detailRowAutoHeight", "context", "alignedGrids", "tabIndex", "rowBuffer", "valueCache", "valueCacheNeverExpires", "enableCellExpressions", "suppressParentsInRowNodes", "suppressTouch", "suppressFocusAfterRefresh", "suppressAsyncEvents", "suppressBrowserResizeObserver", "suppressPropertyNamesCheck", "suppressChangeDetection", "debug", "overlayLoadingTemplate", "loadingOverlayComponent", "loadingOverlayComponentFramework", "loadingOverlayComponentParams", "suppressLoadingOverlay", "overlayNoRowsTemplate", "noRowsOverlayComponent", "noRowsOverlayComponentFramework", "noRowsOverlayComponentParams", "suppressNoRowsOverlay", "pagination", "paginationPageSize", "paginationAutoPageSize", "paginateChildRows", "suppressPaginationPanel", "pivotMode", "pivotPanelShow", "pivotColumnGroupTotals", "pivotRowTotals", "pivotSuppressAutoColumn", "suppressExpandablePivotGroups", "functionsReadOnly", "aggFuncs", "suppressAggFuncInHeader", "suppressAggAtRootLevel", "aggregateOnlyChangedColumns", "suppressAggFilteredOnly", "removePivotHeaderRowWhenSingleValueColumn", "animateRows", "enableCellChangeFlash", "cellFlashDelay", "cellFadeDelay", "allowShowChangeAfterFilter", "domLayout", "ensureDomOrder", "enableRtl", "suppressColumnVirtualisation", "suppressMaxRenderedRowRestriction", "suppressRowVirtualisation", "rowDragManaged", "suppressRowDrag", "suppressMoveWhenRowDragging", "rowDragEntireRow", "rowDragMultiRow", "rowDragText", "fullWidthCellRenderer", "fullWidthCellRendererFramework", "fullWidthCellRendererParams", "embedFullWidthRows", "deprecatedEmbedFullWidthRows", "groupDisplayType", "groupDefaultExpanded", "autoGroupColumnDef", "groupMaintainOrder", "groupSelectsChildren", "groupAggFiltering", "groupIncludeFooter", "groupIncludeTotalFooter", "groupSuppressBlankHeader", "groupSelectsFiltered", "showOpenedGroup", "groupRemoveSingleChildren", "groupRemoveLowestSingleChildren", "groupHideOpenParents", "rowGroupPanelShow", "groupRowRenderer", "groupRowRendererFramework", "groupRowRendererParams", "suppressMakeColumnVisibleAfterUnGroup", "treeData", "rowGroupPanelSuppressSort", "groupRowsSticky", "groupRowInnerRenderer", "groupRowInnerRendererFramework", "groupMultiAutoColumn", "groupUseEntireRow", "groupSuppressAutoColumn", "rememberGroupStateWhenNewData", "pinnedTopRowData", "pinnedBottomRowData", "rowModelType", "rowData", "immutableData", "asyncTransactionWaitMillis", "suppressModelUpdateAfterUpdateTransaction", "deltaRowDataMode", "batchUpdateWaitMillis", "datasource", "cacheOverflowSize", "infiniteInitialRowCount", "serverSideInitialRowCount", "serverSideStoreType", "serverSideInfiniteScroll", "cacheBlockSize", "maxBlocksInCache", "maxConcurrentDatasourceRequests", "blockLoadDebounceMillis", "purgeClosedRowNodes", "serverSideDatasource", "serverSideSortAllLevels", "serverSideFilterAllLevels", "serverSideSortOnServer", "serverSideFilterOnServer", "serverSideSortingAlwaysResets", "serverSideFilteringAlwaysResets", "suppressEnterpriseResetOnNewColumns", "viewportDatasource", "viewportRowModelPageSize", "viewportRowModelBufferSize", "alwaysShowHorizontalScroll", "alwaysShowVerticalScroll", "debounceVerticalScrollbar", "suppressHorizontalScroll", "suppressScrollOnNewData", "suppressScrollWhenPopupsAreOpen", "suppressAnimationFrame", "suppressMiddleClickScrolls", "suppressPreventDefaultOnMouseWheel", "scrollbarWidth", "rowSelection", "rowMultiSelectWithClick", "suppressRowDeselection", "suppressRowClickSelection", "suppressCellSelection", "suppressCellFocus", "suppressMultiRangeSelection", "enableCellTextSelection", "enableRangeSelection", "enableRangeHandle", "enableFillHandle", "fillHandleDirection", "suppressClearOnFillReduction", "sortingOrder", "accentedSort", "unSortIcon", "suppressMultiSort", "alwaysMultiSort", "multiSortKey", "suppressMaintainUnsortedOrder", "icons", "rowHeight", "rowStyle", "rowClass", "rowClassRules", "suppressRowHoverHighlight", "suppressRowTransform", "columnHoverHighlight", "deltaSort", "treeDataDisplayType", "angularCompileRows", "angularCompileFilters", "functionsPassive", "enableGroupEdit", "getContextMenuItems", "getMainMenuItems", "postProcessPopup", "processCellForClipboard", "processHeaderForClipboard", "processGroupHeaderForClipboard", "processCellFromClipboard", "sendToClipboard", "processDataFromClipboard", "isExternalFilterPresent", "doesExternalFilterPass", "getChartToolbarItems", "createChartContainer", "navigateToNextHeader", "tabToNextHeader", "navigateToNextCell", "tabToNextCell", "suppressKeyboardEvent", "localeTextFunc", "getLocaleText", "getDocument", "paginationNumberFormatter", "groupRowAggNodes", "getGroupRowAgg", "isGroupOpenByDefault", "initialGroupOrderComparator", "defaultGroupOrderComparator", "processSecondaryColDef", "processSecondaryColGroupDef", "processPivotResultColDef", "processPivotResultColGroupDef", "getDataPath", "defaultGroupSortComparator", "getChildCount", "getServerSideGroupLevelParams", "getServerSideStoreParams", "isServerSideGroupOpenByDefault", "isApplyServerSideTransaction", "isServerSideGroup", "getServerSideGroupKey", "getBusinessKeyForNode", "getRowNodeId", "getRowId", "resetRowDataOnUpdate", "processRowPostCreate", "isRowSelectable", "isRowMaster", "fillOperation", "postSort", "postSortRows", "getRowStyle", "getRowClass", "getRowHeight", "isFullWidthCell", "isFullWidthRow"], outputs: ["toolPanelVisibleChanged", "toolPanelSizeChanged", "pasteStart", "pasteEnd", "columnVisible", "columnPinned", "columnResized", "columnMoved", "columnValueChanged", "columnPivotModeChanged", "columnPivotChanged", "columnGroupOpened", "newColumnsLoaded", "gridColumnsChanged", "displayedColumnsChanged", "virtualColumnsChanged", "columnEverythingChanged", "componentStateChanged", "cellValueChanged", "cellEditRequest", "rowValueChanged", "cellEditingStarted", "cellEditingStopped", "rowEditingStarted", "rowEditingStopped", "filterOpened", "filterChanged", "filterModified", "chartCreated", "chartRangeSelectionChanged", "chartOptionsChanged", "chartDestroyed", "cellKeyDown", "cellKeyPress", "gridReady", "firstDataRendered", "gridSizeChanged", "modelUpdated", "virtualRowRemoved", "viewportChanged", "bodyScroll", "bodyScrollEnd", "dragStarted", "dragStopped", "paginationChanged", "rowDragEnter", "rowDragMove", "rowDragLeave", "rowDragEnd", "columnRowGroupChanged", "rowGroupOpened", "expandOrCollapseAll", "pinnedRowDataChanged", "rowDataChanged", "rowDataUpdated", "asyncTransactionsFlushed", "cellClicked", "cellDoubleClicked", "cellFocused", "cellMouseOver", "cellMouseOut", "cellMouseDown", "rowClicked", "rowDoubleClicked", "rowSelected", "selectionChanged", "cellContextMenu", "rangeSelectionChanged", "sortChanged", "columnRowGroupChangeRequest", "columnPivotChangeRequest", "columnValueChangeRequest", "columnAggFuncChangeRequest"] }] }); }
|
|
1888
|
+
}
|
|
1889
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DictionaryEditorDetailComponent, decorators: [{
|
|
1890
|
+
type: Component,
|
|
1891
1891
|
args: [{ selector: "hci-dictionary-editor-detail", template: `
|
|
1892
1892
|
<div class="d-flex flex-column hci-dictionary-detail-body"
|
|
1893
1893
|
>
|
|
@@ -1972,175 +1972,175 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1972
1972
|
</div>
|
|
1973
1973
|
</ng-template>
|
|
1974
1974
|
</div>
|
|
1975
|
-
`, styles: [".full-height{height:100%}.full-width{width:100%}.ag-theme-balham{font-family:Prompt;font-weight:500}.active-color{float:right;font-size:15px;color:var(--bluewarm-dark)}.deactivated-color{float:right;font-size:15px;color:var(--greywarm-medlight)}.dictionary-info-section{padding-top:10px}.dictionary-title{float:left;font-size:16px;padding-left:10px;padding-right:10px;padding-top:5px}.metadata-button{color:var(--white-lightest);float:left;font-size:15px}:host::ng-deep .ag-header-cell{background-color:var(--bluewarmvividfade-lightest);border:lightgray solid thin}:host::ng-deep .ag-cell{border-right:lightgray solid thin;border-left:lightgray solid thin}:host::ng-deep .ag-row{border-bottom:0;border-top:0}:host::ng-deep .ag-row-even{background-color:var(--white-medium)}.hci-dictionary-detail-body{height:100%;width:100%;background:linear-gradient(0deg,var(--white-lightest) 30%,var(--bluewarmvividfade-lighter) 100%)!important}.hci-dictoinary-display-grid{padding-right:5px;padding-left:5px;box-shadow:#00000059 0 5px 15px}:host::ng-deep .ag-row-hover{color:#666!important;background-color:var(--bluewarmvividfade-lighter)!important}:host::ng-deep .ag-row-selected .ag-cell{color:var(--white-lightest)!important}:host::ng-deep .ag-row-selected{color:var(--white-darker)!important;background-color:var(--bluewarmvivid-lighter)!important}\n"] }]
|
|
1976
|
-
}], ctorParameters:
|
|
1977
|
-
type: Inject,
|
|
1978
|
-
args: [DICTIONARY_ENDPOINT]
|
|
1979
|
-
}] }]
|
|
1980
|
-
type: HostBinding,
|
|
1981
|
-
args: ["class"]
|
|
1982
|
-
}] } });
|
|
1983
|
-
/**
|
|
1984
|
-
* Extracts Date And Turn To A Numerical Value For Comparing Purposes
|
|
1985
|
-
* @param date The date to comparable number
|
|
1986
|
-
*/
|
|
1987
|
-
function monthToComparableNumber(date) {
|
|
1988
|
-
if (date === undefined || date === null || date.length !== 10) {
|
|
1989
|
-
return null;
|
|
1990
|
-
}
|
|
1991
|
-
let yearNumber = date.substring(0, 4);
|
|
1992
|
-
let monthNumber = date.substring(5, 7);
|
|
1993
|
-
let dayNumber = date.substring(8, 10);
|
|
1994
|
-
return yearNumber * 10000 + monthNumber * 100 + dayNumber;
|
|
1975
|
+
`, styles: [".full-height{height:100%}.full-width{width:100%}.ag-theme-balham{font-family:Prompt;font-weight:500}.active-color{float:right;font-size:15px;color:var(--bluewarm-dark)}.deactivated-color{float:right;font-size:15px;color:var(--greywarm-medlight)}.dictionary-info-section{padding-top:10px}.dictionary-title{float:left;font-size:16px;padding-left:10px;padding-right:10px;padding-top:5px}.metadata-button{color:var(--white-lightest);float:left;font-size:15px}:host::ng-deep .ag-header-cell{background-color:var(--bluewarmvividfade-lightest);border:lightgray solid thin}:host::ng-deep .ag-cell{border-right:lightgray solid thin;border-left:lightgray solid thin}:host::ng-deep .ag-row{border-bottom:0;border-top:0}:host::ng-deep .ag-row-even{background-color:var(--white-medium)}.hci-dictionary-detail-body{height:100%;width:100%;background:linear-gradient(0deg,var(--white-lightest) 30%,var(--bluewarmvividfade-lighter) 100%)!important}.hci-dictoinary-display-grid{padding-right:5px;padding-left:5px;box-shadow:#00000059 0 5px 15px}:host::ng-deep .ag-row-hover{color:#666!important;background-color:var(--bluewarmvividfade-lighter)!important}:host::ng-deep .ag-row-selected .ag-cell{color:var(--white-lightest)!important}:host::ng-deep .ag-row-selected{color:var(--white-darker)!important;background-color:var(--bluewarmvivid-lighter)!important}\n"] }]
|
|
1976
|
+
}], ctorParameters: () => [{ type: i3.ActivatedRoute }, { type: i1$2.NgbModal }, { type: i1.DictionaryService }, { type: undefined, decorators: [{
|
|
1977
|
+
type: Inject,
|
|
1978
|
+
args: [DICTIONARY_ENDPOINT]
|
|
1979
|
+
}] }], propDecorators: { classList: [{
|
|
1980
|
+
type: HostBinding,
|
|
1981
|
+
args: ["class"]
|
|
1982
|
+
}] } });
|
|
1983
|
+
/**
|
|
1984
|
+
* Extracts Date And Turn To A Numerical Value For Comparing Purposes
|
|
1985
|
+
* @param date The date to comparable number
|
|
1986
|
+
*/
|
|
1987
|
+
function monthToComparableNumber(date) {
|
|
1988
|
+
if (date === undefined || date === null || date.length !== 10) {
|
|
1989
|
+
return null;
|
|
1990
|
+
}
|
|
1991
|
+
let yearNumber = date.substring(0, 4);
|
|
1992
|
+
let monthNumber = date.substring(5, 7);
|
|
1993
|
+
let dayNumber = date.substring(8, 10);
|
|
1994
|
+
return yearNumber * 10000 + monthNumber * 100 + dayNumber;
|
|
1995
1995
|
}
|
|
1996
1996
|
|
|
1997
|
-
const ROUTES = [
|
|
1998
|
-
{ path: "", component: DictionaryEditorComponent,
|
|
1999
|
-
children: [
|
|
2000
|
-
{ path: "", redirectTo: "home", pathMatch: "full" },
|
|
2001
|
-
{ path: "home", component: DictionaryEditorHomeComponent },
|
|
2002
|
-
{ path: "detail/:className", component: DictionaryEditorDetailComponent }
|
|
2003
|
-
]
|
|
2004
|
-
}
|
|
2005
|
-
];
|
|
1997
|
+
const ROUTES = [
|
|
1998
|
+
{ path: "", component: DictionaryEditorComponent,
|
|
1999
|
+
children: [
|
|
2000
|
+
{ path: "", redirectTo: "home", pathMatch: "full" },
|
|
2001
|
+
{ path: "home", component: DictionaryEditorHomeComponent },
|
|
2002
|
+
{ path: "detail/:className", component: DictionaryEditorDetailComponent }
|
|
2003
|
+
]
|
|
2004
|
+
}
|
|
2005
|
+
];
|
|
2006
2006
|
const DICTIONARY_EDITOR_ROUTES = RouterModule.forChild(ROUTES);
|
|
2007
2007
|
|
|
2008
|
-
class AgGridRendererModule {
|
|
2009
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2010
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
2011
|
-
DateRenderer], imports: [CommonModule,
|
|
2012
|
-
FormsModule,
|
|
2013
|
-
ReactiveFormsModule], exports: [SelectRenderer,
|
|
2014
|
-
DateRenderer] }); }
|
|
2015
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2016
|
-
FormsModule,
|
|
2017
|
-
ReactiveFormsModule] }); }
|
|
2018
|
-
}
|
|
2019
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2020
|
-
type: NgModule,
|
|
2021
|
-
args: [{
|
|
2022
|
-
imports: [
|
|
2023
|
-
CommonModule,
|
|
2024
|
-
FormsModule,
|
|
2025
|
-
ReactiveFormsModule,
|
|
2026
|
-
],
|
|
2027
|
-
declarations: [
|
|
2028
|
-
SelectRenderer,
|
|
2029
|
-
DateRenderer
|
|
2030
|
-
],
|
|
2031
|
-
exports: [
|
|
2032
|
-
SelectRenderer,
|
|
2033
|
-
DateRenderer
|
|
2034
|
-
]
|
|
2035
|
-
}]
|
|
2008
|
+
class AgGridRendererModule {
|
|
2009
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AgGridRendererModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2010
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.2", ngImport: i0, type: AgGridRendererModule, declarations: [SelectRenderer,
|
|
2011
|
+
DateRenderer], imports: [CommonModule,
|
|
2012
|
+
FormsModule,
|
|
2013
|
+
ReactiveFormsModule], exports: [SelectRenderer,
|
|
2014
|
+
DateRenderer] }); }
|
|
2015
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AgGridRendererModule, imports: [CommonModule,
|
|
2016
|
+
FormsModule,
|
|
2017
|
+
ReactiveFormsModule] }); }
|
|
2018
|
+
}
|
|
2019
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AgGridRendererModule, decorators: [{
|
|
2020
|
+
type: NgModule,
|
|
2021
|
+
args: [{
|
|
2022
|
+
imports: [
|
|
2023
|
+
CommonModule,
|
|
2024
|
+
FormsModule,
|
|
2025
|
+
ReactiveFormsModule,
|
|
2026
|
+
],
|
|
2027
|
+
declarations: [
|
|
2028
|
+
SelectRenderer,
|
|
2029
|
+
DateRenderer
|
|
2030
|
+
],
|
|
2031
|
+
exports: [
|
|
2032
|
+
SelectRenderer,
|
|
2033
|
+
DateRenderer
|
|
2034
|
+
]
|
|
2035
|
+
}]
|
|
2036
2036
|
}] });
|
|
2037
2037
|
|
|
2038
|
-
class AgGridEditorModule {
|
|
2039
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2040
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
2041
|
-
AgGridDateCellEditorComponent,
|
|
2042
|
-
DatepickerComponent], imports: [AgGridModule,
|
|
2043
|
-
CommonModule,
|
|
2044
|
-
FormsModule,
|
|
2045
|
-
ReactiveFormsModule,
|
|
2046
|
-
MatDatepickerModule,
|
|
2047
|
-
MomentDateModule,
|
|
2048
|
-
AgGridRendererModule], exports: [SelectEditor,
|
|
2049
|
-
AgGridDateCellEditorComponent] }); }
|
|
2050
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2051
|
-
CommonModule,
|
|
2052
|
-
FormsModule,
|
|
2053
|
-
ReactiveFormsModule,
|
|
2054
|
-
MatDatepickerModule,
|
|
2055
|
-
MomentDateModule,
|
|
2056
|
-
AgGridRendererModule] }); }
|
|
2057
|
-
}
|
|
2058
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2059
|
-
type: NgModule,
|
|
2060
|
-
args: [{
|
|
2061
|
-
imports: [
|
|
2062
|
-
AgGridModule,
|
|
2063
|
-
CommonModule,
|
|
2064
|
-
FormsModule,
|
|
2065
|
-
ReactiveFormsModule,
|
|
2066
|
-
MatDatepickerModule,
|
|
2067
|
-
MomentDateModule,
|
|
2068
|
-
AgGridRendererModule
|
|
2069
|
-
],
|
|
2070
|
-
declarations: [
|
|
2071
|
-
SelectEditor,
|
|
2072
|
-
AgGridDateCellEditorComponent,
|
|
2073
|
-
DatepickerComponent
|
|
2074
|
-
],
|
|
2075
|
-
exports: [
|
|
2076
|
-
SelectEditor,
|
|
2077
|
-
AgGridDateCellEditorComponent
|
|
2078
|
-
]
|
|
2079
|
-
}]
|
|
2038
|
+
class AgGridEditorModule {
|
|
2039
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AgGridEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2040
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.2", ngImport: i0, type: AgGridEditorModule, declarations: [SelectEditor,
|
|
2041
|
+
AgGridDateCellEditorComponent,
|
|
2042
|
+
DatepickerComponent], imports: [AgGridModule,
|
|
2043
|
+
CommonModule,
|
|
2044
|
+
FormsModule,
|
|
2045
|
+
ReactiveFormsModule,
|
|
2046
|
+
MatDatepickerModule,
|
|
2047
|
+
MomentDateModule,
|
|
2048
|
+
AgGridRendererModule], exports: [SelectEditor,
|
|
2049
|
+
AgGridDateCellEditorComponent] }); }
|
|
2050
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AgGridEditorModule, imports: [AgGridModule,
|
|
2051
|
+
CommonModule,
|
|
2052
|
+
FormsModule,
|
|
2053
|
+
ReactiveFormsModule,
|
|
2054
|
+
MatDatepickerModule,
|
|
2055
|
+
MomentDateModule,
|
|
2056
|
+
AgGridRendererModule] }); }
|
|
2057
|
+
}
|
|
2058
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: AgGridEditorModule, decorators: [{
|
|
2059
|
+
type: NgModule,
|
|
2060
|
+
args: [{
|
|
2061
|
+
imports: [
|
|
2062
|
+
AgGridModule,
|
|
2063
|
+
CommonModule,
|
|
2064
|
+
FormsModule,
|
|
2065
|
+
ReactiveFormsModule,
|
|
2066
|
+
MatDatepickerModule,
|
|
2067
|
+
MomentDateModule,
|
|
2068
|
+
AgGridRendererModule
|
|
2069
|
+
],
|
|
2070
|
+
declarations: [
|
|
2071
|
+
SelectEditor,
|
|
2072
|
+
AgGridDateCellEditorComponent,
|
|
2073
|
+
DatepickerComponent
|
|
2074
|
+
],
|
|
2075
|
+
exports: [
|
|
2076
|
+
SelectEditor,
|
|
2077
|
+
AgGridDateCellEditorComponent
|
|
2078
|
+
]
|
|
2079
|
+
}]
|
|
2080
2080
|
}] });
|
|
2081
2081
|
|
|
2082
|
-
/*
|
|
2083
|
-
* Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
|
|
2084
|
-
*/
|
|
2085
|
-
/**
|
|
2086
|
-
* The module defining the dictionary editor.
|
|
2087
|
-
*
|
|
2088
|
-
* @since 1.0.0
|
|
2089
|
-
*/
|
|
2090
|
-
class DictionaryEditorModule {
|
|
2091
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2092
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
2093
|
-
DictionaryEditorHomeComponent,
|
|
2094
|
-
DictionaryEditorDetailComponent,
|
|
2095
|
-
NewRowComponent], imports: [CommonModule,
|
|
2096
|
-
FormsModule, i3.RouterModule, NgbModule,
|
|
2097
|
-
NavigationModule,
|
|
2098
|
-
MiscModule,
|
|
2099
|
-
AgGridEditorModule,
|
|
2100
|
-
AgGridRendererModule,
|
|
2101
|
-
AgGridModule], exports: [DictionaryEditorComponent,
|
|
2102
|
-
DictionaryEditorHomeComponent,
|
|
2103
|
-
DictionaryEditorDetailComponent] }); }
|
|
2104
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2105
|
-
FormsModule,
|
|
2106
|
-
DICTIONARY_EDITOR_ROUTES,
|
|
2107
|
-
NgbModule,
|
|
2108
|
-
NavigationModule,
|
|
2109
|
-
MiscModule,
|
|
2110
|
-
AgGridEditorModule,
|
|
2111
|
-
AgGridRendererModule,
|
|
2112
|
-
AgGridModule] }); }
|
|
2113
|
-
}
|
|
2114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2115
|
-
type: NgModule,
|
|
2116
|
-
args: [{
|
|
2117
|
-
imports: [
|
|
2118
|
-
CommonModule,
|
|
2119
|
-
FormsModule,
|
|
2120
|
-
DICTIONARY_EDITOR_ROUTES,
|
|
2121
|
-
NgbModule,
|
|
2122
|
-
NavigationModule,
|
|
2123
|
-
MiscModule,
|
|
2124
|
-
AgGridEditorModule,
|
|
2125
|
-
AgGridRendererModule,
|
|
2126
|
-
AgGridModule,
|
|
2127
|
-
],
|
|
2128
|
-
declarations: [
|
|
2129
|
-
DictionaryEditorComponent,
|
|
2130
|
-
DictionaryEditorHomeComponent,
|
|
2131
|
-
DictionaryEditorDetailComponent,
|
|
2132
|
-
NewRowComponent
|
|
2133
|
-
],
|
|
2134
|
-
exports: [
|
|
2135
|
-
DictionaryEditorComponent,
|
|
2136
|
-
DictionaryEditorHomeComponent,
|
|
2137
|
-
DictionaryEditorDetailComponent
|
|
2138
|
-
]
|
|
2139
|
-
}]
|
|
2082
|
+
/*
|
|
2083
|
+
* Copyright (c) 2016 Huntsman Cancer Institute at the University of Utah, Confidential and Proprietary
|
|
2084
|
+
*/
|
|
2085
|
+
/**
|
|
2086
|
+
* The module defining the dictionary editor.
|
|
2087
|
+
*
|
|
2088
|
+
* @since 1.0.0
|
|
2089
|
+
*/
|
|
2090
|
+
class DictionaryEditorModule {
|
|
2091
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DictionaryEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2092
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.2", ngImport: i0, type: DictionaryEditorModule, declarations: [DictionaryEditorComponent,
|
|
2093
|
+
DictionaryEditorHomeComponent,
|
|
2094
|
+
DictionaryEditorDetailComponent,
|
|
2095
|
+
NewRowComponent], imports: [CommonModule,
|
|
2096
|
+
FormsModule, i3.RouterModule, NgbModule,
|
|
2097
|
+
NavigationModule,
|
|
2098
|
+
MiscModule,
|
|
2099
|
+
AgGridEditorModule,
|
|
2100
|
+
AgGridRendererModule,
|
|
2101
|
+
AgGridModule], exports: [DictionaryEditorComponent,
|
|
2102
|
+
DictionaryEditorHomeComponent,
|
|
2103
|
+
DictionaryEditorDetailComponent] }); }
|
|
2104
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DictionaryEditorModule, imports: [CommonModule,
|
|
2105
|
+
FormsModule,
|
|
2106
|
+
DICTIONARY_EDITOR_ROUTES,
|
|
2107
|
+
NgbModule,
|
|
2108
|
+
NavigationModule,
|
|
2109
|
+
MiscModule,
|
|
2110
|
+
AgGridEditorModule,
|
|
2111
|
+
AgGridRendererModule,
|
|
2112
|
+
AgGridModule] }); }
|
|
2113
|
+
}
|
|
2114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.2", ngImport: i0, type: DictionaryEditorModule, decorators: [{
|
|
2115
|
+
type: NgModule,
|
|
2116
|
+
args: [{
|
|
2117
|
+
imports: [
|
|
2118
|
+
CommonModule,
|
|
2119
|
+
FormsModule,
|
|
2120
|
+
DICTIONARY_EDITOR_ROUTES,
|
|
2121
|
+
NgbModule,
|
|
2122
|
+
NavigationModule,
|
|
2123
|
+
MiscModule,
|
|
2124
|
+
AgGridEditorModule,
|
|
2125
|
+
AgGridRendererModule,
|
|
2126
|
+
AgGridModule,
|
|
2127
|
+
],
|
|
2128
|
+
declarations: [
|
|
2129
|
+
DictionaryEditorComponent,
|
|
2130
|
+
DictionaryEditorHomeComponent,
|
|
2131
|
+
DictionaryEditorDetailComponent,
|
|
2132
|
+
NewRowComponent
|
|
2133
|
+
],
|
|
2134
|
+
exports: [
|
|
2135
|
+
DictionaryEditorComponent,
|
|
2136
|
+
DictionaryEditorHomeComponent,
|
|
2137
|
+
DictionaryEditorDetailComponent
|
|
2138
|
+
]
|
|
2139
|
+
}]
|
|
2140
2140
|
}] });
|
|
2141
2141
|
|
|
2142
|
-
/**
|
|
2143
|
-
* Generated bundle index. Do not edit.
|
|
2142
|
+
/**
|
|
2143
|
+
* Generated bundle index. Do not edit.
|
|
2144
2144
|
*/
|
|
2145
2145
|
|
|
2146
2146
|
export { DictionaryEditorComponent, DictionaryEditorDetailComponent, DictionaryEditorHomeComponent, DictionaryEditorModule };
|