ngx-material-entity 15.1.3 → 15.1.5
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/README.md +100 -0
- package/components/confirm-dialog/confirm-dialog.component.d.ts +1 -1
- package/components/edit-page/edit-page.component.d.ts +112 -0
- package/components/edit-page/page-edit-data.builder.d.ts +17 -0
- package/components/input/array/array-date-input/array-date-input.component.d.ts +1 -1
- package/components/input/array/array-date-range-input/array-date-range-input.component.d.ts +1 -1
- package/components/input/array/array-date-time-input/array-date-time-input.component.d.ts +1 -1
- package/components/input/array/array-table.class.d.ts +1 -1
- package/components/input/date/date-input/date-input.component.d.ts +1 -1
- package/components/input/date/date-time-input/date-time-input.component.d.ts +1 -1
- package/components/input/file/file-default-input/file-default-input.component.d.ts +1 -1
- package/components/input/file/file-image-input/file-image-input.component.d.ts +1 -1
- package/components/input/file/file-input/file-input.component.d.ts +3 -3
- package/components/input/input.component.d.ts +3 -3
- package/components/input/relations/references-many-input/references-many-input.component.d.ts +1 -1
- package/components/input/string/string-password-input/string-password-input.component.d.ts +1 -1
- package/components/table/create-dialog/create-entity-dialog-data.builder.d.ts +3 -3
- package/components/table/create-dialog/create-entity-dialog-data.d.ts +1 -1
- package/components/table/create-dialog/create-entity-dialog.component.d.ts +4 -4
- package/components/table/default.actions.d.ts +21 -0
- package/components/table/edit-dialog/{edit-dialog-data.builder.d.ts → edit-data.builder.d.ts} +7 -7
- package/components/table/edit-dialog/{edit-entity-dialog-data.d.ts → edit-entity-data.d.ts} +5 -5
- package/components/table/edit-dialog/edit-entity-dialog.component.d.ts +6 -6
- package/components/table/edit-dialog/edit-entity.builder.d.ts +24 -0
- package/components/table/table-data.builder.d.ts +11 -7
- package/components/table/table-data.d.ts +29 -8
- package/components/table/table.component.d.ts +14 -7
- package/components/table/table.module.d.ts +4 -3
- package/encapsulation/js-2-xml.utilities.d.ts +15 -0
- package/encapsulation/jszip.utilities.d.ts +3 -2
- package/encapsulation/lodash.utilities.d.ts +7 -0
- package/esm2020/classes/entity.model.mjs +2 -2
- package/esm2020/components/confirm-dialog/confirm-dialog.component.mjs +4 -4
- package/esm2020/components/edit-page/edit-page.component.mjs +203 -0
- package/esm2020/components/edit-page/page-edit-data.builder.mjs +32 -0
- package/esm2020/components/input/array/array-date-input/array-date-input.component.mjs +4 -4
- package/esm2020/components/input/array/array-date-range-input/array-date-range-input.component.mjs +4 -4
- package/esm2020/components/input/array/array-date-time-input/array-date-time-input.component.mjs +4 -4
- package/esm2020/components/input/array/array-table.class.mjs +3 -3
- package/esm2020/components/input/base-input.component.mjs +2 -2
- package/esm2020/components/input/date/date-input/date-input.component.mjs +2 -2
- package/esm2020/components/input/date/date-range-input/date-range-input.component.mjs +5 -5
- package/esm2020/components/input/date/date-time-input/date-time-input.component.mjs +3 -3
- package/esm2020/components/input/file/file-default-input/file-default-input.component.mjs +2 -2
- package/esm2020/components/input/file/file-image-input/file-image-input.component.mjs +3 -3
- package/esm2020/components/input/file/file-input/file-input.component.mjs +5 -5
- package/esm2020/components/input/input.component.mjs +6 -6
- package/esm2020/components/input/relations/references-many-input/references-many-input.component.mjs +4 -4
- package/esm2020/components/input/string/string-password-input/string-password-input.component.mjs +4 -4
- package/esm2020/components/table/create-dialog/create-entity-dialog-data.builder.mjs +2 -2
- package/esm2020/components/table/create-dialog/create-entity-dialog-data.mjs +1 -1
- package/esm2020/components/table/create-dialog/create-entity-dialog.component.mjs +5 -5
- package/esm2020/components/table/default.actions.mjs +65 -0
- package/esm2020/components/table/edit-dialog/edit-data.builder.mjs +41 -0
- package/esm2020/components/table/edit-dialog/edit-entity-data.mjs +2 -0
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.component.mjs +16 -16
- package/esm2020/components/table/edit-dialog/edit-entity.builder.mjs +28 -0
- package/esm2020/components/table/table-data.builder.mjs +19 -8
- package/esm2020/components/table/table-data.mjs +1 -1
- package/esm2020/components/table/table.component.mjs +73 -29
- package/esm2020/components/table/table.module.mjs +5 -1
- package/esm2020/decorators/array/array-decorator-internal.data.mjs +2 -2
- package/esm2020/decorators/base/base-property.decorator.mjs +2 -2
- package/esm2020/decorators/date/date-decorator-internal.data.mjs +2 -2
- package/esm2020/decorators/date/date.decorator.mjs +2 -2
- package/esm2020/decorators/file/file.decorator.mjs +2 -2
- package/esm2020/decorators/string/string.decorator.mjs +2 -2
- package/esm2020/encapsulation/js-2-xml.utilities.mjs +18 -0
- package/esm2020/encapsulation/jszip.utilities.mjs +1 -1
- package/esm2020/encapsulation/lodash.utilities.mjs +13 -1
- package/esm2020/public-api.mjs +31 -26
- package/esm2020/services/entity.service.mjs +252 -0
- package/esm2020/services/unsaved-changes.guard.mjs +14 -0
- package/esm2020/utilities/date.utilities.mjs +158 -0
- package/esm2020/utilities/entity.utilities.mjs +828 -0
- package/esm2020/utilities/file.utilities.mjs +176 -0
- package/esm2020/utilities/selection.utilities.mjs +50 -0
- package/fesm2015/ngx-material-entity.mjs +1071 -644
- package/fesm2015/ngx-material-entity.mjs.map +1 -1
- package/fesm2020/ngx-material-entity.mjs +992 -571
- package/fesm2020/ngx-material-entity.mjs.map +1 -1
- package/package.json +3 -2
- package/public-api.d.ts +28 -25
- package/{classes → services}/entity.service.d.ts +25 -1
- package/services/unsaved-changes.guard.d.ts +4 -0
- package/{classes → utilities}/entity.utilities.d.ts +1 -1
- package/{classes → utilities}/file.utilities.d.ts +7 -0
- package/components/table/edit-dialog/edit-entity-dialog.builder.d.ts +0 -24
- package/esm2020/classes/date.utilities.mjs +0 -158
- package/esm2020/classes/entity.service.mjs +0 -213
- package/esm2020/classes/entity.utilities.mjs +0 -828
- package/esm2020/classes/file.utilities.mjs +0 -163
- package/esm2020/classes/selection.utilities.mjs +0 -50
- package/esm2020/components/table/edit-dialog/edit-dialog-data.builder.mjs +0 -41
- package/esm2020/components/table/edit-dialog/edit-entity-dialog-data.mjs +0 -2
- package/esm2020/components/table/edit-dialog/edit-entity-dialog.builder.mjs +0 -28
- /package/{classes → utilities}/date.utilities.d.ts +0 -0
- /package/{classes → utilities}/selection.utilities.d.ts +0 -0
|
@@ -2,7 +2,6 @@ import 'reflect-metadata';
|
|
|
2
2
|
import { __awaiter, __decorate, __metadata, __param } from 'tslib';
|
|
3
3
|
import { isEqual, cloneDeep, omit, isNil, omitBy, isArray } from 'lodash';
|
|
4
4
|
import JSZip from 'jszip';
|
|
5
|
-
import { BehaviorSubject, firstValueFrom, Subject, takeUntil } from 'rxjs';
|
|
6
5
|
import * as i0 from '@angular/core';
|
|
7
6
|
import { Component, Inject, NgModule, EventEmitter, Input, Output, Directive, HostListener, InjectionToken, ViewChild } from '@angular/core';
|
|
8
7
|
import * as i1 from '@angular/material/dialog';
|
|
@@ -15,6 +14,11 @@ import * as i4$1 from '@angular/material/checkbox';
|
|
|
15
14
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
16
15
|
import * as i5 from '@angular/material/button';
|
|
17
16
|
import { MatButtonModule } from '@angular/material/button';
|
|
17
|
+
import * as i7 from '@angular/material/progress-spinner';
|
|
18
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
19
|
+
import * as i6$1 from '@angular/material/tabs';
|
|
20
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
21
|
+
import { BehaviorSubject, firstValueFrom, first, map, Subject, takeUntil, Observable } from 'rxjs';
|
|
18
22
|
import * as i6 from '@angular/material/autocomplete';
|
|
19
23
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
20
24
|
import * as i5$3 from '@angular/material/chips';
|
|
@@ -34,16 +38,16 @@ import * as i4$5 from '@angular/material/slider';
|
|
|
34
38
|
import { MatSliderModule } from '@angular/material/slider';
|
|
35
39
|
import * as i5$1 from '@angular/material/table';
|
|
36
40
|
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
|
37
|
-
import * as i6$1 from '@angular/material/tabs';
|
|
38
|
-
import { MatTabsModule } from '@angular/material/tabs';
|
|
39
41
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
40
42
|
import * as i5$2 from '@angular/material/core';
|
|
41
43
|
import * as i3 from '@angular/cdk/text-field';
|
|
42
|
-
import * as
|
|
44
|
+
import * as i3$1 from '@angular/router';
|
|
45
|
+
import * as i8 from '@angular/material/paginator';
|
|
43
46
|
import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
|
|
44
47
|
import { MatSort } from '@angular/material/sort';
|
|
45
|
-
import * as
|
|
48
|
+
import * as i10 from '@angular/material/menu';
|
|
46
49
|
import { MatMenuModule } from '@angular/material/menu';
|
|
50
|
+
import * as js2xml from 'js2xmlparser';
|
|
47
51
|
|
|
48
52
|
/**
|
|
49
53
|
* The enum Values for all the different DecoratorTypes.
|
|
@@ -149,6 +153,18 @@ class LodashUtilities {
|
|
|
149
153
|
static isArray(value) {
|
|
150
154
|
return isArray(value);
|
|
151
155
|
}
|
|
156
|
+
/* istanbul ignore next */
|
|
157
|
+
/**
|
|
158
|
+
* Checks if value is classified as an object that is not an array.
|
|
159
|
+
*
|
|
160
|
+
* @param value - The value to check.
|
|
161
|
+
* @returns Returns true if value is correctly classified, else false.
|
|
162
|
+
*/
|
|
163
|
+
static isObject(value) {
|
|
164
|
+
return value !== null
|
|
165
|
+
&& typeof value === 'object'
|
|
166
|
+
&& !LodashUtilities.isArray(value);
|
|
167
|
+
}
|
|
152
168
|
}
|
|
153
169
|
|
|
154
170
|
/**
|
|
@@ -497,10 +513,23 @@ class FileUtilities {
|
|
|
497
513
|
* @param fileData - The file data. Needs to contain a blob.
|
|
498
514
|
*/
|
|
499
515
|
static downloadSingleFile(fileData) {
|
|
516
|
+
this.downLoadBlob(fileData.file, fileData.name);
|
|
517
|
+
}
|
|
518
|
+
// TODO: Find a way to use blobs with jest
|
|
519
|
+
/* istanbul ignore next */
|
|
520
|
+
/**
|
|
521
|
+
* Downloads a blob.
|
|
522
|
+
*
|
|
523
|
+
* @param blob - The blob to download.
|
|
524
|
+
* @param name - The name of the downloaded file.
|
|
525
|
+
*/
|
|
526
|
+
static downLoadBlob(blob, name) {
|
|
500
527
|
const a = document.createElement('a');
|
|
501
|
-
const objectUrl = URL.createObjectURL(
|
|
528
|
+
const objectUrl = URL.createObjectURL(blob);
|
|
502
529
|
a.href = objectUrl;
|
|
503
|
-
|
|
530
|
+
if (name) {
|
|
531
|
+
a.download = name;
|
|
532
|
+
}
|
|
504
533
|
a.click();
|
|
505
534
|
URL.revokeObjectURL(objectUrl);
|
|
506
535
|
}
|
|
@@ -1575,230 +1604,6 @@ __decorate([
|
|
|
1575
1604
|
__metadata("design:type", String)
|
|
1576
1605
|
], Entity.prototype, "id", void 0);
|
|
1577
1606
|
|
|
1578
|
-
/**
|
|
1579
|
-
* A generic EntityService class.
|
|
1580
|
-
* Offers basic CRUD-functionality.
|
|
1581
|
-
* You should create a service for every Entity you have.
|
|
1582
|
-
* If you extend from this you need to make sure that the extended Service can be injected.
|
|
1583
|
-
*/
|
|
1584
|
-
class EntityService {
|
|
1585
|
-
constructor(http) {
|
|
1586
|
-
this.http = http;
|
|
1587
|
-
/**
|
|
1588
|
-
* The key which holds the id value.
|
|
1589
|
-
*
|
|
1590
|
-
* @default 'id'
|
|
1591
|
-
*/
|
|
1592
|
-
this.idKey = 'id';
|
|
1593
|
-
/**
|
|
1594
|
-
* A subject of all the entity values.
|
|
1595
|
-
* Can be subscribed to when you want to do a specific thing whenever the entities change.
|
|
1596
|
-
*/
|
|
1597
|
-
this.entitiesSubject = new BehaviorSubject([]);
|
|
1598
|
-
}
|
|
1599
|
-
/**
|
|
1600
|
-
* Gets the entities in an array from the internal entitiesSubject.
|
|
1601
|
-
*
|
|
1602
|
-
* @returns The current entities in form of an array.
|
|
1603
|
-
*/
|
|
1604
|
-
get entities() {
|
|
1605
|
-
return this.entitiesSubject.value;
|
|
1606
|
-
}
|
|
1607
|
-
/**
|
|
1608
|
-
* Creates a new Entity and pushes it to the entities array.
|
|
1609
|
-
*
|
|
1610
|
-
* @param entity - The data of the entity to create.
|
|
1611
|
-
* All values that should be omitted will be removed from it inside this method.
|
|
1612
|
-
* @returns A Promise of the created entity.
|
|
1613
|
-
*/
|
|
1614
|
-
create(entity) {
|
|
1615
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1616
|
-
const body = LodashUtilities.omit(entity, EntityUtilities.getOmitForCreate(entity));
|
|
1617
|
-
const filePropertyKeys = EntityUtilities.getFileProperties(entity);
|
|
1618
|
-
if (!filePropertyKeys.length) {
|
|
1619
|
-
return yield this.createWithJson(body);
|
|
1620
|
-
}
|
|
1621
|
-
else {
|
|
1622
|
-
return yield this.createWithFormData(body, filePropertyKeys, entity);
|
|
1623
|
-
}
|
|
1624
|
-
});
|
|
1625
|
-
}
|
|
1626
|
-
// TODO: Find a way to use blobs with jest
|
|
1627
|
-
/* istanbul ignore next */
|
|
1628
|
-
/**
|
|
1629
|
-
* Creates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
|
|
1630
|
-
* All file values are stored inside their respective property key and their name.
|
|
1631
|
-
* Form data is able to handle setting multiple files to the same key.
|
|
1632
|
-
*
|
|
1633
|
-
* @param body - The body Of the request.
|
|
1634
|
-
* @param filePropertyKeys - All property keys that are files and need to be added to the form data.
|
|
1635
|
-
* @param entity - The entity to create. This is needed in addition to the body because the body doesn't contain any metadata.
|
|
1636
|
-
* @returns The created entity from the server.
|
|
1637
|
-
*/
|
|
1638
|
-
createWithFormData(body, filePropertyKeys, entity) {
|
|
1639
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1640
|
-
const formData = new FormData();
|
|
1641
|
-
formData.append('body', JSON.stringify(LodashUtilities.omit(body, filePropertyKeys)));
|
|
1642
|
-
for (const key of filePropertyKeys) {
|
|
1643
|
-
if (EntityUtilities.getPropertyMetadata(entity, key, DecoratorTypes.FILE_DEFAULT).multiple) {
|
|
1644
|
-
const fileDataValues = body[key];
|
|
1645
|
-
for (const value of fileDataValues) {
|
|
1646
|
-
formData.append(key, (yield FileUtilities.getFileData(value)).file, value.name);
|
|
1647
|
-
}
|
|
1648
|
-
}
|
|
1649
|
-
else {
|
|
1650
|
-
const fileData = body[key];
|
|
1651
|
-
formData.append(key, (yield FileUtilities.getFileData(fileData)).file, fileData.name);
|
|
1652
|
-
}
|
|
1653
|
-
}
|
|
1654
|
-
const e = yield firstValueFrom(this.http.post(this.baseUrl, formData));
|
|
1655
|
-
if (!e) {
|
|
1656
|
-
throw new Error(`
|
|
1657
|
-
The created entity was not returned in the response.
|
|
1658
|
-
If you want to provide a logic that allows that
|
|
1659
|
-
you need to override the create methods of this class.
|
|
1660
|
-
`);
|
|
1661
|
-
}
|
|
1662
|
-
this.entities.push(e);
|
|
1663
|
-
this.entitiesSubject.next(this.entities);
|
|
1664
|
-
return e;
|
|
1665
|
-
});
|
|
1666
|
-
}
|
|
1667
|
-
/**
|
|
1668
|
-
* Creates the entity with a normal json body in contrast to creating it with form data when the entity contains files.
|
|
1669
|
-
*
|
|
1670
|
-
* @param body - The body Of the request.
|
|
1671
|
-
* @returns The created entity from the server.
|
|
1672
|
-
*/
|
|
1673
|
-
createWithJson(body) {
|
|
1674
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1675
|
-
const e = yield firstValueFrom(this.http.post(this.baseUrl, body));
|
|
1676
|
-
if (!e) {
|
|
1677
|
-
throw new Error(`
|
|
1678
|
-
The created entity was not returned in the response.
|
|
1679
|
-
If you want to provide a logic that allows that
|
|
1680
|
-
you need to override the create methods of this class.
|
|
1681
|
-
`);
|
|
1682
|
-
}
|
|
1683
|
-
this.entities.push(e);
|
|
1684
|
-
this.entitiesSubject.next(this.entities);
|
|
1685
|
-
return e;
|
|
1686
|
-
});
|
|
1687
|
-
}
|
|
1688
|
-
/**
|
|
1689
|
-
* Gets all existing entities and pushes them to the entities array.
|
|
1690
|
-
*
|
|
1691
|
-
* @returns A Promise of all received Entities.
|
|
1692
|
-
*/
|
|
1693
|
-
read() {
|
|
1694
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1695
|
-
const e = yield firstValueFrom(this.http.get(this.baseUrl));
|
|
1696
|
-
this.entitiesSubject.next(e);
|
|
1697
|
-
return e;
|
|
1698
|
-
});
|
|
1699
|
-
}
|
|
1700
|
-
/**
|
|
1701
|
-
* Updates a specific Entity.
|
|
1702
|
-
*
|
|
1703
|
-
* @param entity - The updated Entity
|
|
1704
|
-
* All values that should be omitted will be removed from it inside this method.
|
|
1705
|
-
* @param entityPriorChanges - The current Entity.
|
|
1706
|
-
* It Is used to get changed values and only update them instead of sending the whole entity data.
|
|
1707
|
-
*/
|
|
1708
|
-
update(entity, entityPriorChanges) {
|
|
1709
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1710
|
-
const body = LodashUtilities.omit(yield EntityUtilities.difference(entity, entityPriorChanges), EntityUtilities.getOmitForUpdate(entity));
|
|
1711
|
-
const filePropertyKeys = EntityUtilities.getFileProperties(entityPriorChanges);
|
|
1712
|
-
if (!filePropertyKeys.length) {
|
|
1713
|
-
yield this.updateWithJson(body, entityPriorChanges[this.idKey]);
|
|
1714
|
-
}
|
|
1715
|
-
else {
|
|
1716
|
-
yield this.updateWithFormData(body, filePropertyKeys, entity, entityPriorChanges[this.idKey]);
|
|
1717
|
-
}
|
|
1718
|
-
});
|
|
1719
|
-
}
|
|
1720
|
-
// TODO: Find a way to use blobs with jest
|
|
1721
|
-
/* istanbul ignore next */
|
|
1722
|
-
/**
|
|
1723
|
-
* Updates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
|
|
1724
|
-
* All file values are stored inside their respective property key and their name.
|
|
1725
|
-
* Form data is able to handle setting multiple files to the same key.
|
|
1726
|
-
*
|
|
1727
|
-
* @param body - The request body. Already contains only properties that have changed.
|
|
1728
|
-
* @param filePropertyKeys - The keys of all properties which are files and need to separately be appended to the form data.
|
|
1729
|
-
* @param entity - The original entity. Is needed to get the metadata of all the files.
|
|
1730
|
-
* @param id - The id of the entity to update.
|
|
1731
|
-
*/
|
|
1732
|
-
updateWithFormData(body, filePropertyKeys, entity, id) {
|
|
1733
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1734
|
-
const formData = new FormData();
|
|
1735
|
-
formData.append('body', JSON.stringify(LodashUtilities.omitBy(body, LodashUtilities.isNil)));
|
|
1736
|
-
for (const key of filePropertyKeys) {
|
|
1737
|
-
if (EntityUtilities.getPropertyMetadata(entity, key, DecoratorTypes.FILE_DEFAULT).multiple) {
|
|
1738
|
-
const fileDataValues = body[key];
|
|
1739
|
-
for (const value of fileDataValues) {
|
|
1740
|
-
formData.append(key, (yield FileUtilities.getFileData(value)).file, value.name);
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
else {
|
|
1744
|
-
const fileData = body[key];
|
|
1745
|
-
formData.append(key, (yield FileUtilities.getFileData(fileData)).file, fileData.name);
|
|
1746
|
-
}
|
|
1747
|
-
}
|
|
1748
|
-
const updatedEntity = yield firstValueFrom(this.http.patch(`${this.baseUrl}/${id}`, formData));
|
|
1749
|
-
if (!updatedEntity) {
|
|
1750
|
-
// eslint-disable-next-line no-console
|
|
1751
|
-
console.warn('The updated entity was not returned in the response. Applying the changes from the request body.');
|
|
1752
|
-
for (const key in body) {
|
|
1753
|
-
this.entities[this.entities.findIndex(e => e[this.idKey] === id)][key]
|
|
1754
|
-
= body[key];
|
|
1755
|
-
}
|
|
1756
|
-
this.entitiesSubject.next(this.entities);
|
|
1757
|
-
return;
|
|
1758
|
-
}
|
|
1759
|
-
this.entities[this.entities.findIndex(e => e[this.idKey] === id)] = updatedEntity;
|
|
1760
|
-
this.entitiesSubject.next(this.entities);
|
|
1761
|
-
});
|
|
1762
|
-
}
|
|
1763
|
-
/**
|
|
1764
|
-
* Updates the entity with a normal json body in contrast to updating it with form data when the entity contains files.
|
|
1765
|
-
*
|
|
1766
|
-
* @param body - The body of the Request. Has already removed all unnecessary values.
|
|
1767
|
-
* @param id - The id of the entity to update.
|
|
1768
|
-
*/
|
|
1769
|
-
updateWithJson(body, id) {
|
|
1770
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1771
|
-
const updatedEntity = yield firstValueFrom(this.http.patch(`${this.baseUrl}/${id}`, LodashUtilities.omitBy(body, LodashUtilities.isNil)));
|
|
1772
|
-
if (!updatedEntity) {
|
|
1773
|
-
// eslint-disable-next-line no-console
|
|
1774
|
-
console.warn('The updated entity was not returned in the response. Applying the changes from the request body.');
|
|
1775
|
-
const foundEntity = this.entities[this.entities.findIndex(e => e[this.idKey] === id)];
|
|
1776
|
-
for (const key in body) {
|
|
1777
|
-
foundEntity[key]
|
|
1778
|
-
= body[key];
|
|
1779
|
-
}
|
|
1780
|
-
this.entitiesSubject.next(this.entities);
|
|
1781
|
-
return;
|
|
1782
|
-
}
|
|
1783
|
-
this.entities[this.entities.findIndex(e => e[this.idKey] === id)] = updatedEntity;
|
|
1784
|
-
this.entitiesSubject.next(this.entities);
|
|
1785
|
-
});
|
|
1786
|
-
}
|
|
1787
|
-
/**
|
|
1788
|
-
* Deletes a specific Entity.
|
|
1789
|
-
*
|
|
1790
|
-
* @param entity - The entity to delete.
|
|
1791
|
-
*/
|
|
1792
|
-
delete(entity) {
|
|
1793
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1794
|
-
yield firstValueFrom(this.http.delete(`${this.baseUrl}/${entity[this.idKey]}`));
|
|
1795
|
-
// the == comparison instead of === is to catch ids that are numbers.
|
|
1796
|
-
this.entities.splice(this.entities.findIndex(e => e[this.idKey] === entity[this.idKey]), 1);
|
|
1797
|
-
this.entitiesSubject.next(this.entities);
|
|
1798
|
-
});
|
|
1799
|
-
}
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
1607
|
/**
|
|
1803
1608
|
* The abstract BaseBuilder class.
|
|
1804
1609
|
*/
|
|
@@ -1901,16 +1706,16 @@ class NgxMatEntityConfirmDialogComponent {
|
|
|
1901
1706
|
this.dialogRef.disableClose = true;
|
|
1902
1707
|
}
|
|
1903
1708
|
/**
|
|
1904
|
-
* Closes the dialog with
|
|
1709
|
+
* Closes the dialog with true to signal that the action should be run.
|
|
1905
1710
|
*/
|
|
1906
1711
|
confirmAction() {
|
|
1907
|
-
this.dialogRef.close(
|
|
1712
|
+
this.dialogRef.close(true);
|
|
1908
1713
|
}
|
|
1909
1714
|
/**
|
|
1910
1715
|
* Closes the dialog.
|
|
1911
1716
|
*/
|
|
1912
1717
|
cancel() {
|
|
1913
|
-
this.dialogRef.close();
|
|
1718
|
+
this.dialogRef.close(false);
|
|
1914
1719
|
}
|
|
1915
1720
|
}
|
|
1916
1721
|
NgxMatEntityConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityConfirmDialogComponent, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -2127,10 +1932,10 @@ class ArrayDateInputComponent extends ArrayTableComponent {
|
|
|
2127
1932
|
}
|
|
2128
1933
|
}
|
|
2129
1934
|
ArrayDateInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ArrayDateInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2130
|
-
ArrayDateInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: ArrayDateInputComponent, selector: "array-date-input", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ? metadata.min(input) : undefined\"\n [max]=\"metadata.max ? metadata.max(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filter ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"model.errors\"\n (click)=\"add()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\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.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4$2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4$2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }] });
|
|
1935
|
+
ArrayDateInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: ArrayDateInputComponent, selector: "array-date-input", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ? metadata.min(input) : undefined\"\n [max]=\"metadata.max ? metadata.max(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filter ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"model.errors\"\n (click)=\"add()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\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.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4$2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4$2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }] });
|
|
2131
1936
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ArrayDateInputComponent, decorators: [{
|
|
2132
1937
|
type: Component,
|
|
2133
|
-
args: [{ selector: 'array-date-input', template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ? metadata.min(input) : undefined\"\n [max]=\"metadata.max ? metadata.max(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filter ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"model.errors\"\n (click)=\"add()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"] }]
|
|
1938
|
+
args: [{ selector: 'array-date-input', template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.min ? metadata.min(input) : undefined\"\n [max]=\"metadata.max ? metadata.max(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filter ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"model.errors\"\n (click)=\"add()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"] }]
|
|
2134
1939
|
}] });
|
|
2135
1940
|
|
|
2136
1941
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
@@ -2166,10 +1971,10 @@ class ArrayDateRangeInputComponent extends ArrayTableComponent {
|
|
|
2166
1971
|
}
|
|
2167
1972
|
}
|
|
2168
1973
|
ArrayDateRangeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ArrayDateRangeInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2169
|
-
ArrayDateRangeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: ArrayDateRangeInputComponent, selector: "array-date-range-input", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ? metadata.filter : DateUtilities.defaultDateFilter\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(input?.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(input?.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(input?.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(input?.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n \n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"startModel.errors || endModel.errors\"\n (click)=\"addDateRange()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\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: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i4$2.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i4$2.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i4$2.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i4$2.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }] });
|
|
1974
|
+
ArrayDateRangeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: ArrayDateRangeInputComponent, selector: "array-date-range-input", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ? metadata.filter : DateUtilities.defaultDateFilter\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(input?.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(input?.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(input?.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(input?.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n \n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"startModel.errors || endModel.errors\"\n (click)=\"addDateRange()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\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: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i4$2.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i4$2.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i4$2.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i4$2.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }] });
|
|
2170
1975
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ArrayDateRangeInputComponent, decorators: [{
|
|
2171
1976
|
type: Component,
|
|
2172
|
-
args: [{ selector: 'array-date-range-input', template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ? metadata.filter : DateUtilities.defaultDateFilter\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(input?.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(input?.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(input?.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(input?.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n \n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"startModel.errors || endModel.errors\"\n (click)=\"addDateRange()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"] }]
|
|
1977
|
+
args: [{ selector: 'array-date-range-input', template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ? metadata.filter : DateUtilities.defaultDateFilter\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(input?.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(input?.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(input?.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(input?.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n \n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n </mat-form-field>\n \n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"startModel.errors || endModel.errors\"\n (click)=\"addDateRange()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"] }]
|
|
2173
1978
|
}] });
|
|
2174
1979
|
|
|
2175
1980
|
class ArrayDateTimeInputComponent extends ArrayTableComponent {
|
|
@@ -2201,10 +2006,10 @@ class ArrayDateTimeInputComponent extends ArrayTableComponent {
|
|
|
2201
2006
|
}
|
|
2202
2007
|
}
|
|
2203
2008
|
ArrayDateTimeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ArrayDateTimeInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2204
|
-
ArrayDateTimeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: ArrayDateTimeInputComponent, selector: "array-date-time-input", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <div class=\"date-time\">\n <mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minDate ? metadata.minDate(input) : undefined\"\n [max]=\"metadata.maxDate ? metadata.maxDate(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filterDate ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n <mat-form-field class=\"timepicker\">\n <mat-label>{{metadata.timeDisplayName}}</mat-label>\n <mat-select\n [(ngModel)]=\"time\"\n [name]=\"key.toString() + 'time'\"\n #timeModel=\"ngModel\"\n [required]=\"metadata.required\"\n >\n <mat-option *ngFor=\"let validTime of DateUtilities.getValidTimesForDropdown(\n metadata.times,\n input,\n metadata.minTime,\n metadata.maxTime,\n metadata.filterTime\n )\"\n [value]=\"validTime.value\"\n >\n {{validTime.displayName}}\n </mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(timeModel)}}</mat-error>\n </mat-form-field>\n </div>\n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"model.errors || timeModel.errors || DateUtilities.timeIsUnprocessable(time)\"\n (click)=\"addDateTime()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.date-time{display:flex;align-items:baseline}.date-time .timepicker{margin-left:10px}\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.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$3.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i5$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4$2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4$2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }] });
|
|
2009
|
+
ArrayDateTimeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: ArrayDateTimeInputComponent, selector: "array-date-time-input", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <div class=\"date-time\">\n <mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minDate ? metadata.minDate(input) : undefined\"\n [max]=\"metadata.maxDate ? metadata.maxDate(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filterDate ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n <mat-form-field class=\"timepicker\">\n <mat-label>{{metadata.timeDisplayName}}</mat-label>\n <mat-select\n [(ngModel)]=\"time\"\n [name]=\"key.toString() + 'time'\"\n #timeModel=\"ngModel\"\n [required]=\"metadata.required\"\n >\n <mat-option *ngFor=\"let validTime of DateUtilities.getValidTimesForDropdown(\n metadata.times,\n input,\n metadata.minTime,\n metadata.maxTime,\n metadata.filterTime\n )\"\n [value]=\"validTime.value\"\n >\n {{validTime.displayName}}\n </mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(timeModel)}}</mat-error>\n </mat-form-field>\n </div>\n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"model.errors || timeModel.errors || DateUtilities.timeIsUnprocessable(time)\"\n (click)=\"addDateTime()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.date-time{display:flex;align-items:baseline}.date-time .timepicker{margin-left:10px}\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.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$3.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i5$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4$2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4$2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i4$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }] });
|
|
2205
2010
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ArrayDateTimeInputComponent, decorators: [{
|
|
2206
2011
|
type: Component,
|
|
2207
|
-
args: [{ selector: 'array-date-time-input', template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <div class=\"date-time\">\n <mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minDate ? metadata.minDate(input) : undefined\"\n [max]=\"metadata.maxDate ? metadata.maxDate(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filterDate ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n <mat-form-field class=\"timepicker\">\n <mat-label>{{metadata.timeDisplayName}}</mat-label>\n <mat-select\n [(ngModel)]=\"time\"\n [name]=\"key.toString() + 'time'\"\n #timeModel=\"ngModel\"\n [required]=\"metadata.required\"\n >\n <mat-option *ngFor=\"let validTime of DateUtilities.getValidTimesForDropdown(\n metadata.times,\n input,\n metadata.minTime,\n metadata.maxTime,\n metadata.filterTime\n )\"\n [value]=\"validTime.value\"\n >\n {{validTime.displayName}}\n </mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(timeModel)}}</mat-error>\n </mat-form-field>\n </div>\n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"model.errors || timeModel.errors || DateUtilities.timeIsUnprocessable(time)\"\n (click)=\"addDateTime()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: ["mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.date-time{display:flex;align-items:baseline}.date-time .timepicker{margin-left:10px}\n"] }]
|
|
2012
|
+
args: [{ selector: 'array-date-time-input', template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n <div *ngIf=\"!isReadOnly\">\n <div class=\"date-time\">\n <mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n <input\n matInput\n [(ngModel)]=\"input\"\n [name]=\"key.toString()\"\n #model=\"ngModel\"\n [matDatepicker]=\"picker\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minDate ? metadata.minDate(input) : undefined\"\n [max]=\"metadata.maxDate ? metadata.maxDate(input) : undefined\"\n [matDatepickerFilter]=\"metadata.filterDate ?? DateUtilities.defaultDateFilter\"\n >\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-datepicker #picker></mat-datepicker>\n <mat-error>{{getValidationErrorMessage(model)}}</mat-error>\n </mat-form-field>\n <mat-form-field class=\"timepicker\">\n <mat-label>{{metadata.timeDisplayName}}</mat-label>\n <mat-select\n [(ngModel)]=\"time\"\n [name]=\"key.toString() + 'time'\"\n #timeModel=\"ngModel\"\n [required]=\"metadata.required\"\n >\n <mat-option *ngFor=\"let validTime of DateUtilities.getValidTimesForDropdown(\n metadata.times,\n input,\n metadata.minTime,\n metadata.maxTime,\n metadata.filterTime\n )\"\n [value]=\"validTime.value\"\n >\n {{validTime.displayName}}\n </mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(timeModel)}}</mat-error>\n </mat-form-field>\n </div>\n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"model.errors || timeModel.errors || DateUtilities.timeIsUnprocessable(time)\"\n (click)=\"addDateTime()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n </div>\n\n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"></mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <div class=\"array-error\" *ngIf=\"metadata.required && !dataSource.data.length\">\n {{metadata.missingErrorMessage}}\n </div>\n</div>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}mat-form-field{width:100%}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}.array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.date-time{display:flex;align-items:baseline}.date-time .timepicker{margin-left:10px}\n"] }]
|
|
2208
2013
|
}] });
|
|
2209
2014
|
|
|
2210
2015
|
/* eslint-disable jsdoc/require-jsdoc */
|
|
@@ -2444,10 +2249,10 @@ class DateRangeInputComponent extends NgxMatEntityBaseInputComponent {
|
|
|
2444
2249
|
}
|
|
2445
2250
|
}
|
|
2446
2251
|
DateRangeInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: DateRangeInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2447
|
-
DateRangeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: DateRangeInputComponent, selector: "date-range-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ?? defaultDateFilter\" [disabled]=\"isReadOnly\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(dateRange.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(dateRange.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(dateRange.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(dateRange.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n\n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i4$2.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i4$2.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i4$2.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i4$2.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }] });
|
|
2252
|
+
DateRangeInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: DateRangeInputComponent, selector: "date-range-input", usesInheritance: true, ngImport: i0, template: "<mat-form-field *ngIf=\"dateRange\">\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ?? defaultDateFilter\" [disabled]=\"isReadOnly\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(dateRange.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(dateRange.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(dateRange.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(dateRange.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n\n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$2.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i4$2.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i4$2.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i4$2.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i4$2.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }] });
|
|
2448
2253
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: DateRangeInputComponent, decorators: [{
|
|
2449
2254
|
type: Component,
|
|
2450
|
-
args: [{ selector: 'date-range-input', template: "<mat-form-field>\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ?? defaultDateFilter\" [disabled]=\"isReadOnly\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(dateRange.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(dateRange.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(dateRange.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(dateRange.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n\n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
2255
|
+
args: [{ selector: 'date-range-input', template: "<mat-form-field *ngIf=\"dateRange\">\n <mat-label>{{metadata.displayName}}</mat-label>\n \n <mat-date-range-input [rangePicker]=\"picker\" [required]=\"metadata.required\" [dateFilter]=\"metadata.filter ?? defaultDateFilter\" [disabled]=\"isReadOnly\">\n <input matStartDate\n [(ngModel)]=\"dateRangeStart\"\n [name]=\"key.toString() + 'start'\"\n #startModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minStart ? metadata.minStart(dateRange.start) : undefined\"\n [max]=\"metadata.maxStart ? metadata.maxStart(dateRange.start) : undefined\"\n [placeholder]=\"metadata.placeholderStart\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n <input matEndDate\n [(ngModel)]=\"dateRangeEnd\"\n [name]=\"key.toString() + 'end'\"\n #endModel=\"ngModel\"\n [required]=\"metadata.required\"\n [min]=\"metadata.minEnd ? metadata.minEnd(dateRange.end) : undefined\"\n [max]=\"metadata.maxEnd ? metadata.maxEnd(dateRange.end) : undefined\"\n [placeholder]=\"metadata.placeholderEnd\"\n (ngModelChange)=\"setDateRangeValues()\"\n >\n </mat-date-range-input>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker #picker></mat-date-range-picker>\n\n <mat-error *ngIf=\"startModel.errors\">{{getValidationErrorMessage(startModel)}}</mat-error>\n <mat-error *ngIf=\"!startModel.errors && endModel.errors\">{{getValidationErrorMessage(endModel)}}</mat-error>\n</mat-form-field>", styles: ["mat-form-field{width:100%}\n"] }]
|
|
2451
2256
|
}] });
|
|
2452
2257
|
|
|
2453
2258
|
class DateTimeInputComponent extends NgxMatEntityBaseInputComponent {
|
|
@@ -3181,10 +2986,10 @@ class ReferencesManyInputComponent extends NgxMatEntityBaseInputComponent {
|
|
|
3181
2986
|
}
|
|
3182
2987
|
}
|
|
3183
2988
|
ReferencesManyInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ReferencesManyInputComponent, deps: [{ token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Component });
|
|
3184
|
-
ReferencesManyInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: ReferencesManyInputComponent, selector: "references-many-input", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n\n <mat-form-field>\n <mat-label>{{metadata.dropdownLabel}}</mat-label>\n <mat-select [(ngModel)]=\"input\" [name]=\"key.toString() + 'input'\" #inputModel=\"ngModel\" [disabled]=\"isReadOnly\">\n <mat-option>-</mat-option>\n <mat-option *ngFor=\"let value of dropdownValues\" [value]=\"value.value\">{{value.displayName}}</mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(inputModel)}}</mat-error>\n </mat-form-field>\n\n <button type=\"button\" *ngIf=\"metadata.addAll\" style=\"margin-left: 20px;\" mat-raised-button [disabled]=\"!dropdownValues.length || isReadOnly\" (click)=\"addAll()\">\n {{metadata.addAllButtonLabel}}\n </button>\n\n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button [disabled]=\"!input\" (click)=\"add()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button [disabled]=\"!selection.selected.length\" (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n\n <mat-table [dataSource]=\"referencedEntitiesDataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\" *ngIf=\"!isReadOnly\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox\n [disabled]=\"!referencedEntitiesDataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, referencedEntitiesDataSource) : null\"\n [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, referencedEntitiesDataSource)\"\n [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, referencedEntitiesDataSource)\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entityId\">\n {{dCol.value(metadata.getEntityForId(entityId, allReferencedEntities))}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n</div>", styles: [".elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}\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: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$3.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i5$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
2989
|
+
ReferencesManyInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: ReferencesManyInputComponent, selector: "references-many-input", usesInheritance: true, ngImport: i0, template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n\n <mat-form-field>\n <mat-label>{{metadata.dropdownLabel}}</mat-label>\n <mat-select [(ngModel)]=\"input\" [name]=\"key.toString() + 'input'\" #inputModel=\"ngModel\" [disabled]=\"isReadOnly\">\n <mat-option>-</mat-option>\n <mat-option *ngFor=\"let value of dropdownValues\" [value]=\"value.value\">{{value.displayName}}</mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(inputModel)}}</mat-error>\n </mat-form-field>\n\n <button type=\"button\" *ngIf=\"metadata.addAll\" style=\"margin-left: 20px;\" mat-raised-button [disabled]=\"!dropdownValues.length || isReadOnly\" (click)=\"addAll()\">\n {{metadata.addAllButtonLabel}}\n </button>\n\n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button [disabled]=\"!input\" (click)=\"add()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button [disabled]=\"!selection.selected.length\" (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n\n <mat-table [dataSource]=\"referencedEntitiesDataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\" *ngIf=\"!isReadOnly\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox\n [disabled]=\"!referencedEntitiesDataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, referencedEntitiesDataSource) : null\"\n [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, referencedEntitiesDataSource)\"\n [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, referencedEntitiesDataSource)\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entityId\">\n {{dCol.value(metadata.getEntityForId(entityId, allReferencedEntities))}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n</div>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}\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: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$1.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$3.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "component", type: i5$2.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
3185
2990
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: ReferencesManyInputComponent, decorators: [{
|
|
3186
2991
|
type: Component,
|
|
3187
|
-
args: [{ selector: 'references-many-input', template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n\n <mat-form-field>\n <mat-label>{{metadata.dropdownLabel}}</mat-label>\n <mat-select [(ngModel)]=\"input\" [name]=\"key.toString() + 'input'\" #inputModel=\"ngModel\" [disabled]=\"isReadOnly\">\n <mat-option>-</mat-option>\n <mat-option *ngFor=\"let value of dropdownValues\" [value]=\"value.value\">{{value.displayName}}</mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(inputModel)}}</mat-error>\n </mat-form-field>\n\n <button type=\"button\" *ngIf=\"metadata.addAll\" style=\"margin-left: 20px;\" mat-raised-button [disabled]=\"!dropdownValues.length || isReadOnly\" (click)=\"addAll()\">\n {{metadata.addAllButtonLabel}}\n </button>\n\n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button [disabled]=\"!input\" (click)=\"add()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button [disabled]=\"!selection.selected.length\" (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n\n <mat-table [dataSource]=\"referencedEntitiesDataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\" *ngIf=\"!isReadOnly\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox\n [disabled]=\"!referencedEntitiesDataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, referencedEntitiesDataSource) : null\"\n [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, referencedEntitiesDataSource)\"\n [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, referencedEntitiesDataSource)\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entityId\">\n {{dCol.value(metadata.getEntityForId(entityId, allReferencedEntities))}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n</div>", styles: [".elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}\n"] }]
|
|
2992
|
+
args: [{ selector: 'references-many-input', template: "<div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadata.displayName}}</b>\n </div>\n\n <mat-form-field>\n <mat-label>{{metadata.dropdownLabel}}</mat-label>\n <mat-select [(ngModel)]=\"input\" [name]=\"key.toString() + 'input'\" #inputModel=\"ngModel\" [disabled]=\"isReadOnly\">\n <mat-option>-</mat-option>\n <mat-option *ngFor=\"let value of dropdownValues\" [value]=\"value.value\">{{value.displayName}}</mat-option>\n </mat-select>\n <mat-error>{{getValidationErrorMessage(inputModel)}}</mat-error>\n </mat-form-field>\n\n <button type=\"button\" *ngIf=\"metadata.addAll\" style=\"margin-left: 20px;\" mat-raised-button [disabled]=\"!dropdownValues.length || isReadOnly\" (click)=\"addAll()\">\n {{metadata.addAllButtonLabel}}\n </button>\n\n <div class=\"buttons\">\n <button type=\"button\" mat-raised-button [disabled]=\"!input\" (click)=\"add()\">\n {{metadata.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button [disabled]=\"!selection.selected.length\" (click)=\"remove()\">\n {{metadata.removeButtonLabel}}\n </button>\n </div>\n\n <mat-table [dataSource]=\"referencedEntitiesDataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\" *ngIf=\"!isReadOnly\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox\n [disabled]=\"!referencedEntitiesDataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, referencedEntitiesDataSource) : null\"\n [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, referencedEntitiesDataSource)\"\n [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, referencedEntitiesDataSource)\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadata.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entityId\">\n {{dCol.value(metadata.getEntityForId(entityId, allReferencedEntities))}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n</div>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}.elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.array-headline{padding-bottom:10px}.buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.mat-column-select{flex:0 0 75px}\n"] }]
|
|
3188
2993
|
}], ctorParameters: function () { return [{ type: i0.EnvironmentInjector }]; } });
|
|
3189
2994
|
|
|
3190
2995
|
/**
|
|
@@ -3357,10 +3162,10 @@ class NgxMatEntityInputComponent {
|
|
|
3357
3162
|
}
|
|
3358
3163
|
}
|
|
3359
3164
|
NgxMatEntityInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityInputComponent, deps: [{ token: i1.MatDialog }, { token: NGX_GET_VALIDATION_ERROR_MESSAGE }], target: i0.ɵɵFactoryTarget.Component });
|
|
3360
|
-
NgxMatEntityInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: { entity: "entity", propertyKey: "propertyKey", getValidationErrorMessage: "getValidationErrorMessage", hideOmitForCreate: "hideOmitForCreate", hideOmitForEdit: "hideOmitForEdit", isReadOnly: "isReadOnly" }, outputs: { inputChangeEvent: "inputChangeEvent" }, viewQueries: [{ propertyName: "addArrayItemDialog", first: true, predicate: ["addArrayItemDialog"], descendants: true }], ngImport: i0, template: "<div [ngSwitch]=\"type\" *ngIf=\"!(hideOmitForCreate && metadata.omitForCreate) && !(hideOmitForEdit && metadata.omitForUpdate)\">\n <!-------------------------------------------->\n <!-----------------Strings-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.STRING\">\n <string-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_TEXTBOX\">\n <string-textbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-textbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_AUTOCOMPLETE\">\n <string-autocomplete-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-autocomplete-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_DROPDOWN\">\n <string-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_PASSWORD\">\n <string-password-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-password-input>\n </div>\n\n <!-------------------------------------------->\n <!-----------------Booleans------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_CHECKBOX\">\n <boolean-checkbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-checkbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_TOGGLE\">\n <boolean-toggle-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-toggle-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_DROPDOWN\">\n <boolean-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!------------------Numbers------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER\">\n <number-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_DROPDOWN\">\n <number-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_SLIDER\">\n <number-slider-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-slider-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Object------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.OBJECT\">\n <b>{{metadataDefaultObject.displayName}}</b>\n <!-- iterates over the object properties -->\n <mat-tab-group *ngIf=\"objectPropertyTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of objectPropertyTabs; let tI = index; trackBy: trackByFn\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows;\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let rI = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"objectPropertyTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of objectPropertyTabs[0].rows\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Array-------------------->\n <!-------------------------------------------->\n <div class=\"entityArray\" *ngSwitchCase=\"DecoratorTypes.ARRAY\">\n <div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadataEntityArray.displayName}}</b>\n </div>\n <div *ngIf=\"metadataEntityArray.createInline && !internalIsReadOnly\">\n <mat-tab-group *ngIf=\"arrayItemInlineTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemInlineTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"arrayItemInlineTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemInlineTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <div class=\"buttons\" *ngIf=\"!internalIsReadOnly\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"metadataEntityArray.createInline && !isArrayItemValid\"\n (click)=\"addEntity()\">\n {{metadataEntityArray.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadataEntityArray.removeButtonLabel}}\n </button>\n </div>\n \n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\" *ngIf=\"!internalIsReadOnly\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox\n [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\"\n [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\"\n [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadataEntityArray.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n \n <div class=\"array-error\" *ngIf=\"metadataEntityArray.required && !dataSource.data.length\">\n {{metadataEntityArray.missingErrorMessage}}\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE\">\n <array-date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_TIME\">\n <array-date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-time-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_RANGE\">\n <array-date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_CHIPS\">\n <array-string-chips-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-chips-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS\">\n <array-string-autocomplete-chips\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-autocomplete-chips>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Dates-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.DATE\">\n <date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_RANGE\">\n <date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_TIME\">\n <date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-time-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Files-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.FILE_DEFAULT\">\n <file-default-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-default-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.FILE_IMAGE\">\n <file-image-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-image-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------- references many ------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.REFERENCES_MANY\">\n <references-many-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </references-many-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Custom------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.CUSTOM\">\n <custom-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </custom-input>\n </div>\n\n <div *ngSwitchDefault>ERROR: The type {{type}} is not known.</div>\n</div>\n\n<!--------------------------------------------------------->\n<!--------------------Add Array Item Dialog---------------->\n<!--------------------------------------------------------->\n<ng-template #addArrayItemDialog>\n <div class=\"mat-dialog-title\" mat-dialog-title>{{dialogData.createDialogData.title}}</div>\n\n <form>\n <mat-dialog-content>\n <mat-tab-group *ngIf=\"arrayItemDialogTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemDialogTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n \n <div *ngIf=\"arrayItemDialogTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemDialogTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </mat-dialog-content>\n \n <mat-dialog-actions>\n <button type=\"submit\" mat-raised-button (click)=\"addArrayItem()\" [class.mat-button-disabled]=\"!isDialogArrayItemValid\">\n {{dialogData.createDialogData.createButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button (click)=\"cancelAddArrayItem()\" class=\"cancel-button\">\n {{dialogData.createDialogData.cancelButtonLabel}}\n </button>\n </mat-dialog-actions>\n </form>\n\n</ng-template>", styles: [".mat-dialog-title{padding-top:12px;display:flex}.mat-dialog-title button{display:block;margin-left:auto}mat-form-field{width:100%}mat-dialog-actions{justify-content:space-between;padding-left:24px;padding-right:24px}::ng-deep .mat-mdc-tab-body-wrapper{margin-left:-12px;margin-right:-12px}::ng-deep mat-tab-body{padding-top:10px;padding-left:12px;padding-right:12px}::ng-deep mat-tab-body .mat-mdc-tab-body-content{overflow:initial}::ng-deep .mat-mdc-form-field.mat-form-field-disabled label{color:#0009}::ng-deep .mat-mdc-form-field.mat-form-field-disabled input,::ng-deep .mat-mdc-form-field.mat-form-field-disabled textarea,::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-select-disabled,::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-select-value{color:#000}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-chip.mat-mdc-standard-chip.mat-mdc-chip-disabled{opacity:1}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-chip.mat-mdc-standard-chip.mat-mdc-chip-disabled button{opacity:.2}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-date-range-input-inner:disabled{color:#000}::ng-deep .mat-mdc-form-field .mat-mdc-slide-toggle{opacity:1}.entityArray .elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.entityArray .array-headline{padding-bottom:10px}.entityArray .buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.entityArray mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.entityArray .mat-column-select{flex:0 0 75px}.entityArray .array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\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: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6$1.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i6$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "component", type: StringInputComponent, selector: "string-input" }, { kind: "component", type: StringTextboxInputComponent, selector: "string-textbox-input" }, { kind: "component", type: StringAutocompleteInputComponent, selector: "string-autocomplete-input" }, { kind: "component", type: StringDropdownInputComponent, selector: "string-dropdown-input" }, { kind: "component", type: StringPasswordInputComponent, selector: "string-password-input" }, { kind: "component", type: BooleanCheckboxInputComponent, selector: "boolean-checkbox-input" }, { kind: "component", type: BooleanToggleInputComponent, selector: "boolean-toggle-input" }, { kind: "component", type: BooleanDropdownInputComponent, selector: "boolean-dropdown-input" }, { kind: "component", type: NumberInputComponent, selector: "number-input" }, { kind: "component", type: NumberDropdownInputComponent, selector: "number-dropdown-input" }, { kind: "component", type: NumberSliderInputComponent, selector: "number-slider-input" }, { kind: "component", type: ArrayStringChipsInputComponent, selector: "array-string-chips-input" }, { kind: "component", type: ArrayStringAutocompleteChipsComponent, selector: "array-string-autocomplete-chips" }, { kind: "component", type: DateInputComponent, selector: "date-input" }, { kind: "component", type: DateRangeInputComponent, selector: "date-range-input" }, { kind: "component", type: DateTimeInputComponent, selector: "date-time-input" }, { kind: "component", type: ArrayDateInputComponent, selector: "array-date-input" }, { kind: "component", type: ArrayDateTimeInputComponent, selector: "array-date-time-input" }, { kind: "component", type: ArrayDateRangeInputComponent, selector: "array-date-range-input" }, { kind: "component", type: FileImageInputComponent, selector: "file-image-input" }, { kind: "component", type: FileDefaultInputComponent, selector: "file-default-input" }, { kind: "component", type: ReferencesManyInputComponent, selector: "references-many-input" }, { kind: "component", type: CustomInputComponent, selector: "custom-input" }, { kind: "component", type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: ["entity", "propertyKey", "getValidationErrorMessage", "hideOmitForCreate", "hideOmitForEdit", "isReadOnly"], outputs: ["inputChangeEvent"] }] });
|
|
3165
|
+
NgxMatEntityInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: { entity: "entity", propertyKey: "propertyKey", getValidationErrorMessage: "getValidationErrorMessage", hideOmitForCreate: "hideOmitForCreate", hideOmitForEdit: "hideOmitForEdit", isReadOnly: "isReadOnly" }, outputs: { inputChangeEvent: "inputChangeEvent" }, viewQueries: [{ propertyName: "addArrayItemDialog", first: true, predicate: ["addArrayItemDialog"], descendants: true }], ngImport: i0, template: "<div [ngSwitch]=\"type\" *ngIf=\"!(hideOmitForCreate && metadata.omitForCreate) && !(hideOmitForEdit && metadata.omitForUpdate)\">\n <!-------------------------------------------->\n <!-----------------Strings-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.STRING\">\n <string-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_TEXTBOX\">\n <string-textbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-textbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_AUTOCOMPLETE\">\n <string-autocomplete-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-autocomplete-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_DROPDOWN\">\n <string-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_PASSWORD\">\n <string-password-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-password-input>\n </div>\n\n <!-------------------------------------------->\n <!-----------------Booleans------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_CHECKBOX\">\n <boolean-checkbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-checkbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_TOGGLE\">\n <boolean-toggle-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-toggle-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_DROPDOWN\">\n <boolean-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!------------------Numbers------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER\">\n <number-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_DROPDOWN\">\n <number-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_SLIDER\">\n <number-slider-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-slider-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Object------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.OBJECT\">\n <b>{{metadataDefaultObject.displayName}}</b>\n <!-- iterates over the object properties -->\n <mat-tab-group *ngIf=\"objectPropertyTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of objectPropertyTabs; let tI = index; trackBy: trackByFn\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows;\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let rI = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"objectPropertyTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of objectPropertyTabs[0].rows\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Array-------------------->\n <!-------------------------------------------->\n <div class=\"entityArray\" *ngSwitchCase=\"DecoratorTypes.ARRAY\">\n <div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadataEntityArray.displayName}}</b>\n </div>\n <div *ngIf=\"metadataEntityArray.createInline && !internalIsReadOnly\">\n <mat-tab-group *ngIf=\"arrayItemInlineTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemInlineTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"arrayItemInlineTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemInlineTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <div class=\"buttons\" *ngIf=\"!internalIsReadOnly\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"metadataEntityArray.createInline && !isArrayItemValid\"\n (click)=\"addEntity()\">\n {{metadataEntityArray.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadataEntityArray.removeButtonLabel}}\n </button>\n </div>\n \n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\" *ngIf=\"!internalIsReadOnly\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox\n [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\"\n [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\"\n [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadataEntityArray.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n \n <div class=\"array-error\" *ngIf=\"metadataEntityArray.required && !dataSource.data.length\">\n {{metadataEntityArray.missingErrorMessage}}\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE\">\n <array-date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_TIME\">\n <array-date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-time-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_RANGE\">\n <array-date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_CHIPS\">\n <array-string-chips-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-chips-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS\">\n <array-string-autocomplete-chips\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-autocomplete-chips>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Dates-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.DATE\">\n <date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_RANGE\">\n <date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_TIME\">\n <date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-time-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Files-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.FILE_DEFAULT\">\n <file-default-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-default-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.FILE_IMAGE\">\n <file-image-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-image-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------- references many ------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.REFERENCES_MANY\">\n <references-many-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </references-many-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Custom------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.CUSTOM\">\n <custom-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </custom-input>\n </div>\n\n <div *ngSwitchDefault>ERROR: The type {{type}} is not known.</div>\n</div>\n\n<!--------------------------------------------------------->\n<!--------------------Add Array Item Dialog---------------->\n<!--------------------------------------------------------->\n<ng-template #addArrayItemDialog>\n <div class=\"mat-dialog-title\" mat-dialog-title>{{dialogData.createDialogData.title}}</div>\n\n <form>\n <mat-dialog-content>\n <mat-tab-group *ngIf=\"arrayItemDialogTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemDialogTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n \n <div *ngIf=\"arrayItemDialogTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemDialogTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </mat-dialog-content>\n \n <mat-dialog-actions>\n <button type=\"submit\" mat-raised-button (click)=\"addArrayItem()\" [class.mat-button-disabled]=\"!isDialogArrayItemValid\">\n {{dialogData.createDialogData.createButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button (click)=\"cancelAddArrayItem()\" class=\"cancel-button\">\n {{dialogData.createDialogData.cancelButtonLabel}}\n </button>\n </mat-dialog-actions>\n </form>\n\n</ng-template>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}.mat-dialog-title{padding-top:12px;display:flex}.mat-dialog-title button{display:block;margin-left:auto}mat-form-field{width:100%}mat-dialog-actions{justify-content:space-between;padding-left:24px;padding-right:24px}::ng-deep .mat-mdc-tab-body-wrapper{margin-left:-12px;margin-right:-12px}::ng-deep mat-tab-body{padding-top:10px;padding-left:12px;padding-right:12px}::ng-deep mat-tab-body .mat-mdc-tab-body-content{overflow:initial}::ng-deep .mat-mdc-form-field.mat-form-field-disabled label{color:#0009}::ng-deep .mat-mdc-form-field.mat-form-field-disabled input,::ng-deep .mat-mdc-form-field.mat-form-field-disabled textarea,::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-select-disabled,::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-select-value{color:#000}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-chip.mat-mdc-standard-chip.mat-mdc-chip-disabled{opacity:1}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-chip.mat-mdc-standard-chip.mat-mdc-chip-disabled button{opacity:.2}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-date-range-input-inner:disabled{color:#000}::ng-deep .mat-mdc-form-field .mat-mdc-slide-toggle{opacity:1}.entityArray .elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.entityArray .array-headline{padding-bottom:10px}.entityArray .buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.entityArray mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.entityArray .mat-column-select{flex:0 0 75px}.entityArray .array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\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: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6$1.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i6$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "component", type: StringInputComponent, selector: "string-input" }, { kind: "component", type: StringTextboxInputComponent, selector: "string-textbox-input" }, { kind: "component", type: StringAutocompleteInputComponent, selector: "string-autocomplete-input" }, { kind: "component", type: StringDropdownInputComponent, selector: "string-dropdown-input" }, { kind: "component", type: StringPasswordInputComponent, selector: "string-password-input" }, { kind: "component", type: BooleanCheckboxInputComponent, selector: "boolean-checkbox-input" }, { kind: "component", type: BooleanToggleInputComponent, selector: "boolean-toggle-input" }, { kind: "component", type: BooleanDropdownInputComponent, selector: "boolean-dropdown-input" }, { kind: "component", type: NumberInputComponent, selector: "number-input" }, { kind: "component", type: NumberDropdownInputComponent, selector: "number-dropdown-input" }, { kind: "component", type: NumberSliderInputComponent, selector: "number-slider-input" }, { kind: "component", type: ArrayStringChipsInputComponent, selector: "array-string-chips-input" }, { kind: "component", type: ArrayStringAutocompleteChipsComponent, selector: "array-string-autocomplete-chips" }, { kind: "component", type: DateInputComponent, selector: "date-input" }, { kind: "component", type: DateRangeInputComponent, selector: "date-range-input" }, { kind: "component", type: DateTimeInputComponent, selector: "date-time-input" }, { kind: "component", type: ArrayDateInputComponent, selector: "array-date-input" }, { kind: "component", type: ArrayDateTimeInputComponent, selector: "array-date-time-input" }, { kind: "component", type: ArrayDateRangeInputComponent, selector: "array-date-range-input" }, { kind: "component", type: FileImageInputComponent, selector: "file-image-input" }, { kind: "component", type: FileDefaultInputComponent, selector: "file-default-input" }, { kind: "component", type: ReferencesManyInputComponent, selector: "references-many-input" }, { kind: "component", type: CustomInputComponent, selector: "custom-input" }, { kind: "component", type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: ["entity", "propertyKey", "getValidationErrorMessage", "hideOmitForCreate", "hideOmitForEdit", "isReadOnly"], outputs: ["inputChangeEvent"] }] });
|
|
3361
3166
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityInputComponent, decorators: [{
|
|
3362
3167
|
type: Component,
|
|
3363
|
-
args: [{ selector: 'ngx-mat-entity-input', template: "<div [ngSwitch]=\"type\" *ngIf=\"!(hideOmitForCreate && metadata.omitForCreate) && !(hideOmitForEdit && metadata.omitForUpdate)\">\n <!-------------------------------------------->\n <!-----------------Strings-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.STRING\">\n <string-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_TEXTBOX\">\n <string-textbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-textbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_AUTOCOMPLETE\">\n <string-autocomplete-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-autocomplete-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_DROPDOWN\">\n <string-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_PASSWORD\">\n <string-password-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-password-input>\n </div>\n\n <!-------------------------------------------->\n <!-----------------Booleans------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_CHECKBOX\">\n <boolean-checkbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-checkbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_TOGGLE\">\n <boolean-toggle-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-toggle-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_DROPDOWN\">\n <boolean-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!------------------Numbers------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER\">\n <number-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_DROPDOWN\">\n <number-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_SLIDER\">\n <number-slider-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-slider-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Object------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.OBJECT\">\n <b>{{metadataDefaultObject.displayName}}</b>\n <!-- iterates over the object properties -->\n <mat-tab-group *ngIf=\"objectPropertyTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of objectPropertyTabs; let tI = index; trackBy: trackByFn\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows;\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let rI = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"objectPropertyTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of objectPropertyTabs[0].rows\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Array-------------------->\n <!-------------------------------------------->\n <div class=\"entityArray\" *ngSwitchCase=\"DecoratorTypes.ARRAY\">\n <div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadataEntityArray.displayName}}</b>\n </div>\n <div *ngIf=\"metadataEntityArray.createInline && !internalIsReadOnly\">\n <mat-tab-group *ngIf=\"arrayItemInlineTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemInlineTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"arrayItemInlineTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemInlineTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <div class=\"buttons\" *ngIf=\"!internalIsReadOnly\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"metadataEntityArray.createInline && !isArrayItemValid\"\n (click)=\"addEntity()\">\n {{metadataEntityArray.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadataEntityArray.removeButtonLabel}}\n </button>\n </div>\n \n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\" *ngIf=\"!internalIsReadOnly\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox\n [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\"\n [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\"\n [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadataEntityArray.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n \n <div class=\"array-error\" *ngIf=\"metadataEntityArray.required && !dataSource.data.length\">\n {{metadataEntityArray.missingErrorMessage}}\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE\">\n <array-date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_TIME\">\n <array-date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-time-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_RANGE\">\n <array-date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_CHIPS\">\n <array-string-chips-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-chips-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS\">\n <array-string-autocomplete-chips\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-autocomplete-chips>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Dates-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.DATE\">\n <date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_RANGE\">\n <date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_TIME\">\n <date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-time-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Files-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.FILE_DEFAULT\">\n <file-default-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-default-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.FILE_IMAGE\">\n <file-image-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-image-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------- references many ------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.REFERENCES_MANY\">\n <references-many-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </references-many-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Custom------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.CUSTOM\">\n <custom-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </custom-input>\n </div>\n\n <div *ngSwitchDefault>ERROR: The type {{type}} is not known.</div>\n</div>\n\n<!--------------------------------------------------------->\n<!--------------------Add Array Item Dialog---------------->\n<!--------------------------------------------------------->\n<ng-template #addArrayItemDialog>\n <div class=\"mat-dialog-title\" mat-dialog-title>{{dialogData.createDialogData.title}}</div>\n\n <form>\n <mat-dialog-content>\n <mat-tab-group *ngIf=\"arrayItemDialogTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemDialogTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n \n <div *ngIf=\"arrayItemDialogTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemDialogTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </mat-dialog-content>\n \n <mat-dialog-actions>\n <button type=\"submit\" mat-raised-button (click)=\"addArrayItem()\" [class.mat-button-disabled]=\"!isDialogArrayItemValid\">\n {{dialogData.createDialogData.createButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button (click)=\"cancelAddArrayItem()\" class=\"cancel-button\">\n {{dialogData.createDialogData.cancelButtonLabel}}\n </button>\n </mat-dialog-actions>\n </form>\n\n</ng-template>", styles: [".mat-dialog-title{padding-top:12px;display:flex}.mat-dialog-title button{display:block;margin-left:auto}mat-form-field{width:100%}mat-dialog-actions{justify-content:space-between;padding-left:24px;padding-right:24px}::ng-deep .mat-mdc-tab-body-wrapper{margin-left:-12px;margin-right:-12px}::ng-deep mat-tab-body{padding-top:10px;padding-left:12px;padding-right:12px}::ng-deep mat-tab-body .mat-mdc-tab-body-content{overflow:initial}::ng-deep .mat-mdc-form-field.mat-form-field-disabled label{color:#0009}::ng-deep .mat-mdc-form-field.mat-form-field-disabled input,::ng-deep .mat-mdc-form-field.mat-form-field-disabled textarea,::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-select-disabled,::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-select-value{color:#000}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-chip.mat-mdc-standard-chip.mat-mdc-chip-disabled{opacity:1}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-chip.mat-mdc-standard-chip.mat-mdc-chip-disabled button{opacity:.2}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-date-range-input-inner:disabled{color:#000}::ng-deep .mat-mdc-form-field .mat-mdc-slide-toggle{opacity:1}.entityArray .elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.entityArray .array-headline{padding-bottom:10px}.entityArray .buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.entityArray mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.entityArray .mat-column-select{flex:0 0 75px}.entityArray .array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"] }]
|
|
3168
|
+
args: [{ selector: 'ngx-mat-entity-input', template: "<div [ngSwitch]=\"type\" *ngIf=\"!(hideOmitForCreate && metadata.omitForCreate) && !(hideOmitForEdit && metadata.omitForUpdate)\">\n <!-------------------------------------------->\n <!-----------------Strings-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.STRING\">\n <string-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_TEXTBOX\">\n <string-textbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-textbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_AUTOCOMPLETE\">\n <string-autocomplete-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-autocomplete-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_DROPDOWN\">\n <string-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.STRING_PASSWORD\">\n <string-password-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </string-password-input>\n </div>\n\n <!-------------------------------------------->\n <!-----------------Booleans------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_CHECKBOX\">\n <boolean-checkbox-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-checkbox-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_TOGGLE\">\n <boolean-toggle-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-toggle-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.BOOLEAN_DROPDOWN\">\n <boolean-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </boolean-dropdown-input>\n </div>\n\n <!-------------------------------------------->\n <!------------------Numbers------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER\">\n <number-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_DROPDOWN\">\n <number-dropdown-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-dropdown-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.NUMBER_SLIDER\">\n <number-slider-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </number-slider-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Object------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.OBJECT\">\n <b>{{metadataDefaultObject.displayName}}</b>\n <!-- iterates over the object properties -->\n <mat-tab-group *ngIf=\"objectPropertyTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of objectPropertyTabs; let tI = index; trackBy: trackByFn\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows;\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let rI = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"objectPropertyTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of objectPropertyTabs[0].rows\">\n <ngx-mat-entity-input *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"objectProperty\"\n [propertyKey]=\"key\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [hideOmitForCreate]=\"hideOmitForCreate\"\n [hideOmitForEdit]=\"hideOmitForEdit\"\n [isReadOnly]=\"internalIsReadOnly\"\n class=\"col-lg-{{EntityUtilities.getWidth(objectProperty, key, 'lg')}} col-md-{{EntityUtilities.getWidth(objectProperty, key, 'md')}} col-sm-{{EntityUtilities.getWidth(objectProperty, key, 'sm')}}\"\n (inputChangeEvent)=\"emitChange()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Array-------------------->\n <!-------------------------------------------->\n <div class=\"entityArray\" *ngSwitchCase=\"DecoratorTypes.ARRAY\">\n <div class=\"mat-elevation-z8 elevation-container\">\n <div class=\"array-headline\">\n <b>{{metadataEntityArray.displayName}}</b>\n </div>\n <div *ngIf=\"metadataEntityArray.createInline && !internalIsReadOnly\">\n <mat-tab-group *ngIf=\"arrayItemInlineTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemInlineTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n\n <div *ngIf=\"arrayItemInlineTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemInlineTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys; let i = index; trackBy: trackByFn\"\n [entity]=\"arrayItem\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(arrayItem, key, 'lg')}} col-md-{{EntityUtilities.getWidth(arrayItem, key, 'md')}} col-sm-{{EntityUtilities.getWidth(arrayItem, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </div>\n\n <div class=\"buttons\" *ngIf=\"!internalIsReadOnly\">\n <button type=\"button\" mat-raised-button\n [disabled]=\"metadataEntityArray.createInline && !isArrayItemValid\"\n (click)=\"addEntity()\">\n {{metadataEntityArray.addButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button\n [disabled]=\"!selection.selected.length\"\n (click)=\"remove()\">\n {{metadataEntityArray.removeButtonLabel}}\n </button>\n </div>\n \n <mat-table [dataSource]=\"dataSource\">\n <!-- select Column -->\n <ng-container matColumnDef=\"select\" *ngIf=\"!internalIsReadOnly\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox\n [disabled]=\"!dataSource.data.length\" (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\"\n [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\"\n [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\">\n </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"></mat-checkbox>\n </mat-cell>\n </ng-container>\n \n <ng-container *ngFor=\"let dCol of metadataEntityArray.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n \n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n \n <div class=\"array-error\" *ngIf=\"metadataEntityArray.required && !dataSource.data.length\">\n {{metadataEntityArray.missingErrorMessage}}\n </div>\n </div>\n </div>\n\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE\">\n <array-date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_TIME\">\n <array-date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-time-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_DATE_RANGE\">\n <array-date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_CHIPS\">\n <array-string-chips-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-chips-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.ARRAY_STRING_AUTOCOMPLETE_CHIPS\">\n <array-string-autocomplete-chips\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </array-string-autocomplete-chips>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Dates-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.DATE\">\n <date-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_RANGE\">\n <date-range-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-range-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.DATE_TIME\">\n <date-time-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </date-time-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Files-------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.FILE_DEFAULT\">\n <file-default-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-default-input>\n </div>\n <div *ngSwitchCase=\"DecoratorTypes.FILE_IMAGE\">\n <file-image-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </file-image-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------- references many ------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.REFERENCES_MANY\">\n <references-many-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </references-many-input>\n </div>\n\n <!-------------------------------------------->\n <!-------------------Custom------------------->\n <!-------------------------------------------->\n <div *ngSwitchCase=\"DecoratorTypes.CUSTOM\">\n <custom-input\n (inputChangeEvent)=\"emitChange()\"\n [entity]=\"internalEntity\"\n [key]=\"internalPropertyKey\"\n [getValidationErrorMessage]=\"internalGetValidationErrorMessage\"\n [isReadOnly]=\"internalIsReadOnly\"\n >\n </custom-input>\n </div>\n\n <div *ngSwitchDefault>ERROR: The type {{type}} is not known.</div>\n</div>\n\n<!--------------------------------------------------------->\n<!--------------------Add Array Item Dialog---------------->\n<!--------------------------------------------------------->\n<ng-template #addArrayItemDialog>\n <div class=\"mat-dialog-title\" mat-dialog-title>{{dialogData.createDialogData.title}}</div>\n\n <form>\n <mat-dialog-content>\n <mat-tab-group *ngIf=\"arrayItemDialogTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of arrayItemDialogTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n \n <div *ngIf=\"arrayItemDialogTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of arrayItemDialogTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"dialogData.entity\"\n [propertyKey]=\"key\"\n [hideOmitForCreate]=\"true\"\n [getValidationErrorMessage]=\"dialogData.getValidationErrorMessage\"\n class=\"col-lg-{{EntityUtilities.getWidth(dialogData.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(dialogData.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(dialogData.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkIsDialogArrayItemValid()\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </mat-dialog-content>\n \n <mat-dialog-actions>\n <button type=\"submit\" mat-raised-button (click)=\"addArrayItem()\" [class.mat-button-disabled]=\"!isDialogArrayItemValid\">\n {{dialogData.createDialogData.createButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button (click)=\"cancelAddArrayItem()\" class=\"cancel-button\">\n {{dialogData.createDialogData.cancelButtonLabel}}\n </button>\n </mat-dialog-actions>\n </form>\n\n</ng-template>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}.mat-dialog-title{padding-top:12px;display:flex}.mat-dialog-title button{display:block;margin-left:auto}mat-form-field{width:100%}mat-dialog-actions{justify-content:space-between;padding-left:24px;padding-right:24px}::ng-deep .mat-mdc-tab-body-wrapper{margin-left:-12px;margin-right:-12px}::ng-deep mat-tab-body{padding-top:10px;padding-left:12px;padding-right:12px}::ng-deep mat-tab-body .mat-mdc-tab-body-content{overflow:initial}::ng-deep .mat-mdc-form-field.mat-form-field-disabled label{color:#0009}::ng-deep .mat-mdc-form-field.mat-form-field-disabled input,::ng-deep .mat-mdc-form-field.mat-form-field-disabled textarea,::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-select-disabled,::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-select-value{color:#000}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-chip.mat-mdc-standard-chip.mat-mdc-chip-disabled{opacity:1}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-mdc-chip.mat-mdc-standard-chip.mat-mdc-chip-disabled button{opacity:.2}::ng-deep .mat-mdc-form-field.mat-form-field-disabled .mat-date-range-input-inner:disabled{color:#000}::ng-deep .mat-mdc-form-field .mat-mdc-slide-toggle{opacity:1}.entityArray .elevation-container{border-radius:5px;padding:15px;margin-bottom:15px;margin-top:15px}.entityArray .array-headline{padding-bottom:10px}.entityArray .buttons{display:flex;justify-content:space-between;margin-bottom:10px;margin-top:5px}.entityArray mat-table{border:1px solid #E0E0E0;border-radius:5px;padding-top:5px;padding-bottom:25px}.entityArray .mat-column-select{flex:0 0 75px}.entityArray .array-error{display:flex;align-items:center;justify-content:center;margin-top:-25.8px;border:1px solid #E0E0E0;background-color:#f8d3d7;color:#721c24;height:25.8px;border-bottom-left-radius:5px;border-bottom-right-radius:5px}\n"] }]
|
|
3364
3169
|
}], ctorParameters: function () {
|
|
3365
3170
|
return [{ type: i1.MatDialog }, { type: undefined, decorators: [{
|
|
3366
3171
|
type: Inject,
|
|
@@ -3499,20 +3304,539 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
|
|
|
3499
3304
|
}] });
|
|
3500
3305
|
|
|
3501
3306
|
/**
|
|
3502
|
-
* The internal
|
|
3503
|
-
*/
|
|
3504
|
-
class CreateEntityDialogDataInternal {
|
|
3505
|
-
constructor(entity, EntityServiceClass, createDialogData) {
|
|
3506
|
-
this.entity = entity;
|
|
3507
|
-
this.EntityServiceClass = EntityServiceClass;
|
|
3508
|
-
this.createDialogData = createDialogData;
|
|
3509
|
-
}
|
|
3510
|
-
}
|
|
3511
|
-
/**
|
|
3512
|
-
* The Builder for the CreateEntityDialogData. Sets default values.
|
|
3307
|
+
* The internal EditData. Requires all default values the user can leave out.
|
|
3513
3308
|
*/
|
|
3514
|
-
class
|
|
3515
|
-
constructor(
|
|
3309
|
+
class EditDataInternal {
|
|
3310
|
+
constructor(title, confirmButtonLabel, deleteButtonLabel, cancelButtonLabel, deleteRequiresConfirmDialog, editRequiresConfirmDialog, confirmDeleteDialogData, confirmEditDialogData) {
|
|
3311
|
+
this.title = title;
|
|
3312
|
+
this.confirmButtonLabel = confirmButtonLabel;
|
|
3313
|
+
this.deleteButtonLabel = deleteButtonLabel;
|
|
3314
|
+
this.cancelButtonLabel = cancelButtonLabel;
|
|
3315
|
+
this.deleteRequiresConfirmDialog = deleteRequiresConfirmDialog;
|
|
3316
|
+
this.editRequiresConfirmDialog = editRequiresConfirmDialog;
|
|
3317
|
+
this.confirmDeleteDialogData = confirmDeleteDialogData;
|
|
3318
|
+
this.confirmEditDialogData = confirmEditDialogData;
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
/**
|
|
3322
|
+
* The Builder for the EditDialogData. Sets default values.
|
|
3323
|
+
*/
|
|
3324
|
+
class EditDialogDataBuilder extends BaseBuilder {
|
|
3325
|
+
constructor(data) {
|
|
3326
|
+
super(data);
|
|
3327
|
+
}
|
|
3328
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3329
|
+
generateBaseData(data) {
|
|
3330
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3331
|
+
const confirmEditDialogData = new ConfirmDialogDataBuilder(data === null || data === void 0 ? void 0 : data.confirmEditDialogData)
|
|
3332
|
+
.withDefault('confirmButtonLabel', 'Save')
|
|
3333
|
+
.withDefault('text', ['Do you really want to save all changes?'])
|
|
3334
|
+
.withDefault('title', 'Edit')
|
|
3335
|
+
.getResult();
|
|
3336
|
+
const confirmDeleteDialogData = new ConfirmDialogDataBuilder(data === null || data === void 0 ? void 0 : data.confirmDeleteDialogData)
|
|
3337
|
+
.withDefault('confirmButtonLabel', 'Delete')
|
|
3338
|
+
.withDefault('type', 'delete')
|
|
3339
|
+
.withDefault('text', ['Do you really want to delete this entity?'])
|
|
3340
|
+
.withDefault('title', 'Delete')
|
|
3341
|
+
.getResult();
|
|
3342
|
+
return new EditDataInternal((_a = data === null || data === void 0 ? void 0 : data.title) !== null && _a !== void 0 ? _a : (() => 'Edit'), (_b = data === null || data === void 0 ? void 0 : data.confirmButtonLabel) !== null && _b !== void 0 ? _b : 'Save', (_c = data === null || data === void 0 ? void 0 : data.deleteButtonLabel) !== null && _c !== void 0 ? _c : 'Delete', (_d = data === null || data === void 0 ? void 0 : data.cancelButtonLabel) !== null && _d !== void 0 ? _d : 'Cancel', (_e = data === null || data === void 0 ? void 0 : data.deleteRequiresConfirmDialog) !== null && _e !== void 0 ? _e : true, (_f = data === null || data === void 0 ? void 0 : data.editRequiresConfirmDialog) !== null && _f !== void 0 ? _f : false, confirmDeleteDialogData, confirmEditDialogData);
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3347
|
+
class PageEditDataBuilder extends BaseBuilder {
|
|
3348
|
+
constructor(data) {
|
|
3349
|
+
super(data);
|
|
3350
|
+
}
|
|
3351
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3352
|
+
generateBaseData(data) {
|
|
3353
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3354
|
+
const editDialogData = new EditDialogDataBuilder(data.editData)
|
|
3355
|
+
.withDefault('cancelButtonLabel', 'Back')
|
|
3356
|
+
.getResult();
|
|
3357
|
+
// eslint-disable-next-line max-len
|
|
3358
|
+
const confirmUnsavedChangesDialogData = new ConfirmDialogDataBuilder((_a = data.editData) === null || _a === void 0 ? void 0 : _a.confirmUnsavedChangesDialogData)
|
|
3359
|
+
.withDefault('title', 'Unsaved Changes')
|
|
3360
|
+
.withDefault('text', ['You have unsaved changes that will be deleted when you leave this page.', 'Continue?'])
|
|
3361
|
+
.withDefault('confirmButtonLabel', 'Leave')
|
|
3362
|
+
.getResult();
|
|
3363
|
+
return {
|
|
3364
|
+
editData: Object.assign(Object.assign({}, editDialogData), { confirmUnsavedChangesDialogData: confirmUnsavedChangesDialogData, unsavedChangesRequireConfirmDialog: (_c = (_b = data.editData) === null || _b === void 0 ? void 0 : _b.unsavedChangesRequireConfirmDialog) !== null && _c !== void 0 ? _c : true }),
|
|
3365
|
+
allowUpdate: (_d = data.allowUpdate) !== null && _d !== void 0 ? _d : (() => true),
|
|
3366
|
+
allowDelete: (_e = data.allowDelete) !== null && _e !== void 0 ? _e : (() => true),
|
|
3367
|
+
displayLoadingSpinner: (_f = data.displayLoadingSpinner) !== null && _f !== void 0 ? _f : true
|
|
3368
|
+
};
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
|
|
3372
|
+
/**
|
|
3373
|
+
* A generic EntityService class.
|
|
3374
|
+
* Offers basic CRUD-functionality.
|
|
3375
|
+
* You should create a service for every Entity you have.
|
|
3376
|
+
* If you extend from this you need to make sure that the extended Service can be injected.
|
|
3377
|
+
*/
|
|
3378
|
+
class EntityService {
|
|
3379
|
+
constructor(http) {
|
|
3380
|
+
this.http = http;
|
|
3381
|
+
/**
|
|
3382
|
+
* The route segment that comes before the id when editing an entity in a separate page.
|
|
3383
|
+
*/
|
|
3384
|
+
this.editBaseRoute = 'entities';
|
|
3385
|
+
/**
|
|
3386
|
+
* The key which holds the id value.
|
|
3387
|
+
*
|
|
3388
|
+
* @default 'id'
|
|
3389
|
+
*/
|
|
3390
|
+
this.idKey = 'id';
|
|
3391
|
+
/**
|
|
3392
|
+
* A subject of all the entity values.
|
|
3393
|
+
* Can be subscribed to when you want to do a specific thing whenever the entities change.
|
|
3394
|
+
*/
|
|
3395
|
+
this.entitiesSubject = new BehaviorSubject([]);
|
|
3396
|
+
/**
|
|
3397
|
+
* A subject of all the entity values.
|
|
3398
|
+
* Can be subscribed to when you want to do a specific thing whenever the entities change.
|
|
3399
|
+
*/
|
|
3400
|
+
this.READ_EXPIRATION_IN_MS = 900000;
|
|
3401
|
+
}
|
|
3402
|
+
/**
|
|
3403
|
+
* Gets the entities in an array from the internal entitiesSubject.
|
|
3404
|
+
*
|
|
3405
|
+
* @returns The current entities in form of an array.
|
|
3406
|
+
*/
|
|
3407
|
+
get entities() {
|
|
3408
|
+
return this.entitiesSubject.value;
|
|
3409
|
+
}
|
|
3410
|
+
/**
|
|
3411
|
+
* Creates a new Entity and pushes it to the entities array.
|
|
3412
|
+
*
|
|
3413
|
+
* @param entity - The data of the entity to create.
|
|
3414
|
+
* All values that should be omitted will be removed from it inside this method.
|
|
3415
|
+
* @returns A Promise of the created entity.
|
|
3416
|
+
*/
|
|
3417
|
+
create(entity) {
|
|
3418
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3419
|
+
const body = LodashUtilities.omit(entity, EntityUtilities.getOmitForCreate(entity));
|
|
3420
|
+
const filePropertyKeys = EntityUtilities.getFileProperties(entity);
|
|
3421
|
+
if (!filePropertyKeys.length) {
|
|
3422
|
+
return yield this.createWithJson(body);
|
|
3423
|
+
}
|
|
3424
|
+
else {
|
|
3425
|
+
return yield this.createWithFormData(body, filePropertyKeys, entity);
|
|
3426
|
+
}
|
|
3427
|
+
});
|
|
3428
|
+
}
|
|
3429
|
+
// TODO: Find a way to use blobs with jest
|
|
3430
|
+
/* istanbul ignore next */
|
|
3431
|
+
/**
|
|
3432
|
+
* Imports everything from the provided json file.
|
|
3433
|
+
*
|
|
3434
|
+
* @param file - The json file to import from.
|
|
3435
|
+
* @returns All entities that have been imported.
|
|
3436
|
+
*/
|
|
3437
|
+
import(file) {
|
|
3438
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3439
|
+
const formData = new FormData();
|
|
3440
|
+
formData.append('import', file);
|
|
3441
|
+
const result = yield firstValueFrom(this.http.post(`${this.baseUrl}/import`, formData));
|
|
3442
|
+
this.entities.push(...result);
|
|
3443
|
+
this.entitiesSubject.next(this.entities);
|
|
3444
|
+
return result;
|
|
3445
|
+
});
|
|
3446
|
+
}
|
|
3447
|
+
// TODO: Find a way to use blobs with jest
|
|
3448
|
+
/* istanbul ignore next */
|
|
3449
|
+
/**
|
|
3450
|
+
* Creates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
|
|
3451
|
+
* All file values are stored inside their respective property key and their name.
|
|
3452
|
+
* Form data is able to handle setting multiple files to the same key.
|
|
3453
|
+
*
|
|
3454
|
+
* @param body - The body Of the request.
|
|
3455
|
+
* @param filePropertyKeys - All property keys that are files and need to be added to the form data.
|
|
3456
|
+
* @param entity - The entity to create. This is needed in addition to the body because the body doesn't contain any metadata.
|
|
3457
|
+
* @returns The created entity from the server.
|
|
3458
|
+
*/
|
|
3459
|
+
createWithFormData(body, filePropertyKeys, entity) {
|
|
3460
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3461
|
+
const formData = new FormData();
|
|
3462
|
+
formData.append('body', JSON.stringify(LodashUtilities.omit(body, filePropertyKeys)));
|
|
3463
|
+
for (const key of filePropertyKeys) {
|
|
3464
|
+
if (EntityUtilities.getPropertyMetadata(entity, key, DecoratorTypes.FILE_DEFAULT).multiple) {
|
|
3465
|
+
const fileDataValues = body[key];
|
|
3466
|
+
for (const value of fileDataValues) {
|
|
3467
|
+
formData.append(key, (yield FileUtilities.getFileData(value)).file, value.name);
|
|
3468
|
+
}
|
|
3469
|
+
}
|
|
3470
|
+
else {
|
|
3471
|
+
const fileData = body[key];
|
|
3472
|
+
formData.append(key, (yield FileUtilities.getFileData(fileData)).file, fileData.name);
|
|
3473
|
+
}
|
|
3474
|
+
}
|
|
3475
|
+
const e = yield firstValueFrom(this.http.post(this.baseUrl, formData));
|
|
3476
|
+
if (!e) {
|
|
3477
|
+
throw new Error(`
|
|
3478
|
+
The created entity was not returned in the response.
|
|
3479
|
+
If you want to provide a logic that allows that
|
|
3480
|
+
you need to override the create methods of this class.
|
|
3481
|
+
`);
|
|
3482
|
+
}
|
|
3483
|
+
this.entities.push(e);
|
|
3484
|
+
this.entitiesSubject.next(this.entities);
|
|
3485
|
+
return e;
|
|
3486
|
+
});
|
|
3487
|
+
}
|
|
3488
|
+
/**
|
|
3489
|
+
* Creates the entity with a normal json body in contrast to creating it with form data when the entity contains files.
|
|
3490
|
+
*
|
|
3491
|
+
* @param body - The body Of the request.
|
|
3492
|
+
* @returns The created entity from the server.
|
|
3493
|
+
*/
|
|
3494
|
+
createWithJson(body) {
|
|
3495
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3496
|
+
const e = yield firstValueFrom(this.http.post(this.baseUrl, body));
|
|
3497
|
+
if (!e) {
|
|
3498
|
+
throw new Error(`
|
|
3499
|
+
The created entity was not returned in the response.
|
|
3500
|
+
If you want to provide a logic that allows that
|
|
3501
|
+
you need to override the create methods of this class.
|
|
3502
|
+
`);
|
|
3503
|
+
}
|
|
3504
|
+
this.entities.push(e);
|
|
3505
|
+
this.entitiesSubject.next(this.entities);
|
|
3506
|
+
return e;
|
|
3507
|
+
});
|
|
3508
|
+
}
|
|
3509
|
+
/**
|
|
3510
|
+
* Gets all existing entities and pushes them to the entities array.
|
|
3511
|
+
*
|
|
3512
|
+
* @returns A Promise of all received Entities.
|
|
3513
|
+
*/
|
|
3514
|
+
read() {
|
|
3515
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3516
|
+
const e = yield firstValueFrom(this.http.get(this.baseUrl));
|
|
3517
|
+
this.entitiesSubject.next(e);
|
|
3518
|
+
this.lastRead = new Date();
|
|
3519
|
+
return e;
|
|
3520
|
+
});
|
|
3521
|
+
}
|
|
3522
|
+
/**
|
|
3523
|
+
* Tries to find an entity with the given id.
|
|
3524
|
+
*
|
|
3525
|
+
* @param id - The id of the entity to find.
|
|
3526
|
+
* @returns The found entity.
|
|
3527
|
+
*/
|
|
3528
|
+
findById(id) {
|
|
3529
|
+
var _a;
|
|
3530
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3531
|
+
if (this.lastRead == null
|
|
3532
|
+
|| (new Date().getTime() - this.lastRead.getTime()) > this.READ_EXPIRATION_IN_MS) {
|
|
3533
|
+
return firstValueFrom(this.http.get(`${this.baseUrl}/${id}`));
|
|
3534
|
+
}
|
|
3535
|
+
return (_a = this.entities.find(e => e[this.idKey] === id)) !== null && _a !== void 0 ? _a : firstValueFrom(this.http.get(`${this.baseUrl}/${id}`));
|
|
3536
|
+
});
|
|
3537
|
+
}
|
|
3538
|
+
/**
|
|
3539
|
+
* Updates a specific Entity.
|
|
3540
|
+
*
|
|
3541
|
+
* @param entity - The updated Entity
|
|
3542
|
+
* All values that should be omitted will be removed from it inside this method.
|
|
3543
|
+
* @param entityPriorChanges - The current Entity.
|
|
3544
|
+
* It Is used to get changed values and only update them instead of sending the whole entity data.
|
|
3545
|
+
*/
|
|
3546
|
+
update(entity, entityPriorChanges) {
|
|
3547
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3548
|
+
const body = LodashUtilities.omit(yield EntityUtilities.difference(entity, entityPriorChanges), EntityUtilities.getOmitForUpdate(entity));
|
|
3549
|
+
const filePropertyKeys = EntityUtilities.getFileProperties(entityPriorChanges);
|
|
3550
|
+
if (!filePropertyKeys.length) {
|
|
3551
|
+
yield this.updateWithJson(body, entityPriorChanges[this.idKey]);
|
|
3552
|
+
}
|
|
3553
|
+
else {
|
|
3554
|
+
yield this.updateWithFormData(body, filePropertyKeys, entity, entityPriorChanges[this.idKey]);
|
|
3555
|
+
}
|
|
3556
|
+
});
|
|
3557
|
+
}
|
|
3558
|
+
// TODO: Find a way to use blobs with jest
|
|
3559
|
+
/* istanbul ignore next */
|
|
3560
|
+
/**
|
|
3561
|
+
* Updates the entity with form data when the entity contains files in contrast to creating it with a normal json body.
|
|
3562
|
+
* All file values are stored inside their respective property key and their name.
|
|
3563
|
+
* Form data is able to handle setting multiple files to the same key.
|
|
3564
|
+
*
|
|
3565
|
+
* @param body - The request body. Already contains only properties that have changed.
|
|
3566
|
+
* @param filePropertyKeys - The keys of all properties which are files and need to separately be appended to the form data.
|
|
3567
|
+
* @param entity - The original entity. Is needed to get the metadata of all the files.
|
|
3568
|
+
* @param id - The id of the entity to update.
|
|
3569
|
+
*/
|
|
3570
|
+
updateWithFormData(body, filePropertyKeys, entity, id) {
|
|
3571
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3572
|
+
const formData = new FormData();
|
|
3573
|
+
formData.append('body', JSON.stringify(LodashUtilities.omitBy(body, LodashUtilities.isNil)));
|
|
3574
|
+
for (const key of filePropertyKeys) {
|
|
3575
|
+
if (EntityUtilities.getPropertyMetadata(entity, key, DecoratorTypes.FILE_DEFAULT).multiple) {
|
|
3576
|
+
const fileDataValues = body[key];
|
|
3577
|
+
for (const value of fileDataValues) {
|
|
3578
|
+
formData.append(key, (yield FileUtilities.getFileData(value)).file, value.name);
|
|
3579
|
+
}
|
|
3580
|
+
}
|
|
3581
|
+
else {
|
|
3582
|
+
const fileData = body[key];
|
|
3583
|
+
formData.append(key, (yield FileUtilities.getFileData(fileData)).file, fileData.name);
|
|
3584
|
+
}
|
|
3585
|
+
}
|
|
3586
|
+
const updatedEntity = yield firstValueFrom(this.http.patch(`${this.baseUrl}/${id}`, formData));
|
|
3587
|
+
if (!updatedEntity) {
|
|
3588
|
+
// eslint-disable-next-line no-console
|
|
3589
|
+
console.warn('The updated entity was not returned in the response. Applying the changes from the request body.');
|
|
3590
|
+
for (const key in body) {
|
|
3591
|
+
this.entities[this.entities.findIndex(e => e[this.idKey] === id)][key]
|
|
3592
|
+
= body[key];
|
|
3593
|
+
}
|
|
3594
|
+
this.entitiesSubject.next(this.entities);
|
|
3595
|
+
return;
|
|
3596
|
+
}
|
|
3597
|
+
this.entities[this.entities.findIndex(e => e[this.idKey] === id)] = updatedEntity;
|
|
3598
|
+
this.entitiesSubject.next(this.entities);
|
|
3599
|
+
});
|
|
3600
|
+
}
|
|
3601
|
+
/**
|
|
3602
|
+
* Updates the entity with a normal json body in contrast to updating it with form data when the entity contains files.
|
|
3603
|
+
*
|
|
3604
|
+
* @param body - The body of the Request. Has already removed all unnecessary values.
|
|
3605
|
+
* @param id - The id of the entity to update.
|
|
3606
|
+
*/
|
|
3607
|
+
updateWithJson(body, id) {
|
|
3608
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3609
|
+
const updatedEntity = yield firstValueFrom(this.http.patch(`${this.baseUrl}/${id}`, LodashUtilities.omitBy(body, LodashUtilities.isNil)));
|
|
3610
|
+
if (!updatedEntity) {
|
|
3611
|
+
// eslint-disable-next-line no-console
|
|
3612
|
+
console.warn('The updated entity was not returned in the response. Applying the changes from the request body.');
|
|
3613
|
+
const foundEntity = this.entities[this.entities.findIndex(e => e[this.idKey] === id)];
|
|
3614
|
+
for (const key in body) {
|
|
3615
|
+
foundEntity[key]
|
|
3616
|
+
= body[key];
|
|
3617
|
+
}
|
|
3618
|
+
this.entitiesSubject.next(this.entities);
|
|
3619
|
+
return;
|
|
3620
|
+
}
|
|
3621
|
+
this.entities[this.entities.findIndex(e => e[this.idKey] === id)] = updatedEntity;
|
|
3622
|
+
this.entitiesSubject.next(this.entities);
|
|
3623
|
+
});
|
|
3624
|
+
}
|
|
3625
|
+
/**
|
|
3626
|
+
* Deletes a specific Entity.
|
|
3627
|
+
*
|
|
3628
|
+
* @param entity - The entity to delete.
|
|
3629
|
+
*/
|
|
3630
|
+
delete(entity) {
|
|
3631
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3632
|
+
yield firstValueFrom(this.http.delete(`${this.baseUrl}/${entity[this.idKey]}`));
|
|
3633
|
+
// the == comparison instead of === is to catch ids that are numbers.
|
|
3634
|
+
this.entities.splice(this.entities.findIndex(e => e[this.idKey] === entity[this.idKey]), 1);
|
|
3635
|
+
this.entitiesSubject.next(this.entities);
|
|
3636
|
+
});
|
|
3637
|
+
}
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
const defaultEditDataRoute = {
|
|
3641
|
+
loadComponent: () => NgxMatEntityEditPageComponent,
|
|
3642
|
+
title: 'Edit',
|
|
3643
|
+
path: 'entities:id'
|
|
3644
|
+
};
|
|
3645
|
+
// eslint-disable-next-line max-len, @typescript-eslint/no-explicit-any
|
|
3646
|
+
const NGX_EDIT_DATA_ENTITY_SERVICE = new InjectionToken('NGX_EDIT_DATA_ENTITY_SERVICE');
|
|
3647
|
+
// eslint-disable-next-line max-len, @typescript-eslint/no-explicit-any
|
|
3648
|
+
const NGX_EDIT_DATA_ENTITY = new InjectionToken('NGX_EDIT_DATA_ENTITY');
|
|
3649
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3650
|
+
const NGX_EDIT_DATA = new InjectionToken('NGX_EDIT_DATA');
|
|
3651
|
+
/**
|
|
3652
|
+
* A generic page that allows you to edit a specific entity.
|
|
3653
|
+
* For this to work you need to provide some data for the route.
|
|
3654
|
+
*/
|
|
3655
|
+
class NgxMatEntityEditPageComponent {
|
|
3656
|
+
constructor(dialog, location, route, entityService, EntityClass, inputData) {
|
|
3657
|
+
this.dialog = dialog;
|
|
3658
|
+
this.location = location;
|
|
3659
|
+
this.route = route;
|
|
3660
|
+
this.entityService = entityService;
|
|
3661
|
+
this.EntityClass = EntityClass;
|
|
3662
|
+
this.inputData = inputData;
|
|
3663
|
+
this.EntityUtilities = EntityUtilities;
|
|
3664
|
+
this.isEntityValid = true;
|
|
3665
|
+
this.isEntityDirty = false;
|
|
3666
|
+
this.inConfirmNavigation = false;
|
|
3667
|
+
}
|
|
3668
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3669
|
+
get hasUnsavedChanges() {
|
|
3670
|
+
return this.isEntityDirty && this.data.editData.unsavedChangesRequireConfirmDialog;
|
|
3671
|
+
}
|
|
3672
|
+
ngOnInit() {
|
|
3673
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3674
|
+
this.data = new PageEditDataBuilder(this.inputData).getResult();
|
|
3675
|
+
if (this.data == null) {
|
|
3676
|
+
this.confirmNavigateBack();
|
|
3677
|
+
throw new Error('No edit data was provided for "NGX_EDIT_DATA". You need to provide a value in your routes providers array.');
|
|
3678
|
+
}
|
|
3679
|
+
const id = this.route.snapshot.paramMap.get('id');
|
|
3680
|
+
const foundEntity = yield this.entityService.findById(id);
|
|
3681
|
+
if (foundEntity == null) {
|
|
3682
|
+
this.confirmNavigateBack();
|
|
3683
|
+
throw new Error(`Could not find entity with id ${id}`);
|
|
3684
|
+
}
|
|
3685
|
+
this.entity = new this.EntityClass(foundEntity);
|
|
3686
|
+
this.entityPriorChanges = LodashUtilities.cloneDeep(this.entity);
|
|
3687
|
+
this.isReadOnly = !this.data.allowUpdate(this.entityPriorChanges);
|
|
3688
|
+
this.entityTabs = EntityUtilities.getEntityTabs(this.entity, false, true);
|
|
3689
|
+
});
|
|
3690
|
+
}
|
|
3691
|
+
/**
|
|
3692
|
+
* Whether the page can be left without confirmation (of unsaved changes).
|
|
3693
|
+
*
|
|
3694
|
+
* @returns Whether or not the page can be left without confirmation.
|
|
3695
|
+
*/
|
|
3696
|
+
canDeactivate() {
|
|
3697
|
+
return !this.hasUnsavedChanges || this.inConfirmNavigation;
|
|
3698
|
+
}
|
|
3699
|
+
/**
|
|
3700
|
+
* Checks if the entity has become invalid or dirty.
|
|
3701
|
+
*/
|
|
3702
|
+
checkEntity() {
|
|
3703
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3704
|
+
this.isEntityValid = EntityUtilities.isEntityValid(this.entity, 'update');
|
|
3705
|
+
this.isEntityDirty = yield EntityUtilities.isDirty(this.entity, this.entityPriorChanges);
|
|
3706
|
+
});
|
|
3707
|
+
}
|
|
3708
|
+
/**
|
|
3709
|
+
* Tries to save the changes and close the dialog afterwards.
|
|
3710
|
+
* Also handles the confirmation if required.
|
|
3711
|
+
*/
|
|
3712
|
+
edit() {
|
|
3713
|
+
if (this.isReadOnly || !this.isEntityValid || !this.isEntityDirty) {
|
|
3714
|
+
return;
|
|
3715
|
+
}
|
|
3716
|
+
if (!this.data.editData.editRequiresConfirmDialog) {
|
|
3717
|
+
this.confirmEdit();
|
|
3718
|
+
return;
|
|
3719
|
+
}
|
|
3720
|
+
const dialogData = new ConfirmDialogDataBuilder(this.data.editData.confirmEditDialogData)
|
|
3721
|
+
.withDefault('text', ['Do you really want to save all changes?'])
|
|
3722
|
+
.withDefault('confirmButtonLabel', 'Save')
|
|
3723
|
+
.withDefault('title', 'Edit')
|
|
3724
|
+
.getResult();
|
|
3725
|
+
const dialogRef = this.dialog.open(NgxMatEntityConfirmDialogComponent, {
|
|
3726
|
+
data: dialogData,
|
|
3727
|
+
autoFocus: false,
|
|
3728
|
+
restoreFocus: false
|
|
3729
|
+
});
|
|
3730
|
+
dialogRef.afterClosed().subscribe(res => {
|
|
3731
|
+
if (res == true) {
|
|
3732
|
+
this.confirmEdit();
|
|
3733
|
+
}
|
|
3734
|
+
});
|
|
3735
|
+
}
|
|
3736
|
+
confirmEdit() {
|
|
3737
|
+
void this.entityService.update(this.entity, this.entityPriorChanges).then(() => this.confirmNavigateBack());
|
|
3738
|
+
}
|
|
3739
|
+
/**
|
|
3740
|
+
* Tries to delete the entity and close the dialog afterwards.
|
|
3741
|
+
* Also handles the confirmation if required.
|
|
3742
|
+
*/
|
|
3743
|
+
delete() {
|
|
3744
|
+
if (!this.data.editData.deleteRequiresConfirmDialog) {
|
|
3745
|
+
this.confirmDelete();
|
|
3746
|
+
return;
|
|
3747
|
+
}
|
|
3748
|
+
const dialogData = new ConfirmDialogDataBuilder(this.data.editData.confirmDeleteDialogData)
|
|
3749
|
+
.withDefault('text', ['Do you really want to delete this entity?'])
|
|
3750
|
+
.withDefault('type', 'delete')
|
|
3751
|
+
.withDefault('confirmButtonLabel', 'Delete')
|
|
3752
|
+
.withDefault('title', 'Delete')
|
|
3753
|
+
.getResult();
|
|
3754
|
+
const dialogRef = this.dialog.open(NgxMatEntityConfirmDialogComponent, {
|
|
3755
|
+
data: dialogData,
|
|
3756
|
+
autoFocus: false,
|
|
3757
|
+
restoreFocus: false
|
|
3758
|
+
});
|
|
3759
|
+
dialogRef.afterClosed().subscribe(res => {
|
|
3760
|
+
if (res == true) {
|
|
3761
|
+
this.confirmDelete();
|
|
3762
|
+
}
|
|
3763
|
+
});
|
|
3764
|
+
}
|
|
3765
|
+
confirmDelete() {
|
|
3766
|
+
void this.entityService
|
|
3767
|
+
.delete(this.entityPriorChanges)
|
|
3768
|
+
.then(() => this.confirmNavigateBack());
|
|
3769
|
+
}
|
|
3770
|
+
/**
|
|
3771
|
+
* Tries to navigate back.
|
|
3772
|
+
*/
|
|
3773
|
+
navigateBack() {
|
|
3774
|
+
if (!this.hasUnsavedChanges) {
|
|
3775
|
+
this.confirmNavigateBack();
|
|
3776
|
+
return;
|
|
3777
|
+
}
|
|
3778
|
+
this.openConfirmNavigationDialog().subscribe(res => {
|
|
3779
|
+
if (res) {
|
|
3780
|
+
this.confirmNavigateBack();
|
|
3781
|
+
}
|
|
3782
|
+
});
|
|
3783
|
+
}
|
|
3784
|
+
/**
|
|
3785
|
+
* Opens the confirm dialog for navigating with unsaved changes.
|
|
3786
|
+
* This is exposed because the UnsavedChangesGuard needs to access this.
|
|
3787
|
+
*
|
|
3788
|
+
* @returns The first observable result of the confirm dialog.
|
|
3789
|
+
*/
|
|
3790
|
+
openConfirmNavigationDialog() {
|
|
3791
|
+
const dialogRef = this.dialog.open(NgxMatEntityConfirmDialogComponent, {
|
|
3792
|
+
data: this.data.editData.confirmUnsavedChangesDialogData,
|
|
3793
|
+
autoFocus: false,
|
|
3794
|
+
restoreFocus: false
|
|
3795
|
+
});
|
|
3796
|
+
return dialogRef.afterClosed().pipe(first(), map(p => (p !== null && p !== void 0 ? p : false)));
|
|
3797
|
+
}
|
|
3798
|
+
confirmNavigateBack() {
|
|
3799
|
+
this.inConfirmNavigation = true;
|
|
3800
|
+
EntityUtilities.resetChangesOnEntity(this.entity, this.entityPriorChanges);
|
|
3801
|
+
this.location.back();
|
|
3802
|
+
}
|
|
3803
|
+
}
|
|
3804
|
+
NgxMatEntityEditPageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityEditPageComponent, deps: [{ token: i1.MatDialog }, { token: i1$1.Location }, { token: i3$1.ActivatedRoute }, { token: NGX_EDIT_DATA_ENTITY_SERVICE }, { token: NGX_EDIT_DATA_ENTITY }, { token: NGX_EDIT_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
3805
|
+
NgxMatEntityEditPageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: NgxMatEntityEditPageComponent, isStandalone: true, selector: "ngx-mat-entity-edit-page", host: { listeners: { "window:beforeunload": "canDeactivate()" } }, ngImport: i0, template: "<div *ngIf=\"!entityTabs && data.displayLoadingSpinner\" class=\"container\">\n <br>\n <mat-spinner style=\"margin-left: auto; margin-right: auto;\"></mat-spinner>\n <br>\n</div>\n\n<div *ngIf=\"entityTabs\" class=\"container\">\n <br>\n\n <!------------>\n <!-- Header -->\n <!------------>\n <div class=\"header\">\n <div>\n <button type=\"button\" [class.unsavedChanges]=\"hasUnsavedChanges\" mat-raised-button (click)=\"navigateBack()\" class=\"back-button\" tabindex=\"-1\">\n <i class=\"fas fa-chevron-left\"></i>\n {{data.editData.cancelButtonLabel}}\n <i class=\"fas fa-warning\" style=\"color: orange;\" *ngIf=\"hasUnsavedChanges\"></i>\n </button>\n <button (click)=\"edit()\" mat-raised-button [disabled]=\"isReadOnly || !isEntityValid || !isEntityDirty\">\n {{data.editData.confirmButtonLabel}}\n </button>\n </div>\n <button type=\"button\" *ngIf=\"data.allowDelete(entity)\" mat-raised-button (click)=\"delete()\" color=\"warn\" class=\"delete-button\" tabindex=\"-1\">\n {{data.editData.deleteButtonLabel}}\n </button>\n </div>\n\n <h1>{{data.editData.title(entityPriorChanges)}}</h1>\n\n <!----------->\n <!-- Input -->\n <!----------->\n <form>\n <mat-tab-group *ngIf=\"entityTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of entityTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n \n <div *ngIf=\"entityTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of entityTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n\n <button type=\"submit\" (click)=\"edit()\" mat-raised-button [disabled]=\"isReadOnly || !isEntityValid || !isEntityDirty\">\n {{data.editData.confirmButtonLabel}}\n </button>\n </form>\n\n <br>\n</div>", styles: [".header{display:flex;justify-content:space-between}.header div{display:flex;column-gap:10px}h1{text-align:center}.unsavedChanges{background-color:#ffe48d}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "component", type: i6$1.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i6$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }, { kind: "ngmodule", type: NgxMatEntityInputModule }, { kind: "component", type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: ["entity", "propertyKey", "getValidationErrorMessage", "hideOmitForCreate", "hideOmitForEdit", "isReadOnly"], outputs: ["inputChangeEvent"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] });
|
|
3806
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityEditPageComponent, decorators: [{
|
|
3807
|
+
type: Component,
|
|
3808
|
+
args: [{ selector: 'ngx-mat-entity-edit-page', standalone: true, imports: [CommonModule, MatButtonModule, MatTabsModule, NgxMatEntityInputModule, MatProgressSpinnerModule], template: "<div *ngIf=\"!entityTabs && data.displayLoadingSpinner\" class=\"container\">\n <br>\n <mat-spinner style=\"margin-left: auto; margin-right: auto;\"></mat-spinner>\n <br>\n</div>\n\n<div *ngIf=\"entityTabs\" class=\"container\">\n <br>\n\n <!------------>\n <!-- Header -->\n <!------------>\n <div class=\"header\">\n <div>\n <button type=\"button\" [class.unsavedChanges]=\"hasUnsavedChanges\" mat-raised-button (click)=\"navigateBack()\" class=\"back-button\" tabindex=\"-1\">\n <i class=\"fas fa-chevron-left\"></i>\n {{data.editData.cancelButtonLabel}}\n <i class=\"fas fa-warning\" style=\"color: orange;\" *ngIf=\"hasUnsavedChanges\"></i>\n </button>\n <button (click)=\"edit()\" mat-raised-button [disabled]=\"isReadOnly || !isEntityValid || !isEntityDirty\">\n {{data.editData.confirmButtonLabel}}\n </button>\n </div>\n <button type=\"button\" *ngIf=\"data.allowDelete(entity)\" mat-raised-button (click)=\"delete()\" color=\"warn\" class=\"delete-button\" tabindex=\"-1\">\n {{data.editData.deleteButtonLabel}}\n </button>\n </div>\n\n <h1>{{data.editData.title(entityPriorChanges)}}</h1>\n\n <!----------->\n <!-- Input -->\n <!----------->\n <form>\n <mat-tab-group *ngIf=\"entityTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of entityTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n \n <div *ngIf=\"entityTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of entityTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n\n <button type=\"submit\" (click)=\"edit()\" mat-raised-button [disabled]=\"isReadOnly || !isEntityValid || !isEntityDirty\">\n {{data.editData.confirmButtonLabel}}\n </button>\n </form>\n\n <br>\n</div>", styles: [".header{display:flex;justify-content:space-between}.header div{display:flex;column-gap:10px}h1{text-align:center}.unsavedChanges{background-color:#ffe48d}\n"] }]
|
|
3809
|
+
}], ctorParameters: function () {
|
|
3810
|
+
return [{ type: i1.MatDialog }, { type: i1$1.Location }, { type: i3$1.ActivatedRoute }, { type: EntityService, decorators: [{
|
|
3811
|
+
type: Inject,
|
|
3812
|
+
args: [NGX_EDIT_DATA_ENTITY_SERVICE]
|
|
3813
|
+
}] }, { type: undefined, decorators: [{
|
|
3814
|
+
type: Inject,
|
|
3815
|
+
args: [NGX_EDIT_DATA_ENTITY]
|
|
3816
|
+
}] }, { type: undefined, decorators: [{
|
|
3817
|
+
type: Inject,
|
|
3818
|
+
args: [NGX_EDIT_DATA]
|
|
3819
|
+
}] }];
|
|
3820
|
+
}, propDecorators: { canDeactivate: [{
|
|
3821
|
+
type: HostListener,
|
|
3822
|
+
args: ['window:beforeunload']
|
|
3823
|
+
}] } });
|
|
3824
|
+
|
|
3825
|
+
/**
|
|
3826
|
+
* The internal CreateEntityDialogData. Requires all default values the user can leave out.
|
|
3827
|
+
*/
|
|
3828
|
+
class CreateEntityDialogDataInternal {
|
|
3829
|
+
constructor(entity, EntityServiceClass, createDialogData) {
|
|
3830
|
+
this.entity = entity;
|
|
3831
|
+
this.EntityServiceClass = EntityServiceClass;
|
|
3832
|
+
this.createDialogData = createDialogData;
|
|
3833
|
+
}
|
|
3834
|
+
}
|
|
3835
|
+
/**
|
|
3836
|
+
* The Builder for the CreateEntityDialogData. Sets default values.
|
|
3837
|
+
*/
|
|
3838
|
+
class CreateEntityDialogDataBuilder extends BaseBuilder {
|
|
3839
|
+
constructor(data) {
|
|
3516
3840
|
super(data);
|
|
3517
3841
|
}
|
|
3518
3842
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
@@ -3571,8 +3895,8 @@ class NgxMatEntityCreateDialogComponent {
|
|
|
3571
3895
|
autoFocus: false,
|
|
3572
3896
|
restoreFocus: false
|
|
3573
3897
|
});
|
|
3574
|
-
dialogRef.afterClosed().subscribe(
|
|
3575
|
-
if (res
|
|
3898
|
+
dialogRef.afterClosed().subscribe(res => {
|
|
3899
|
+
if (res == true) {
|
|
3576
3900
|
this.confirmCreate();
|
|
3577
3901
|
}
|
|
3578
3902
|
});
|
|
@@ -3599,70 +3923,61 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
|
|
|
3599
3923
|
}] }, { type: i1.MatDialogRef }, { type: i0.Injector }, { type: i1.MatDialog }];
|
|
3600
3924
|
} });
|
|
3601
3925
|
|
|
3602
|
-
|
|
3603
|
-
* The internal EditDialogData. Requires all default values the user can leave out.
|
|
3604
|
-
*/
|
|
3605
|
-
class EditDialogDataInternal {
|
|
3606
|
-
constructor(title, confirmButtonLabel, deleteButtonLabel, cancelButtonLabel, deleteRequiresConfirmDialog, editRequiresConfirmDialog, confirmDeleteDialogData, confirmEditDialogData) {
|
|
3607
|
-
this.title = title;
|
|
3608
|
-
this.confirmButtonLabel = confirmButtonLabel;
|
|
3609
|
-
this.deleteButtonLabel = deleteButtonLabel;
|
|
3610
|
-
this.cancelButtonLabel = cancelButtonLabel;
|
|
3611
|
-
this.deleteRequiresConfirmDialog = deleteRequiresConfirmDialog;
|
|
3612
|
-
this.editRequiresConfirmDialog = editRequiresConfirmDialog;
|
|
3613
|
-
this.confirmDeleteDialogData = confirmDeleteDialogData;
|
|
3614
|
-
this.confirmEditDialogData = confirmEditDialogData;
|
|
3615
|
-
}
|
|
3616
|
-
}
|
|
3617
|
-
/**
|
|
3618
|
-
* The Builder for the EditDialogData. Sets default values.
|
|
3619
|
-
*/
|
|
3620
|
-
class EditDialogDataBuilder extends BaseBuilder {
|
|
3621
|
-
constructor(data) {
|
|
3622
|
-
super(data);
|
|
3623
|
-
}
|
|
3624
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3625
|
-
generateBaseData(data) {
|
|
3626
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3627
|
-
const confirmEditDialogData = new ConfirmDialogDataBuilder(data === null || data === void 0 ? void 0 : data.confirmEditDialogData)
|
|
3628
|
-
.withDefault('confirmButtonLabel', 'Save')
|
|
3629
|
-
.withDefault('text', ['Do you really want to save all changes?'])
|
|
3630
|
-
.withDefault('title', 'Edit')
|
|
3631
|
-
.getResult();
|
|
3632
|
-
const confirmDeleteDialogData = new ConfirmDialogDataBuilder(data === null || data === void 0 ? void 0 : data.confirmDeleteDialogData)
|
|
3633
|
-
.withDefault('confirmButtonLabel', 'Delete')
|
|
3634
|
-
.withDefault('type', 'delete')
|
|
3635
|
-
.withDefault('text', ['Do you really want to delete this entity?'])
|
|
3636
|
-
.withDefault('title', 'Delete')
|
|
3637
|
-
.getResult();
|
|
3638
|
-
return new EditDialogDataInternal((_a = data === null || data === void 0 ? void 0 : data.title) !== null && _a !== void 0 ? _a : (() => 'Edit'), (_b = data === null || data === void 0 ? void 0 : data.confirmButtonLabel) !== null && _b !== void 0 ? _b : 'Save', (_c = data === null || data === void 0 ? void 0 : data.deleteButtonLabel) !== null && _c !== void 0 ? _c : 'Delete', (_d = data === null || data === void 0 ? void 0 : data.cancelButtonLabel) !== null && _d !== void 0 ? _d : 'Cancel', (_e = data === null || data === void 0 ? void 0 : data.deleteRequiresConfirmDialog) !== null && _e !== void 0 ? _e : true, (_f = data === null || data === void 0 ? void 0 : data.editRequiresConfirmDialog) !== null && _f !== void 0 ? _f : false, confirmDeleteDialogData, confirmEditDialogData);
|
|
3639
|
-
}
|
|
3926
|
+
class NgxMatEntityCreateDialogModule {
|
|
3640
3927
|
}
|
|
3928
|
+
NgxMatEntityCreateDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityCreateDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3929
|
+
NgxMatEntityCreateDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityCreateDialogModule, declarations: [NgxMatEntityCreateDialogComponent], imports: [CommonModule,
|
|
3930
|
+
NgxMatEntityInputModule,
|
|
3931
|
+
MatDialogModule,
|
|
3932
|
+
FormsModule,
|
|
3933
|
+
MatButtonModule,
|
|
3934
|
+
MatTabsModule], exports: [NgxMatEntityCreateDialogComponent] });
|
|
3935
|
+
NgxMatEntityCreateDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityCreateDialogModule, imports: [CommonModule,
|
|
3936
|
+
NgxMatEntityInputModule,
|
|
3937
|
+
MatDialogModule,
|
|
3938
|
+
FormsModule,
|
|
3939
|
+
MatButtonModule,
|
|
3940
|
+
MatTabsModule] });
|
|
3941
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityCreateDialogModule, decorators: [{
|
|
3942
|
+
type: NgModule,
|
|
3943
|
+
args: [{
|
|
3944
|
+
declarations: [NgxMatEntityCreateDialogComponent],
|
|
3945
|
+
imports: [
|
|
3946
|
+
CommonModule,
|
|
3947
|
+
NgxMatEntityInputModule,
|
|
3948
|
+
MatDialogModule,
|
|
3949
|
+
FormsModule,
|
|
3950
|
+
MatButtonModule,
|
|
3951
|
+
MatTabsModule
|
|
3952
|
+
],
|
|
3953
|
+
exports: [NgxMatEntityCreateDialogComponent]
|
|
3954
|
+
}]
|
|
3955
|
+
}] });
|
|
3641
3956
|
|
|
3642
3957
|
/**
|
|
3643
|
-
* The internal
|
|
3958
|
+
* The internal EditEntityData. Requires all default values the user can leave out.
|
|
3644
3959
|
*/
|
|
3645
|
-
class
|
|
3646
|
-
constructor(entity, EntityServiceClass,
|
|
3960
|
+
class EditEntityDataInternal {
|
|
3961
|
+
constructor(entity, EntityServiceClass, editData, allowUpdate, allowDelete) {
|
|
3647
3962
|
this.entity = entity;
|
|
3648
3963
|
this.EntityServiceClass = EntityServiceClass;
|
|
3649
|
-
this.
|
|
3964
|
+
this.editData = editData;
|
|
3650
3965
|
this.allowDelete = allowDelete;
|
|
3651
3966
|
this.allowUpdate = allowUpdate;
|
|
3652
3967
|
}
|
|
3653
3968
|
}
|
|
3654
3969
|
/**
|
|
3655
|
-
* The Builder for the
|
|
3970
|
+
* The Builder for the EditEntityData. Sets default values.
|
|
3656
3971
|
*/
|
|
3657
|
-
class
|
|
3972
|
+
class EditEntityDataBuilder extends BaseBuilder {
|
|
3658
3973
|
constructor(data) {
|
|
3659
3974
|
super(data);
|
|
3660
3975
|
}
|
|
3661
3976
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3662
3977
|
generateBaseData(data) {
|
|
3663
3978
|
var _a, _b;
|
|
3664
|
-
const editDialogData = new EditDialogDataBuilder(data.
|
|
3665
|
-
return new
|
|
3979
|
+
const editDialogData = new EditDialogDataBuilder(data.editData).getResult();
|
|
3980
|
+
return new EditEntityDataInternal(data.entity, data.EntityServiceClass, editDialogData, (_a = data.allowUpdate) !== null && _a !== void 0 ? _a : (() => true), (_b = data.allowDelete) !== null && _b !== void 0 ? _b : (() => true));
|
|
3666
3981
|
}
|
|
3667
3982
|
}
|
|
3668
3983
|
|
|
@@ -3683,7 +3998,7 @@ class NgxMatEntityEditDialogComponent {
|
|
|
3683
3998
|
this.isEntityDirty = false;
|
|
3684
3999
|
}
|
|
3685
4000
|
ngOnInit() {
|
|
3686
|
-
this.data = new
|
|
4001
|
+
this.data = new EditEntityDataBuilder(this.inputData).getResult();
|
|
3687
4002
|
this.entityPriorChanges = LodashUtilities.cloneDeep(this.data.entity);
|
|
3688
4003
|
this.isReadOnly = !this.data.allowUpdate(this.entityPriorChanges);
|
|
3689
4004
|
this.dialogRef.disableClose = true;
|
|
@@ -3707,11 +4022,11 @@ class NgxMatEntityEditDialogComponent {
|
|
|
3707
4022
|
if (this.isReadOnly || !this.isEntityValid || !this.isEntityDirty) {
|
|
3708
4023
|
return;
|
|
3709
4024
|
}
|
|
3710
|
-
if (!this.data.
|
|
4025
|
+
if (!this.data.editData.editRequiresConfirmDialog) {
|
|
3711
4026
|
this.confirmEdit();
|
|
3712
4027
|
return;
|
|
3713
4028
|
}
|
|
3714
|
-
const dialogData = new ConfirmDialogDataBuilder(this.data.
|
|
4029
|
+
const dialogData = new ConfirmDialogDataBuilder(this.data.editData.confirmEditDialogData)
|
|
3715
4030
|
.withDefault('text', ['Do you really want to save all changes?'])
|
|
3716
4031
|
.withDefault('confirmButtonLabel', 'Save')
|
|
3717
4032
|
.withDefault('title', 'Edit')
|
|
@@ -3721,8 +4036,8 @@ class NgxMatEntityEditDialogComponent {
|
|
|
3721
4036
|
autoFocus: false,
|
|
3722
4037
|
restoreFocus: false
|
|
3723
4038
|
});
|
|
3724
|
-
dialogRef.afterClosed().subscribe(
|
|
3725
|
-
if (res
|
|
4039
|
+
dialogRef.afterClosed().subscribe(res => {
|
|
4040
|
+
if (res == true) {
|
|
3726
4041
|
this.confirmEdit();
|
|
3727
4042
|
}
|
|
3728
4043
|
});
|
|
@@ -3735,11 +4050,11 @@ class NgxMatEntityEditDialogComponent {
|
|
|
3735
4050
|
* Also handles the confirmation if required.
|
|
3736
4051
|
*/
|
|
3737
4052
|
delete() {
|
|
3738
|
-
if (!this.data.
|
|
4053
|
+
if (!this.data.editData.deleteRequiresConfirmDialog) {
|
|
3739
4054
|
this.confirmDelete();
|
|
3740
4055
|
return;
|
|
3741
4056
|
}
|
|
3742
|
-
const dialogData = new ConfirmDialogDataBuilder(this.data.
|
|
4057
|
+
const dialogData = new ConfirmDialogDataBuilder(this.data.editData.confirmDeleteDialogData)
|
|
3743
4058
|
.withDefault('text', ['Do you really want to delete this entity?'])
|
|
3744
4059
|
.withDefault('type', 'delete')
|
|
3745
4060
|
.withDefault('confirmButtonLabel', 'Delete')
|
|
@@ -3750,8 +4065,8 @@ class NgxMatEntityEditDialogComponent {
|
|
|
3750
4065
|
autoFocus: false,
|
|
3751
4066
|
restoreFocus: false
|
|
3752
4067
|
});
|
|
3753
|
-
dialogRef.afterClosed().subscribe(
|
|
3754
|
-
if (res
|
|
4068
|
+
dialogRef.afterClosed().subscribe(res => {
|
|
4069
|
+
if (res == true) {
|
|
3755
4070
|
this.confirmDelete();
|
|
3756
4071
|
}
|
|
3757
4072
|
});
|
|
@@ -3768,10 +4083,10 @@ class NgxMatEntityEditDialogComponent {
|
|
|
3768
4083
|
}
|
|
3769
4084
|
}
|
|
3770
4085
|
NgxMatEntityEditDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityEditDialogComponent, deps: [{ token: MAT_DIALOG_DATA }, { token: i1.MatDialogRef }, { token: i0.Injector }, { token: i1.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
|
|
3771
|
-
NgxMatEntityEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: NgxMatEntityEditDialogComponent, selector: "ngx-mat-entity-edit-dialog", ngImport: i0, template: "<div class=\"mat-dialog-title\"
|
|
4086
|
+
NgxMatEntityEditDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: NgxMatEntityEditDialogComponent, selector: "ngx-mat-entity-edit-dialog", ngImport: i0, template: "<div class=\"mat-dialog-title\">\n <div>{{data.editData.title(data.entity)}}</div>\n <button type=\"button\" *ngIf=\"data.allowDelete(data.entity)\" mat-raised-button (click)=\"delete()\" color=\"warn\" class=\"delete-button\" tabindex=\"-1\">\n {{data.editData.deleteButtonLabel}}\n </button>\n</div>\n\n<form>\n <mat-dialog-content>\n <mat-tab-group *ngIf=\"entityTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of entityTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n \n <div *ngIf=\"entityTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of entityTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </mat-dialog-content>\n \n <mat-dialog-actions>\n <button type=\"submit\" (click)=\"edit()\" mat-raised-button [disabled]=\"isReadOnly || !isEntityValid || !isEntityDirty\">\n {{data.editData.confirmButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button (click)=\"cancel()\" class=\"cancel-button\">\n {{data.editData.cancelButtonLabel}}\n </button>\n </mat-dialog-actions>\n</form>\n", styles: [".mat-dialog-title{padding:12px 20px;display:flex;justify-content:space-between;align-items:center}.mat-dialog-title div{font-size:var(--mdc-dialog-subhead-size, 14px);font-weight:var(--mdc-dialog-subhead-weight, 500)}::ng-deep .mdc-dialog .mdc-dialog__content{padding:6px 20px!important}mat-dialog-actions{justify-content:space-between;align-items:center;padding-left:20px;padding-right:20px}\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: "component", type: NgxMatEntityInputComponent, selector: "ngx-mat-entity-input", inputs: ["entity", "propertyKey", "getValidationErrorMessage", "hideOmitForCreate", "hideOmitForEdit", "isReadOnly"], outputs: ["inputChangeEvent"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i6$1.MatTab, selector: "mat-tab", inputs: ["disabled"], exportAs: ["matTab"] }, { kind: "component", type: i6$1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple", "fitInkBarToContent", "mat-stretch-tabs"], exportAs: ["matTabGroup"] }] });
|
|
3772
4087
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityEditDialogComponent, decorators: [{
|
|
3773
4088
|
type: Component,
|
|
3774
|
-
args: [{ selector: 'ngx-mat-entity-edit-dialog', template: "<div class=\"mat-dialog-title\"
|
|
4089
|
+
args: [{ selector: 'ngx-mat-entity-edit-dialog', template: "<div class=\"mat-dialog-title\">\n <div>{{data.editData.title(data.entity)}}</div>\n <button type=\"button\" *ngIf=\"data.allowDelete(data.entity)\" mat-raised-button (click)=\"delete()\" color=\"warn\" class=\"delete-button\" tabindex=\"-1\">\n {{data.editData.deleteButtonLabel}}\n </button>\n</div>\n\n<form>\n <mat-dialog-content>\n <mat-tab-group *ngIf=\"entityTabs.length > 1\" preserveContent>\n <mat-tab *ngFor=\"let tab of entityTabs\" [label]=\"tab.tabName\">\n <div class=\"row\" *ngFor=\"let row of tab.rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </mat-tab>\n </mat-tab-group>\n \n <div *ngIf=\"entityTabs.length <= 1\">\n <div class=\"row\" *ngFor=\"let row of entityTabs[0].rows\">\n <ngx-mat-entity-input\n *ngFor=\"let key of row.keys\"\n [entity]=\"data.entity\"\n [propertyKey]=\"key\"\n [hideOmitForEdit]=\"true\"\n class=\"col-lg-{{EntityUtilities.getWidth(data.entity, key, 'lg')}} col-md-{{EntityUtilities.getWidth(data.entity, key, 'md')}} col-sm-{{EntityUtilities.getWidth(data.entity, key, 'sm')}}\"\n (inputChangeEvent)=\"checkEntity()\"\n [isReadOnly]=\"isReadOnly\"\n >\n </ngx-mat-entity-input>\n </div>\n </div>\n </mat-dialog-content>\n \n <mat-dialog-actions>\n <button type=\"submit\" (click)=\"edit()\" mat-raised-button [disabled]=\"isReadOnly || !isEntityValid || !isEntityDirty\">\n {{data.editData.confirmButtonLabel}}\n </button>\n <button type=\"button\" mat-raised-button (click)=\"cancel()\" class=\"cancel-button\">\n {{data.editData.cancelButtonLabel}}\n </button>\n </mat-dialog-actions>\n</form>\n", styles: [".mat-dialog-title{padding:12px 20px;display:flex;justify-content:space-between;align-items:center}.mat-dialog-title div{font-size:var(--mdc-dialog-subhead-size, 14px);font-weight:var(--mdc-dialog-subhead-weight, 500)}::ng-deep .mdc-dialog .mdc-dialog__content{padding:6px 20px!important}mat-dialog-actions{justify-content:space-between;align-items:center;padding-left:20px;padding-right:20px}\n"] }]
|
|
3775
4090
|
}], ctorParameters: function () {
|
|
3776
4091
|
return [{ type: undefined, decorators: [{
|
|
3777
4092
|
type: Inject,
|
|
@@ -3779,6 +4094,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
|
|
|
3779
4094
|
}] }, { type: i1.MatDialogRef }, { type: i0.Injector }, { type: i1.MatDialog }];
|
|
3780
4095
|
} });
|
|
3781
4096
|
|
|
4097
|
+
class NgxMatEntityEditDialogModule {
|
|
4098
|
+
}
|
|
4099
|
+
NgxMatEntityEditDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityEditDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4100
|
+
NgxMatEntityEditDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityEditDialogModule, declarations: [NgxMatEntityEditDialogComponent], imports: [CommonModule,
|
|
4101
|
+
NgxMatEntityInputModule,
|
|
4102
|
+
MatDialogModule,
|
|
4103
|
+
FormsModule,
|
|
4104
|
+
MatButtonModule,
|
|
4105
|
+
MatTabsModule,
|
|
4106
|
+
NgxMatEntityConfirmDialogModule], exports: [NgxMatEntityEditDialogComponent] });
|
|
4107
|
+
NgxMatEntityEditDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityEditDialogModule, imports: [CommonModule,
|
|
4108
|
+
NgxMatEntityInputModule,
|
|
4109
|
+
MatDialogModule,
|
|
4110
|
+
FormsModule,
|
|
4111
|
+
MatButtonModule,
|
|
4112
|
+
MatTabsModule,
|
|
4113
|
+
NgxMatEntityConfirmDialogModule] });
|
|
4114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityEditDialogModule, decorators: [{
|
|
4115
|
+
type: NgModule,
|
|
4116
|
+
args: [{
|
|
4117
|
+
declarations: [NgxMatEntityEditDialogComponent],
|
|
4118
|
+
imports: [
|
|
4119
|
+
CommonModule,
|
|
4120
|
+
NgxMatEntityInputModule,
|
|
4121
|
+
MatDialogModule,
|
|
4122
|
+
FormsModule,
|
|
4123
|
+
MatButtonModule,
|
|
4124
|
+
MatTabsModule,
|
|
4125
|
+
NgxMatEntityConfirmDialogModule
|
|
4126
|
+
],
|
|
4127
|
+
exports: [NgxMatEntityEditDialogComponent]
|
|
4128
|
+
}]
|
|
4129
|
+
}] });
|
|
4130
|
+
|
|
3782
4131
|
/**
|
|
3783
4132
|
* The internal TableData. Requires all default values the user can leave out.
|
|
3784
4133
|
*/
|
|
@@ -3786,7 +4135,7 @@ class TableDataInternal {
|
|
|
3786
4135
|
constructor(baseData, createDialogData, editDialogData) {
|
|
3787
4136
|
this.baseData = baseData;
|
|
3788
4137
|
this.createDialogData = createDialogData;
|
|
3789
|
-
this.
|
|
4138
|
+
this.editData = editDialogData;
|
|
3790
4139
|
}
|
|
3791
4140
|
}
|
|
3792
4141
|
/**
|
|
@@ -3798,21 +4147,27 @@ class BaseDataBuilder extends BaseBuilder {
|
|
|
3798
4147
|
}
|
|
3799
4148
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3800
4149
|
generateBaseData(data) {
|
|
3801
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3802
|
-
return new BaseDataInternal(data.title, data.displayColumns, data.EntityServiceClass, (_a = data.searchLabel) !== null && _a !== void 0 ? _a : 'Search', (_b = data.createButtonLabel) !== null && _b !== void 0 ? _b : 'Create', (_c = data.
|
|
4150
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
4151
|
+
return new BaseDataInternal(data.title, data.displayColumns, data.EntityServiceClass, (_a = data.searchLabel) !== null && _a !== void 0 ? _a : 'Search', (_b = data.createButtonLabel) !== null && _b !== void 0 ? _b : 'Create', (_c = data.defaultEdit) !== null && _c !== void 0 ? _c : 'dialog', (_d = data.searchString) !== null && _d !== void 0 ? _d : defaultSearchFunction, (_e = data.allowCreate) !== null && _e !== void 0 ? _e : (() => true), (_f = data.allowRead) !== null && _f !== void 0 ? _f : (() => true), (_g = data.allowUpdate) !== null && _g !== void 0 ? _g : (() => true), (_h = data.allowDelete) !== null && _h !== void 0 ? _h : (() => true), (_j = data.multiSelectActions) !== null && _j !== void 0 ? _j : [], (_k = data.multiSelectLabel) !== null && _k !== void 0 ? _k : 'Actions', (_l = data.displayLoadingSpinner) !== null && _l !== void 0 ? _l : true, (_m = data.allowJsonImport) !== null && _m !== void 0 ? _m : false, (_o = data.importActionData) !== null && _o !== void 0 ? _o : {
|
|
4152
|
+
displayName: 'Import (JSON)',
|
|
4153
|
+
confirmDialogData: new ConfirmDialogDataBuilder()
|
|
4154
|
+
.withDefault('text', ['Do you really want to import entities from the provided file?'])
|
|
4155
|
+
.getResult()
|
|
4156
|
+
}, data.EntityClass, data.edit, data.create);
|
|
3803
4157
|
}
|
|
3804
4158
|
}
|
|
3805
4159
|
/**
|
|
3806
4160
|
* The internal TableData. Requires all default values the user can leave out.
|
|
3807
4161
|
*/
|
|
3808
4162
|
class BaseDataInternal {
|
|
3809
|
-
constructor(title, displayColumns, EntityServiceClass, searchLabel, createButtonLabel, searchString, allowCreate, allowRead, allowUpdate, allowDelete, multiSelectActions, multiSelectLabel, EntityClass, edit, create) {
|
|
4163
|
+
constructor(title, displayColumns, EntityServiceClass, searchLabel, createButtonLabel, defaultEdit, searchString, allowCreate, allowRead, allowUpdate, allowDelete, multiSelectActions, multiSelectLabel, displayLoadingSpinner, allowJsonImport, importActionData, EntityClass, edit, create) {
|
|
3810
4164
|
this.title = title;
|
|
3811
4165
|
this.displayColumns = displayColumns;
|
|
3812
4166
|
this.EntityServiceClass = EntityServiceClass;
|
|
3813
4167
|
this.EntityClass = EntityClass;
|
|
3814
4168
|
this.searchLabel = searchLabel;
|
|
3815
4169
|
this.createButtonLabel = createButtonLabel;
|
|
4170
|
+
this.defaultEdit = defaultEdit;
|
|
3816
4171
|
this.searchString = searchString;
|
|
3817
4172
|
this.allowCreate = allowCreate;
|
|
3818
4173
|
this.allowRead = allowRead;
|
|
@@ -3820,6 +4175,9 @@ class BaseDataInternal {
|
|
|
3820
4175
|
this.allowDelete = allowDelete;
|
|
3821
4176
|
this.multiSelectActions = multiSelectActions;
|
|
3822
4177
|
this.multiSelectLabel = multiSelectLabel;
|
|
4178
|
+
this.displayLoadingSpinner = displayLoadingSpinner;
|
|
4179
|
+
this.allowJsonImport = allowJsonImport;
|
|
4180
|
+
this.importActionData = importActionData;
|
|
3823
4181
|
this.edit = edit;
|
|
3824
4182
|
this.create = create;
|
|
3825
4183
|
}
|
|
@@ -3834,7 +4192,7 @@ class TableDataBuilder extends BaseBuilder {
|
|
|
3834
4192
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3835
4193
|
generateBaseData(data) {
|
|
3836
4194
|
const createDialogData = new CreateDialogDataBuilder(data.createDialogData).getResult();
|
|
3837
|
-
const editDialogData = new EditDialogDataBuilder(data.
|
|
4195
|
+
const editDialogData = new EditDialogDataBuilder(data.editData).getResult();
|
|
3838
4196
|
const baseData = new BaseDataBuilder(data.baseData).getResult();
|
|
3839
4197
|
return new TableDataInternal(baseData, createDialogData, editDialogData);
|
|
3840
4198
|
}
|
|
@@ -3862,7 +4220,8 @@ class TableDataBuilder extends BaseBuilder {
|
|
|
3862
4220
|
|| data.baseData.allowUpdate !== (() => false)
|
|
3863
4221
|
|| data.baseData.allowDelete !== (() => false))
|
|
3864
4222
|
&& !data.baseData.edit
|
|
3865
|
-
&&
|
|
4223
|
+
&& data.baseData.defaultEdit == 'dialog'
|
|
4224
|
+
&& !data.editData) {
|
|
3866
4225
|
throw new Error(`Missing required Input data "editDialogData".
|
|
3867
4226
|
You can only omit this value when viewing, editing and deleting is disallowed or done with a custom edit method.`);
|
|
3868
4227
|
}
|
|
@@ -3893,9 +4252,11 @@ function defaultSearchFunction(entity) {
|
|
|
3893
4252
|
* It offers a lot of customization options which can be found in "TableData".
|
|
3894
4253
|
*/
|
|
3895
4254
|
class NgxMatEntityTableComponent {
|
|
3896
|
-
constructor(dialog, injector) {
|
|
4255
|
+
constructor(dialog, injector, router) {
|
|
3897
4256
|
this.dialog = dialog;
|
|
3898
4257
|
this.injector = injector;
|
|
4258
|
+
this.router = router;
|
|
4259
|
+
this.isLoading = true;
|
|
3899
4260
|
this.onDestroy = new Subject();
|
|
3900
4261
|
this.dataSource = new MatTableDataSource();
|
|
3901
4262
|
this.selection = new SelectionModel(true, []);
|
|
@@ -3906,6 +4267,7 @@ class NgxMatEntityTableComponent {
|
|
|
3906
4267
|
*/
|
|
3907
4268
|
ngOnInit() {
|
|
3908
4269
|
this.data = new TableDataBuilder(this.tableData).getResult();
|
|
4270
|
+
this.importAction = Object.assign(Object.assign({}, this.data.baseData.importActionData), { action: () => this.startImportJson() });
|
|
3909
4271
|
this.entityService = this.injector.get(this.data.baseData.EntityServiceClass);
|
|
3910
4272
|
const givenDisplayColumns = this.data.baseData.displayColumns.map((v) => v.displayName);
|
|
3911
4273
|
if (this.data.baseData.multiSelectActions.length) {
|
|
@@ -3931,7 +4293,37 @@ class NgxMatEntityTableComponent {
|
|
|
3931
4293
|
this.dataSource.data = entities;
|
|
3932
4294
|
this.selection.clear();
|
|
3933
4295
|
});
|
|
3934
|
-
void this.entityService.read()
|
|
4296
|
+
void this.entityService.read().then(() => {
|
|
4297
|
+
this.isLoading = false;
|
|
4298
|
+
});
|
|
4299
|
+
}
|
|
4300
|
+
startImportJson() {
|
|
4301
|
+
const input = document.createElement('input');
|
|
4302
|
+
input.type = 'file';
|
|
4303
|
+
input.accept = 'application/json';
|
|
4304
|
+
input.onchange = () => __awaiter(this, void 0, void 0, function* () {
|
|
4305
|
+
if (input.files) {
|
|
4306
|
+
this.importJson(input.files[0]);
|
|
4307
|
+
}
|
|
4308
|
+
});
|
|
4309
|
+
input.click();
|
|
4310
|
+
}
|
|
4311
|
+
importJson(file) {
|
|
4312
|
+
var _a;
|
|
4313
|
+
const dialogData = new ConfirmDialogDataBuilder(this.importAction.confirmDialogData)
|
|
4314
|
+
.withDefault('text', (_a = this.data.baseData.importActionData.confirmDialogData) === null || _a === void 0 ? void 0 : _a.text)
|
|
4315
|
+
.withDefault('title', this.importAction.displayName)
|
|
4316
|
+
.getResult();
|
|
4317
|
+
const dialogRef = this.dialog.open(NgxMatEntityConfirmDialogComponent, {
|
|
4318
|
+
data: dialogData,
|
|
4319
|
+
autoFocus: false,
|
|
4320
|
+
restoreFocus: false
|
|
4321
|
+
});
|
|
4322
|
+
dialogRef.afterClosed().subscribe(res => {
|
|
4323
|
+
if (res == true) {
|
|
4324
|
+
void this.entityService.import(file);
|
|
4325
|
+
}
|
|
4326
|
+
});
|
|
3935
4327
|
}
|
|
3936
4328
|
/**
|
|
3937
4329
|
* Edits an entity. This either calls the edit-Method provided by the user or uses a default edit-dialog.
|
|
@@ -3948,21 +4340,27 @@ class NgxMatEntityTableComponent {
|
|
|
3948
4340
|
}
|
|
3949
4341
|
if (this.data.baseData.edit) {
|
|
3950
4342
|
this.data.baseData.edit(new this.data.baseData.EntityClass(entity));
|
|
4343
|
+
return;
|
|
3951
4344
|
}
|
|
3952
|
-
|
|
3953
|
-
|
|
4345
|
+
if (this.data.baseData.defaultEdit == 'page') {
|
|
4346
|
+
this.editDefaultPage(new this.data.baseData.EntityClass(entity));
|
|
4347
|
+
return;
|
|
3954
4348
|
}
|
|
4349
|
+
void this.editDefaultDialog(new this.data.baseData.EntityClass(entity));
|
|
4350
|
+
}
|
|
4351
|
+
editDefaultPage(entity) {
|
|
4352
|
+
void this.router.navigate(['', this.entityService.editBaseRoute, entity.id]);
|
|
3955
4353
|
}
|
|
3956
|
-
|
|
4354
|
+
editDefaultDialog(entity) {
|
|
3957
4355
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3958
4356
|
const inputDialogData = {
|
|
3959
4357
|
entity: entity,
|
|
3960
4358
|
EntityServiceClass: this.data.baseData.EntityServiceClass,
|
|
3961
4359
|
allowUpdate: this.data.baseData.allowUpdate,
|
|
3962
4360
|
allowDelete: this.data.baseData.allowDelete,
|
|
3963
|
-
|
|
4361
|
+
editData: this.data.editData
|
|
3964
4362
|
};
|
|
3965
|
-
const dialogData = new
|
|
4363
|
+
const dialogData = new EditEntityDataBuilder(inputDialogData).getResult();
|
|
3966
4364
|
const res = yield firstValueFrom(this.dialog.open(NgxMatEntityEditDialogComponent, {
|
|
3967
4365
|
data: dialogData,
|
|
3968
4366
|
minWidth: '60%',
|
|
@@ -4028,8 +4426,8 @@ class NgxMatEntityTableComponent {
|
|
|
4028
4426
|
autoFocus: false,
|
|
4029
4427
|
restoreFocus: false
|
|
4030
4428
|
});
|
|
4031
|
-
dialogRef.afterClosed().subscribe(
|
|
4032
|
-
if (res
|
|
4429
|
+
dialogRef.afterClosed().subscribe(res => {
|
|
4430
|
+
if (res == true) {
|
|
4033
4431
|
this.confirmRunMultiAction(action);
|
|
4034
4432
|
}
|
|
4035
4433
|
});
|
|
@@ -4047,108 +4445,43 @@ class NgxMatEntityTableComponent {
|
|
|
4047
4445
|
var _a;
|
|
4048
4446
|
if (!this.selection.selected.length) {
|
|
4049
4447
|
return true;
|
|
4050
|
-
}
|
|
4051
|
-
if (((_a = action.enabled) === null || _a === void 0 ? void 0 : _a.call(action, this.selection.selected)) === false) {
|
|
4052
|
-
return true;
|
|
4053
|
-
}
|
|
4054
|
-
return false;
|
|
4055
|
-
}
|
|
4056
|
-
ngOnDestroy() {
|
|
4057
|
-
this.onDestroy.next(undefined);
|
|
4058
|
-
this.onDestroy.complete();
|
|
4059
|
-
}
|
|
4060
|
-
/**
|
|
4061
|
-
* Applies the search input to filter the table entries.
|
|
4062
|
-
*
|
|
4063
|
-
* @param event - The keyup-event which contains the search-string of the user.
|
|
4064
|
-
*/
|
|
4065
|
-
applyFilter(event) {
|
|
4066
|
-
const filterValue = event.target.value;
|
|
4067
|
-
this.dataSource.filter = filterValue.trim().toLowerCase();
|
|
4068
|
-
}
|
|
4069
|
-
}
|
|
4070
|
-
NgxMatEntityTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityTableComponent, deps: [{ token: i1.MatDialog }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
4071
|
-
NgxMatEntityTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: NgxMatEntityTableComponent, selector: "ngx-mat-entity-table", inputs: { tableData: "tableData" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, static: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "filter", first: true, predicate: ["filter"], descendants: true, static: true }], ngImport: i0, template: "<h1 class=\"title\">{{data.baseData.title}}</h1>\n\n<div class=\"row\">\n <mat-form-field class=\"col-lg-8 col-md-6 col-sm-12\">\n <mat-label>{{data.baseData.searchLabel}}</mat-label>\n <input matInput (keyup)=\"applyFilter($event)\">\n </mat-form-field>\n <div\n *ngIf=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-2]=\"data.baseData.allowCreate()\"\n [class.col-lg-4]=\"!data.baseData.allowCreate()\"\n [class.col-md-3]=\"data.baseData.allowCreate()\"\n [class.col-md-6]=\"!data.baseData.allowCreate()\"\n [class.col-sm-6]=\"data.baseData.allowCreate()\"\n [class.col-sm-12]=\"!data.baseData.allowCreate()\"\n >\n <button type=\"button\" class=\"actions-button\" [matMenuTriggerFor]=\"menu\" mat-raised-button>\n {{data.baseData.multiSelectLabel}}\n </button>\n </div>\n <mat-menu #menu=\"matMenu\">\n <button type=\"button\" *ngFor=\"let action of data.baseData.multiSelectActions\" [disabled]=\"multiActionDisabled(action)\" (click)=\"runMultiAction(action)\" mat-menu-item>\n {{action.displayName}}\n </button>\n </mat-menu>\n\n <div\n *ngIf=\"data.baseData.allowCreate()\"\n [class.col-lg-2]=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-4]=\"!data.baseData.multiSelectActions.length\"\n [class.col-md-3]=\"data.baseData.multiSelectActions.length\"\n [class.col-md-6]=\"!data.baseData.multiSelectActions.length\"\n [class.col-sm-6]=\"data.baseData.multiSelectActions.length\"\n [class.col-sm-12]=\"!data.baseData.multiSelectActions.length\"\n >\n <button type=\"button\" class=\"create-button\" (click)=\"createEntity()\" mat-raised-button>\n {{data.baseData.createButtonLabel}}\n </button>\n </div>\n</div>\n\n<div class=\"mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort>\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\" class=\"module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"> </mat-checkbox>\n </mat-cell>\n </ng-container>\n\n <ng-container *ngFor=\"let dCol of data.baseData.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" [class.enabled]=\"data.baseData.allowUpdate(entity) || data.baseData.allowRead(entity)\" (click)=\"editEntity(entity)\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <mat-paginator [length]=\"dataSource.filteredData.length\" [pageIndex]=\"0\" [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 50]\"> </mat-paginator>\n</div>\n", styles: [".title{text-align:center}button{width:100%}.mat-column-select{flex:0 0 75px}.enabled:hover{cursor:pointer}@media (max-width: 767px){.actions-button,.create-button{margin-bottom:15px}}\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.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i7.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i9.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i9.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i9.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }] });
|
|
4072
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityTableComponent, decorators: [{
|
|
4073
|
-
type: Component,
|
|
4074
|
-
args: [{ selector: 'ngx-mat-entity-table', template: "<h1 class=\"title\">{{data.baseData.title}}</h1>\n\n<div class=\"row\">\n <mat-form-field class=\"col-lg-8 col-md-6 col-sm-12\">\n <mat-label>{{data.baseData.searchLabel}}</mat-label>\n <input matInput (keyup)=\"applyFilter($event)\">\n </mat-form-field>\n <div\n *ngIf=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-2]=\"data.baseData.allowCreate()\"\n [class.col-lg-4]=\"!data.baseData.allowCreate()\"\n [class.col-md-3]=\"data.baseData.allowCreate()\"\n [class.col-md-6]=\"!data.baseData.allowCreate()\"\n [class.col-sm-6]=\"data.baseData.allowCreate()\"\n [class.col-sm-12]=\"!data.baseData.allowCreate()\"\n >\n <button type=\"button\" class=\"actions-button\" [matMenuTriggerFor]=\"menu\" mat-raised-button>\n {{data.baseData.multiSelectLabel}}\n </button>\n </div>\n <mat-menu #menu=\"matMenu\">\n <button type=\"button\" *ngFor=\"let action of data.baseData.multiSelectActions\" [disabled]=\"multiActionDisabled(action)\" (click)=\"runMultiAction(action)\" mat-menu-item>\n {{action.displayName}}\n </button>\n </mat-menu>\n\n <div\n *ngIf=\"data.baseData.allowCreate()\"\n [class.col-lg-2]=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-4]=\"!data.baseData.multiSelectActions.length\"\n [class.col-md-3]=\"data.baseData.multiSelectActions.length\"\n [class.col-md-6]=\"!data.baseData.multiSelectActions.length\"\n [class.col-sm-6]=\"data.baseData.multiSelectActions.length\"\n [class.col-sm-12]=\"!data.baseData.multiSelectActions.length\"\n >\n <button type=\"button\" class=\"create-button\" (click)=\"createEntity()\" mat-raised-button>\n {{data.baseData.createButtonLabel}}\n </button>\n </div>\n</div>\n\n<div class=\"mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort>\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\" class=\"module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"> </mat-checkbox>\n </mat-cell>\n </ng-container>\n\n <ng-container *ngFor=\"let dCol of data.baseData.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" [class.enabled]=\"data.baseData.allowUpdate(entity) || data.baseData.allowRead(entity)\" (click)=\"editEntity(entity)\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <mat-paginator [length]=\"dataSource.filteredData.length\" [pageIndex]=\"0\" [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 50]\"> </mat-paginator>\n</div>\n", styles: [".title{text-align:center}button{width:100%}.mat-column-select{flex:0 0 75px}.enabled:hover{cursor:pointer}@media (max-width: 767px){.actions-button,.create-button{margin-bottom:15px}}\n"] }]
|
|
4075
|
-
}], ctorParameters: function () { return [{ type: i1.MatDialog }, { type: i0.Injector }]; }, propDecorators: { tableData: [{
|
|
4076
|
-
type: Input
|
|
4077
|
-
}], paginator: [{
|
|
4078
|
-
type: ViewChild,
|
|
4079
|
-
args: [MatPaginator, { static: true }]
|
|
4080
|
-
}], sort: [{
|
|
4081
|
-
type: ViewChild,
|
|
4082
|
-
args: [MatSort, { static: true }]
|
|
4083
|
-
}], filter: [{
|
|
4084
|
-
type: ViewChild,
|
|
4085
|
-
args: ['filter', { static: true }]
|
|
4086
|
-
}] } });
|
|
4087
|
-
|
|
4088
|
-
class NgxMatEntityCreateDialogModule {
|
|
4089
|
-
}
|
|
4090
|
-
NgxMatEntityCreateDialogModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityCreateDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4091
|
-
NgxMatEntityCreateDialogModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityCreateDialogModule, declarations: [NgxMatEntityCreateDialogComponent], imports: [CommonModule,
|
|
4092
|
-
NgxMatEntityInputModule,
|
|
4093
|
-
MatDialogModule,
|
|
4094
|
-
FormsModule,
|
|
4095
|
-
MatButtonModule,
|
|
4096
|
-
MatTabsModule], exports: [NgxMatEntityCreateDialogComponent] });
|
|
4097
|
-
NgxMatEntityCreateDialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityCreateDialogModule, imports: [CommonModule,
|
|
4098
|
-
NgxMatEntityInputModule,
|
|
4099
|
-
MatDialogModule,
|
|
4100
|
-
FormsModule,
|
|
4101
|
-
MatButtonModule,
|
|
4102
|
-
MatTabsModule] });
|
|
4103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityCreateDialogModule, decorators: [{
|
|
4104
|
-
type: NgModule,
|
|
4105
|
-
args: [{
|
|
4106
|
-
declarations: [NgxMatEntityCreateDialogComponent],
|
|
4107
|
-
imports: [
|
|
4108
|
-
CommonModule,
|
|
4109
|
-
NgxMatEntityInputModule,
|
|
4110
|
-
MatDialogModule,
|
|
4111
|
-
FormsModule,
|
|
4112
|
-
MatButtonModule,
|
|
4113
|
-
MatTabsModule
|
|
4114
|
-
],
|
|
4115
|
-
exports: [NgxMatEntityCreateDialogComponent]
|
|
4116
|
-
}]
|
|
4117
|
-
}] });
|
|
4118
|
-
|
|
4119
|
-
class NgxMatEntityEditDialogModule {
|
|
4448
|
+
}
|
|
4449
|
+
if (((_a = action.enabled) === null || _a === void 0 ? void 0 : _a.call(action, this.selection.selected)) === false) {
|
|
4450
|
+
return true;
|
|
4451
|
+
}
|
|
4452
|
+
return false;
|
|
4453
|
+
}
|
|
4454
|
+
ngOnDestroy() {
|
|
4455
|
+
this.onDestroy.next(undefined);
|
|
4456
|
+
this.onDestroy.complete();
|
|
4457
|
+
}
|
|
4458
|
+
/**
|
|
4459
|
+
* Applies the search input to filter the table entries.
|
|
4460
|
+
*
|
|
4461
|
+
* @param event - The keyup-event which contains the search-string of the user.
|
|
4462
|
+
*/
|
|
4463
|
+
applyFilter(event) {
|
|
4464
|
+
const filterValue = event.target.value;
|
|
4465
|
+
this.dataSource.filter = filterValue.trim().toLowerCase();
|
|
4466
|
+
}
|
|
4120
4467
|
}
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
args: [{
|
|
4139
|
-
declarations: [NgxMatEntityEditDialogComponent],
|
|
4140
|
-
imports: [
|
|
4141
|
-
CommonModule,
|
|
4142
|
-
NgxMatEntityInputModule,
|
|
4143
|
-
MatDialogModule,
|
|
4144
|
-
FormsModule,
|
|
4145
|
-
MatButtonModule,
|
|
4146
|
-
MatTabsModule,
|
|
4147
|
-
NgxMatEntityConfirmDialogModule
|
|
4148
|
-
],
|
|
4149
|
-
exports: [NgxMatEntityEditDialogComponent]
|
|
4150
|
-
}]
|
|
4151
|
-
}] });
|
|
4468
|
+
NgxMatEntityTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityTableComponent, deps: [{ token: i1.MatDialog }, { token: i0.Injector }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
4469
|
+
NgxMatEntityTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.3", type: NgxMatEntityTableComponent, selector: "ngx-mat-entity-table", inputs: { tableData: "tableData" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true, static: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }, { propertyName: "filter", first: true, predicate: ["filter"], descendants: true, static: true }], ngImport: i0, template: "<h1 class=\"title\">{{data.baseData.title}}</h1>\n\n<div class=\"row\">\n <mat-form-field class=\"col-lg-8 col-md-6 col-sm-12\">\n <mat-label>{{data.baseData.searchLabel}}</mat-label>\n <input matInput (keyup)=\"applyFilter($event)\">\n </mat-form-field>\n <div\n *ngIf=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-2]=\"data.baseData.allowCreate()\"\n [class.col-lg-4]=\"!data.baseData.allowCreate()\"\n [class.col-md-3]=\"data.baseData.allowCreate()\"\n [class.col-md-6]=\"!data.baseData.allowCreate()\"\n [class.col-sm-6]=\"data.baseData.allowCreate()\"\n [class.col-sm-12]=\"!data.baseData.allowCreate()\"\n >\n <button type=\"button\" class=\"actions-button\" [matMenuTriggerFor]=\"menu\" mat-raised-button>\n {{data.baseData.multiSelectLabel}}\n </button>\n </div>\n <mat-menu #menu=\"matMenu\">\n <button *ngIf=\"data.baseData.allowJsonImport\" type=\"button\" [disabled]=\"importAction.enabled?.(this.selection.selected) === false\" (click)=\"runMultiAction(importAction)\" mat-menu-item>\n {{importAction.displayName}}\n </button>\n <button type=\"button\" *ngFor=\"let action of data.baseData.multiSelectActions\" [disabled]=\"multiActionDisabled(action)\" (click)=\"runMultiAction(action)\" mat-menu-item>\n {{action.displayName}}\n </button>\n </mat-menu>\n\n <div\n *ngIf=\"data.baseData.allowCreate()\"\n [class.col-lg-2]=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-4]=\"!data.baseData.multiSelectActions.length\"\n [class.col-md-3]=\"data.baseData.multiSelectActions.length\"\n [class.col-md-6]=\"!data.baseData.multiSelectActions.length\"\n [class.col-sm-6]=\"data.baseData.multiSelectActions.length\"\n [class.col-sm-12]=\"!data.baseData.multiSelectActions.length\"\n >\n <button type=\"button\" class=\"create-button\" (click)=\"createEntity()\" mat-raised-button>\n {{data.baseData.createButtonLabel}}\n </button>\n </div>\n</div>\n\n<div class=\"mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort>\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\" class=\"module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"> </mat-checkbox>\n </mat-cell>\n </ng-container>\n\n <ng-container *ngFor=\"let dCol of data.baseData.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" [class.enabled]=\"data.baseData.allowUpdate(entity) || data.baseData.allowRead(entity)\" (click)=\"editEntity(entity)\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <mat-spinner *ngIf=\"isLoading && data.baseData.displayLoadingSpinner\" style=\"margin-left: auto; margin-right: auto; margin-top: 10px; margin-bottom: 10px;\">\n </mat-spinner>\n\n <mat-paginator [length]=\"dataSource.filteredData.length\" [pageIndex]=\"0\" [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 50]\"></mat-paginator>\n</div>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}button{width:100%}.title{text-align:center}.actions-button,.create-button{height:56px;line-height:24px;font-size:16px}.mat-column-select{flex:0 0 75px}.enabled:hover{cursor:pointer}@media (max-width: 767px){.actions-button,.create-button{margin-bottom:15px}}\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.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i2$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$1.MatLabel, selector: "mat-label" }, { kind: "component", type: i4$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i5$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i5$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i5$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i5$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i5$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i5$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i5$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i5$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i5$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i8.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { kind: "component", type: i5.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i10.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i10.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i10.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i7.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] });
|
|
4470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityTableComponent, decorators: [{
|
|
4471
|
+
type: Component,
|
|
4472
|
+
args: [{ selector: 'ngx-mat-entity-table', template: "<h1 class=\"title\">{{data.baseData.title}}</h1>\n\n<div class=\"row\">\n <mat-form-field class=\"col-lg-8 col-md-6 col-sm-12\">\n <mat-label>{{data.baseData.searchLabel}}</mat-label>\n <input matInput (keyup)=\"applyFilter($event)\">\n </mat-form-field>\n <div\n *ngIf=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-2]=\"data.baseData.allowCreate()\"\n [class.col-lg-4]=\"!data.baseData.allowCreate()\"\n [class.col-md-3]=\"data.baseData.allowCreate()\"\n [class.col-md-6]=\"!data.baseData.allowCreate()\"\n [class.col-sm-6]=\"data.baseData.allowCreate()\"\n [class.col-sm-12]=\"!data.baseData.allowCreate()\"\n >\n <button type=\"button\" class=\"actions-button\" [matMenuTriggerFor]=\"menu\" mat-raised-button>\n {{data.baseData.multiSelectLabel}}\n </button>\n </div>\n <mat-menu #menu=\"matMenu\">\n <button *ngIf=\"data.baseData.allowJsonImport\" type=\"button\" [disabled]=\"importAction.enabled?.(this.selection.selected) === false\" (click)=\"runMultiAction(importAction)\" mat-menu-item>\n {{importAction.displayName}}\n </button>\n <button type=\"button\" *ngFor=\"let action of data.baseData.multiSelectActions\" [disabled]=\"multiActionDisabled(action)\" (click)=\"runMultiAction(action)\" mat-menu-item>\n {{action.displayName}}\n </button>\n </mat-menu>\n\n <div\n *ngIf=\"data.baseData.allowCreate()\"\n [class.col-lg-2]=\"data.baseData.multiSelectActions.length\"\n [class.col-lg-4]=\"!data.baseData.multiSelectActions.length\"\n [class.col-md-3]=\"data.baseData.multiSelectActions.length\"\n [class.col-md-6]=\"!data.baseData.multiSelectActions.length\"\n [class.col-sm-6]=\"data.baseData.multiSelectActions.length\"\n [class.col-sm-12]=\"!data.baseData.multiSelectActions.length\"\n >\n <button type=\"button\" class=\"create-button\" (click)=\"createEntity()\" mat-raised-button>\n {{data.baseData.createButtonLabel}}\n </button>\n </div>\n</div>\n\n<div class=\"mat-elevation-z8\">\n <mat-table [dataSource]=\"dataSource\" matSort>\n <!-- select Column -->\n <ng-container matColumnDef=\"select\">\n <mat-header-cell *matHeaderCellDef>\n <mat-checkbox (change)=\"$event ? SelectionUtilities.masterToggle(selection, dataSource) : null\" [checked]=\"selection.hasValue() && SelectionUtilities.isAllSelected(selection, dataSource)\" [indeterminate]=\"selection.hasValue() && !SelectionUtilities.isAllSelected(selection, dataSource)\"> </mat-checkbox>\n </mat-header-cell>\n <mat-cell *matCellDef=\"let module\" class=\"module\">\n <mat-checkbox (click)=\"$event.stopPropagation()\" (change)=\"$event ? selection.toggle(module) : null\" [checked]=\"selection.isSelected(module)\"> </mat-checkbox>\n </mat-cell>\n </ng-container>\n\n <ng-container *ngFor=\"let dCol of data.baseData.displayColumns\" [matColumnDef]=\"dCol.displayName\">\n <mat-header-cell *matHeaderCellDef mat-sort-header>\n {{dCol.displayName}}\n </mat-header-cell>\n <mat-cell class=\"entity\" [class.enabled]=\"data.baseData.allowUpdate(entity) || data.baseData.allowRead(entity)\" (click)=\"editEntity(entity)\" *matCellDef=\"let entity\">\n {{dCol.value(entity)}}\n </mat-cell>\n </ng-container>\n\n <mat-header-row *matHeaderRowDef=\"displayedColumns\"></mat-header-row>\n <mat-row *matRowDef=\"let row; columns: displayedColumns\"></mat-row>\n </mat-table>\n\n <mat-spinner *ngIf=\"isLoading && data.baseData.displayLoadingSpinner\" style=\"margin-left: auto; margin-right: auto; margin-top: 10px; margin-bottom: 10px;\">\n </mat-spinner>\n\n <mat-paginator [length]=\"dataSource.filteredData.length\" [pageIndex]=\"0\" [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 50]\"></mat-paginator>\n</div>", styles: [".mdc-data-table__row:last-child .mdc-data-table__cell{border-bottom:1px solid rgba(0,0,0,.12)}button{width:100%}.title{text-align:center}.actions-button,.create-button{height:56px;line-height:24px;font-size:16px}.mat-column-select{flex:0 0 75px}.enabled:hover{cursor:pointer}@media (max-width: 767px){.actions-button,.create-button{margin-bottom:15px}}\n"] }]
|
|
4473
|
+
}], ctorParameters: function () { return [{ type: i1.MatDialog }, { type: i0.Injector }, { type: i3$1.Router }]; }, propDecorators: { tableData: [{
|
|
4474
|
+
type: Input
|
|
4475
|
+
}], paginator: [{
|
|
4476
|
+
type: ViewChild,
|
|
4477
|
+
args: [MatPaginator, { static: true }]
|
|
4478
|
+
}], sort: [{
|
|
4479
|
+
type: ViewChild,
|
|
4480
|
+
args: [MatSort, { static: true }]
|
|
4481
|
+
}], filter: [{
|
|
4482
|
+
type: ViewChild,
|
|
4483
|
+
args: ['filter', { static: true }]
|
|
4484
|
+
}] } });
|
|
4152
4485
|
|
|
4153
4486
|
class NgxMatEntityTableModule {
|
|
4154
4487
|
}
|
|
@@ -4163,6 +4496,7 @@ NgxMatEntityTableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
|
|
|
4163
4496
|
MatButtonModule,
|
|
4164
4497
|
MatMenuModule,
|
|
4165
4498
|
MatDialogModule,
|
|
4499
|
+
MatProgressSpinnerModule,
|
|
4166
4500
|
NgxMatEntityCreateDialogModule,
|
|
4167
4501
|
NgxMatEntityEditDialogModule], exports: [NgxMatEntityTableComponent] });
|
|
4168
4502
|
NgxMatEntityTableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityTableModule, imports: [CommonModule,
|
|
@@ -4175,6 +4509,7 @@ NgxMatEntityTableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
|
|
|
4175
4509
|
MatButtonModule,
|
|
4176
4510
|
MatMenuModule,
|
|
4177
4511
|
MatDialogModule,
|
|
4512
|
+
MatProgressSpinnerModule,
|
|
4178
4513
|
NgxMatEntityCreateDialogModule,
|
|
4179
4514
|
NgxMatEntityEditDialogModule] });
|
|
4180
4515
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NgxMatEntityTableModule, decorators: [{
|
|
@@ -4192,6 +4527,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
|
|
|
4192
4527
|
MatButtonModule,
|
|
4193
4528
|
MatMenuModule,
|
|
4194
4529
|
MatDialogModule,
|
|
4530
|
+
MatProgressSpinnerModule,
|
|
4195
4531
|
NgxMatEntityCreateDialogModule,
|
|
4196
4532
|
NgxMatEntityEditDialogModule
|
|
4197
4533
|
],
|
|
@@ -4199,6 +4535,96 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
|
|
|
4199
4535
|
}]
|
|
4200
4536
|
}] });
|
|
4201
4537
|
|
|
4538
|
+
/**
|
|
4539
|
+
* Encapsulates functionality of the js2xml package.
|
|
4540
|
+
*/
|
|
4541
|
+
class Js2XmlUtilities {
|
|
4542
|
+
/**
|
|
4543
|
+
* Returns a XML string representation of the specified object using the specified options.
|
|
4544
|
+
*
|
|
4545
|
+
* @param root - Name of the xml root element.
|
|
4546
|
+
* @param value - The json value to convert. Will be a child of root.
|
|
4547
|
+
* @param options - Additional options for the conversion.
|
|
4548
|
+
* @returns The converted xml string.
|
|
4549
|
+
*/
|
|
4550
|
+
static parse(root, value, options) {
|
|
4551
|
+
return js2xml.parse(root, value, options);
|
|
4552
|
+
}
|
|
4553
|
+
}
|
|
4554
|
+
|
|
4555
|
+
const CSV_SEPARATOR = ';';
|
|
4556
|
+
/**
|
|
4557
|
+
* A multi select action that exports the data as a json file.
|
|
4558
|
+
*
|
|
4559
|
+
* @param selectedEntities - The selected entities to export.
|
|
4560
|
+
*/
|
|
4561
|
+
function exportAsJsonMultiAction(selectedEntities) {
|
|
4562
|
+
const blob = new Blob([JSON.stringify(selectedEntities, null, '\t')], { type: '.json' });
|
|
4563
|
+
FileUtilities.downLoadBlob(blob, 'export.json');
|
|
4564
|
+
}
|
|
4565
|
+
/**
|
|
4566
|
+
* A multi select action that exports the data as a csv file.
|
|
4567
|
+
* Object values get stringified.
|
|
4568
|
+
*
|
|
4569
|
+
* @param selectedEntities - The selected entities to export.
|
|
4570
|
+
*/
|
|
4571
|
+
function exportAsCsvMultiAction(selectedEntities) {
|
|
4572
|
+
const blob = new Blob([convertToCsv(selectedEntities, ReflectUtilities.ownKeys(selectedEntities[0]))], { type: '.csv' });
|
|
4573
|
+
FileUtilities.downLoadBlob(blob, 'export.csv');
|
|
4574
|
+
}
|
|
4575
|
+
/**
|
|
4576
|
+
* A multi select action that exports the data as a xml file.
|
|
4577
|
+
* Object values get stringified.
|
|
4578
|
+
*
|
|
4579
|
+
* @param selectedEntities - The selected entities to export.
|
|
4580
|
+
*/
|
|
4581
|
+
function exportAsXmlMultiAction(selectedEntities) {
|
|
4582
|
+
const xmlString = Js2XmlUtilities.parse('values', selectedEntities);
|
|
4583
|
+
const blob = new Blob([xmlString], { type: '.xml' });
|
|
4584
|
+
FileUtilities.downLoadBlob(blob, 'export.xml');
|
|
4585
|
+
}
|
|
4586
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
4587
|
+
function convertToCsv(array, headerList) {
|
|
4588
|
+
const headerRow = headerList.join(CSV_SEPARATOR);
|
|
4589
|
+
let result = headerRow + '\r\n';
|
|
4590
|
+
for (const entity of array) {
|
|
4591
|
+
result += getLineForEntity(headerList, entity) + '\r\n';
|
|
4592
|
+
}
|
|
4593
|
+
return result;
|
|
4594
|
+
}
|
|
4595
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
4596
|
+
function getLineForEntity(headerList, entity) {
|
|
4597
|
+
let line = '';
|
|
4598
|
+
for (const head of headerList) {
|
|
4599
|
+
line = line += getLineForHeader(entity, head);
|
|
4600
|
+
}
|
|
4601
|
+
line.slice(0, line.length - 1);
|
|
4602
|
+
return line;
|
|
4603
|
+
}
|
|
4604
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
4605
|
+
function getLineForHeader(entity, head) {
|
|
4606
|
+
const value = entity[head];
|
|
4607
|
+
if (LodashUtilities.isObject(value)) {
|
|
4608
|
+
return `${JSON.stringify(value)}${CSV_SEPARATOR}`;
|
|
4609
|
+
}
|
|
4610
|
+
if (LodashUtilities.isArray(value) && LodashUtilities.isObject(value[0])) {
|
|
4611
|
+
return `${value.map(v => JSON.stringify(v))}${CSV_SEPARATOR}`;
|
|
4612
|
+
}
|
|
4613
|
+
return `${entity[head]}${CSV_SEPARATOR}`;
|
|
4614
|
+
}
|
|
4615
|
+
|
|
4616
|
+
/**
|
|
4617
|
+
* The base options for all propertyDecorators.
|
|
4618
|
+
*/
|
|
4619
|
+
class PropertyDecoratorConfig {
|
|
4620
|
+
}
|
|
4621
|
+
|
|
4622
|
+
/**
|
|
4623
|
+
* Interface definition for the @array metadata.
|
|
4624
|
+
*/
|
|
4625
|
+
class ArrayDecoratorConfig extends PropertyDecoratorConfig {
|
|
4626
|
+
}
|
|
4627
|
+
|
|
4202
4628
|
/**
|
|
4203
4629
|
* The internal EntityArrayDecoratorConfig. Sets default values.
|
|
4204
4630
|
*/
|
|
@@ -4370,15 +4796,9 @@ function array(metadata) {
|
|
|
4370
4796
|
}
|
|
4371
4797
|
|
|
4372
4798
|
/**
|
|
4373
|
-
* The
|
|
4374
|
-
*/
|
|
4375
|
-
class PropertyDecoratorConfig {
|
|
4376
|
-
}
|
|
4377
|
-
|
|
4378
|
-
/**
|
|
4379
|
-
* Interface definition for the @array metadata.
|
|
4799
|
+
* The Definition for the @boolean metadata.
|
|
4380
4800
|
*/
|
|
4381
|
-
class
|
|
4801
|
+
class BooleanDecoratorConfig extends PropertyDecoratorConfig {
|
|
4382
4802
|
}
|
|
4383
4803
|
|
|
4384
4804
|
/**
|
|
@@ -4435,223 +4855,117 @@ function boolean(metadata) {
|
|
|
4435
4855
|
}
|
|
4436
4856
|
|
|
4437
4857
|
/**
|
|
4438
|
-
* The
|
|
4439
|
-
*/
|
|
4440
|
-
class BooleanDecoratorConfig extends PropertyDecoratorConfig {
|
|
4441
|
-
}
|
|
4442
|
-
|
|
4443
|
-
/**
|
|
4444
|
-
* The internal DefaultDateDecoratorConfig. Sets default values.
|
|
4445
|
-
*/
|
|
4446
|
-
class DefaultDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4447
|
-
constructor(data) {
|
|
4448
|
-
super(data);
|
|
4449
|
-
this.displayStyle = data.displayStyle;
|
|
4450
|
-
this.max = data.max;
|
|
4451
|
-
this.min = data.min;
|
|
4452
|
-
this.filter = data.filter;
|
|
4453
|
-
}
|
|
4454
|
-
}
|
|
4455
|
-
/**
|
|
4456
|
-
* The internal DateRangeDateDecoratorConfig. Sets default values.
|
|
4457
|
-
*/
|
|
4458
|
-
class DateRangeDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4459
|
-
constructor(data) {
|
|
4460
|
-
var _a, _b;
|
|
4461
|
-
super(data);
|
|
4462
|
-
this.displayStyle = data.displayStyle;
|
|
4463
|
-
this.minStart = data.minStart;
|
|
4464
|
-
this.maxStart = data.maxStart;
|
|
4465
|
-
this.minEnd = data.minEnd;
|
|
4466
|
-
this.maxEnd = data.maxEnd;
|
|
4467
|
-
this.filter = data.filter;
|
|
4468
|
-
this.placeholderStart = (_a = data.placeholderStart) !== null && _a !== void 0 ? _a : 'Start';
|
|
4469
|
-
this.placeholderEnd = (_b = data.placeholderEnd) !== null && _b !== void 0 ? _b : 'End';
|
|
4470
|
-
}
|
|
4471
|
-
}
|
|
4472
|
-
/**
|
|
4473
|
-
* The internal DateTimeDateDecoratorConfig. Sets default values.
|
|
4474
|
-
*/
|
|
4475
|
-
class DateTimeDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4476
|
-
constructor(data) {
|
|
4477
|
-
var _a, _b;
|
|
4478
|
-
super(data);
|
|
4479
|
-
this.displayStyle = data.displayStyle;
|
|
4480
|
-
this.times = (_a = data.times) !== null && _a !== void 0 ? _a : DateUtilities.getDefaultTimes();
|
|
4481
|
-
this.timeDisplayName = (_b = data.timeDisplayName) !== null && _b !== void 0 ? _b : 'Time';
|
|
4482
|
-
this.minDate = data.minDate;
|
|
4483
|
-
this.maxDate = data.maxDate;
|
|
4484
|
-
this.filterDate = data.filterDate;
|
|
4485
|
-
this.minTime = data.minTime;
|
|
4486
|
-
this.maxTime = data.maxTime;
|
|
4487
|
-
this.filterTime = data.filterTime;
|
|
4488
|
-
}
|
|
4489
|
-
}
|
|
4490
|
-
|
|
4491
|
-
/**
|
|
4492
|
-
* Decorator for setting and getting date property metadata.
|
|
4493
|
-
*
|
|
4494
|
-
* @param metadata - The metadata of the date property.
|
|
4495
|
-
* @returns The method that defines the metadata.
|
|
4496
|
-
*/
|
|
4497
|
-
function date(metadata) {
|
|
4498
|
-
if (metadata.displayStyle === 'date') {
|
|
4499
|
-
return baseProperty(new DefaultDateDecoratorConfigInternal(metadata), DecoratorTypes.DATE);
|
|
4500
|
-
}
|
|
4501
|
-
else if (metadata.displayStyle === 'datetime') {
|
|
4502
|
-
return baseProperty(new DateTimeDateDecoratorConfigInternal(metadata), DecoratorTypes.DATE_TIME, [EntityUtilities.TIME_KEY]);
|
|
4503
|
-
}
|
|
4504
|
-
else {
|
|
4505
|
-
return baseProperty(new DateRangeDateDecoratorConfigInternal(metadata), DecoratorTypes.DATE_RANGE, [EntityUtilities.DATE_RANGE_END_KEY, EntityUtilities.DATE_RANGE_KEY, EntityUtilities.DATE_RANGE_START_KEY]);
|
|
4506
|
-
}
|
|
4507
|
-
}
|
|
4508
|
-
|
|
4509
|
-
/**
|
|
4510
|
-
* Definition for the @date metadata.
|
|
4511
|
-
*/
|
|
4512
|
-
class DateDecoratorConfig extends PropertyDecoratorConfig {
|
|
4513
|
-
}
|
|
4514
|
-
|
|
4515
|
-
/**
|
|
4516
|
-
* The internal DefaultNumberDecoratorConfig. Sets default values.
|
|
4517
|
-
*/
|
|
4518
|
-
class DefaultNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4519
|
-
constructor(data) {
|
|
4520
|
-
super(data);
|
|
4521
|
-
this.displayStyle = data.displayStyle;
|
|
4522
|
-
this.max = data.max;
|
|
4523
|
-
this.min = data.min;
|
|
4524
|
-
}
|
|
4525
|
-
}
|
|
4526
|
-
/**
|
|
4527
|
-
* The internal DropdownNumberDecoratorConfig. Sets default values.
|
|
4528
|
-
*/
|
|
4529
|
-
class DropdownNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4530
|
-
constructor(data) {
|
|
4531
|
-
super(data);
|
|
4532
|
-
this.displayStyle = data.displayStyle;
|
|
4533
|
-
this.dropdownValues = data.dropdownValues;
|
|
4534
|
-
}
|
|
4535
|
-
}
|
|
4536
|
-
/**
|
|
4537
|
-
* The internal SliderNumberDecoratorConfig. Sets default values.
|
|
4538
|
-
*/
|
|
4539
|
-
class SliderNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4540
|
-
constructor(data) {
|
|
4541
|
-
var _a;
|
|
4542
|
-
super(data);
|
|
4543
|
-
this.displayStyle = data.displayStyle;
|
|
4544
|
-
this.max = data.max;
|
|
4545
|
-
this.min = data.min;
|
|
4546
|
-
this.step = data.step;
|
|
4547
|
-
this.formatThumbLabelValue = (_a = data.formatThumbLabelValue) !== null && _a !== void 0 ? _a : defaultFormatThumbLabelValue;
|
|
4548
|
-
this.showTickMarks = data.showTickMarks;
|
|
4549
|
-
}
|
|
4550
|
-
}
|
|
4551
|
-
/**
|
|
4552
|
-
* The default function to format values for the number slider thumb label.
|
|
4553
|
-
*
|
|
4554
|
-
* @param value - The value of the slider.
|
|
4555
|
-
* @returns Just the value without any formatting done.
|
|
4556
|
-
*/
|
|
4557
|
-
function defaultFormatThumbLabelValue(value) {
|
|
4558
|
-
return value.toString();
|
|
4559
|
-
}
|
|
4560
|
-
|
|
4561
|
-
/**
|
|
4562
|
-
* Decorator for setting and getting number property metadata.
|
|
4858
|
+
* The default function to use for checking if the value is dirty.
|
|
4563
4859
|
*
|
|
4564
|
-
* @param
|
|
4565
|
-
* @
|
|
4566
|
-
|
|
4567
|
-
function number(metadata) {
|
|
4568
|
-
switch (metadata.displayStyle) {
|
|
4569
|
-
case 'dropdown':
|
|
4570
|
-
return baseProperty(new DropdownNumberDecoratorConfigInternal(metadata), DecoratorTypes.NUMBER_DROPDOWN);
|
|
4571
|
-
case 'slider':
|
|
4572
|
-
return baseProperty(new SliderNumberDecoratorConfigInternal(metadata), DecoratorTypes.NUMBER_SLIDER);
|
|
4573
|
-
default:
|
|
4574
|
-
return baseProperty(new DefaultNumberDecoratorConfigInternal(metadata), DecoratorTypes.NUMBER);
|
|
4575
|
-
}
|
|
4576
|
-
}
|
|
4577
|
-
|
|
4578
|
-
/**
|
|
4579
|
-
* Definition for the @number metadata.
|
|
4860
|
+
* @param value - The current value.
|
|
4861
|
+
* @param valuePriorChanges - The value before any changes.
|
|
4862
|
+
* @returns Whether or not the provided value has been changed.
|
|
4580
4863
|
*/
|
|
4581
|
-
|
|
4864
|
+
function defaultIsEqual(value, valuePriorChanges) {
|
|
4865
|
+
return LodashUtilities.isEqual(value, valuePriorChanges);
|
|
4582
4866
|
}
|
|
4583
|
-
|
|
4584
4867
|
/**
|
|
4585
|
-
* The internal
|
|
4868
|
+
* The internal config for the @custom decorator.
|
|
4869
|
+
* Sets default values.
|
|
4586
4870
|
*/
|
|
4587
|
-
class
|
|
4871
|
+
class CustomDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4588
4872
|
constructor(data) {
|
|
4873
|
+
var _a, _b;
|
|
4589
4874
|
super(data);
|
|
4590
|
-
this.
|
|
4591
|
-
this.
|
|
4875
|
+
this.component = data.component;
|
|
4876
|
+
this.isValid = (_a = data.isValid) !== null && _a !== void 0 ? _a : (() => true);
|
|
4877
|
+
this.isEqual = (_b = data.isEqual) !== null && _b !== void 0 ? _b : defaultIsEqual;
|
|
4878
|
+
this.customMetadata = data.customMetadata;
|
|
4592
4879
|
}
|
|
4593
4880
|
}
|
|
4594
4881
|
|
|
4595
4882
|
/**
|
|
4596
|
-
* Decorator for setting and getting
|
|
4883
|
+
* Decorator for setting and getting custom property metadata.
|
|
4597
4884
|
*
|
|
4598
|
-
* @param metadata - The metadata of the
|
|
4885
|
+
* @param metadata - The metadata of the custom property.
|
|
4886
|
+
* @param metadataKeysToReset - Any metadata keys which values should be set to undefined on reset.
|
|
4599
4887
|
* @returns The method that defines the metadata.
|
|
4600
4888
|
*/
|
|
4601
|
-
function
|
|
4602
|
-
return baseProperty(new
|
|
4889
|
+
function custom(metadata, metadataKeysToReset) {
|
|
4890
|
+
return baseProperty(new CustomDecoratorConfigInternal(metadata), DecoratorTypes.CUSTOM, metadataKeysToReset);
|
|
4603
4891
|
}
|
|
4604
4892
|
|
|
4605
4893
|
/**
|
|
4606
|
-
* Definition for the @
|
|
4894
|
+
* Definition for the @date metadata.
|
|
4607
4895
|
*/
|
|
4608
|
-
class
|
|
4896
|
+
class DateDecoratorConfig extends PropertyDecoratorConfig {
|
|
4609
4897
|
}
|
|
4610
4898
|
|
|
4611
4899
|
/**
|
|
4612
|
-
*
|
|
4900
|
+
* The internal DefaultDateDecoratorConfig. Sets default values.
|
|
4613
4901
|
*/
|
|
4614
|
-
class
|
|
4902
|
+
class DefaultDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4903
|
+
constructor(data) {
|
|
4904
|
+
super(data);
|
|
4905
|
+
this.displayStyle = data.displayStyle;
|
|
4906
|
+
this.max = data.max;
|
|
4907
|
+
this.min = data.min;
|
|
4908
|
+
this.filter = data.filter;
|
|
4909
|
+
}
|
|
4615
4910
|
}
|
|
4616
|
-
|
|
4617
4911
|
/**
|
|
4618
|
-
* The internal
|
|
4912
|
+
* The internal DateRangeDateDecoratorConfig. Sets default values.
|
|
4619
4913
|
*/
|
|
4620
|
-
class
|
|
4914
|
+
class DateRangeDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4621
4915
|
constructor(data) {
|
|
4622
|
-
var _a, _b
|
|
4916
|
+
var _a, _b;
|
|
4623
4917
|
super(data);
|
|
4624
|
-
this.
|
|
4625
|
-
this.
|
|
4626
|
-
this.
|
|
4627
|
-
this.
|
|
4628
|
-
this.
|
|
4629
|
-
this.
|
|
4630
|
-
this.
|
|
4631
|
-
this.
|
|
4632
|
-
this.addAll = (_f = data.addAll) !== null && _f !== void 0 ? _f : false;
|
|
4633
|
-
this.addAllButtonLabel = (_g = data.addAllButtonLabel) !== null && _g !== void 0 ? _g : 'Add all';
|
|
4918
|
+
this.displayStyle = data.displayStyle;
|
|
4919
|
+
this.minStart = data.minStart;
|
|
4920
|
+
this.maxStart = data.maxStart;
|
|
4921
|
+
this.minEnd = data.minEnd;
|
|
4922
|
+
this.maxEnd = data.maxEnd;
|
|
4923
|
+
this.filter = data.filter;
|
|
4924
|
+
this.placeholderStart = (_a = data.placeholderStart) !== null && _a !== void 0 ? _a : 'Start';
|
|
4925
|
+
this.placeholderEnd = (_b = data.placeholderEnd) !== null && _b !== void 0 ? _b : 'End';
|
|
4634
4926
|
}
|
|
4635
4927
|
}
|
|
4636
4928
|
/**
|
|
4637
|
-
* The
|
|
4638
|
-
*
|
|
4639
|
-
* @param entityId - The id of the referenced entity.
|
|
4640
|
-
* @param allReferencedEntities - All referenced entities.
|
|
4641
|
-
* @returns The entity that has the given id.
|
|
4929
|
+
* The internal DateTimeDateDecoratorConfig. Sets default values.
|
|
4642
4930
|
*/
|
|
4643
|
-
|
|
4644
|
-
|
|
4931
|
+
class DateTimeDateDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4932
|
+
constructor(data) {
|
|
4933
|
+
var _a, _b;
|
|
4934
|
+
super(data);
|
|
4935
|
+
this.displayStyle = data.displayStyle;
|
|
4936
|
+
this.times = (_a = data.times) !== null && _a !== void 0 ? _a : DateUtilities.getDefaultTimes();
|
|
4937
|
+
this.timeDisplayName = (_b = data.timeDisplayName) !== null && _b !== void 0 ? _b : 'Time';
|
|
4938
|
+
this.minDate = data.minDate;
|
|
4939
|
+
this.maxDate = data.maxDate;
|
|
4940
|
+
this.filterDate = data.filterDate;
|
|
4941
|
+
this.minTime = data.minTime;
|
|
4942
|
+
this.maxTime = data.maxTime;
|
|
4943
|
+
this.filterTime = data.filterTime;
|
|
4944
|
+
}
|
|
4645
4945
|
}
|
|
4646
4946
|
|
|
4647
4947
|
/**
|
|
4648
|
-
* Decorator for setting and getting
|
|
4948
|
+
* Decorator for setting and getting date property metadata.
|
|
4649
4949
|
*
|
|
4650
|
-
* @param metadata - The metadata of the
|
|
4950
|
+
* @param metadata - The metadata of the date property.
|
|
4651
4951
|
* @returns The method that defines the metadata.
|
|
4652
4952
|
*/
|
|
4653
|
-
function
|
|
4654
|
-
|
|
4953
|
+
function date(metadata) {
|
|
4954
|
+
if (metadata.displayStyle === 'date') {
|
|
4955
|
+
return baseProperty(new DefaultDateDecoratorConfigInternal(metadata), DecoratorTypes.DATE);
|
|
4956
|
+
}
|
|
4957
|
+
else if (metadata.displayStyle === 'datetime') {
|
|
4958
|
+
return baseProperty(new DateTimeDateDecoratorConfigInternal(metadata), DecoratorTypes.DATE_TIME, [EntityUtilities.TIME_KEY]);
|
|
4959
|
+
}
|
|
4960
|
+
else {
|
|
4961
|
+
return baseProperty(new DateRangeDateDecoratorConfigInternal(metadata), DecoratorTypes.DATE_RANGE, [EntityUtilities.DATE_RANGE_END_KEY, EntityUtilities.DATE_RANGE_KEY, EntityUtilities.DATE_RANGE_START_KEY]);
|
|
4962
|
+
}
|
|
4963
|
+
}
|
|
4964
|
+
|
|
4965
|
+
/**
|
|
4966
|
+
* Definition for the @file metadata.
|
|
4967
|
+
*/
|
|
4968
|
+
class FileDecoratorConfig extends PropertyDecoratorConfig {
|
|
4655
4969
|
}
|
|
4656
4970
|
|
|
4657
4971
|
/**
|
|
@@ -4775,45 +5089,158 @@ function file(metadata) {
|
|
|
4775
5089
|
}
|
|
4776
5090
|
|
|
4777
5091
|
/**
|
|
4778
|
-
* Definition for the @
|
|
5092
|
+
* Definition for the @number metadata.
|
|
4779
5093
|
*/
|
|
4780
|
-
class
|
|
5094
|
+
class NumberDecoratorConfig extends PropertyDecoratorConfig {
|
|
4781
5095
|
}
|
|
4782
5096
|
|
|
4783
5097
|
/**
|
|
4784
|
-
* The
|
|
5098
|
+
* The internal DefaultNumberDecoratorConfig. Sets default values.
|
|
5099
|
+
*/
|
|
5100
|
+
class DefaultNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
5101
|
+
constructor(data) {
|
|
5102
|
+
super(data);
|
|
5103
|
+
this.displayStyle = data.displayStyle;
|
|
5104
|
+
this.max = data.max;
|
|
5105
|
+
this.min = data.min;
|
|
5106
|
+
}
|
|
5107
|
+
}
|
|
5108
|
+
/**
|
|
5109
|
+
* The internal DropdownNumberDecoratorConfig. Sets default values.
|
|
5110
|
+
*/
|
|
5111
|
+
class DropdownNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
5112
|
+
constructor(data) {
|
|
5113
|
+
super(data);
|
|
5114
|
+
this.displayStyle = data.displayStyle;
|
|
5115
|
+
this.dropdownValues = data.dropdownValues;
|
|
5116
|
+
}
|
|
5117
|
+
}
|
|
5118
|
+
/**
|
|
5119
|
+
* The internal SliderNumberDecoratorConfig. Sets default values.
|
|
5120
|
+
*/
|
|
5121
|
+
class SliderNumberDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
5122
|
+
constructor(data) {
|
|
5123
|
+
var _a;
|
|
5124
|
+
super(data);
|
|
5125
|
+
this.displayStyle = data.displayStyle;
|
|
5126
|
+
this.max = data.max;
|
|
5127
|
+
this.min = data.min;
|
|
5128
|
+
this.step = data.step;
|
|
5129
|
+
this.formatThumbLabelValue = (_a = data.formatThumbLabelValue) !== null && _a !== void 0 ? _a : defaultFormatThumbLabelValue;
|
|
5130
|
+
this.showTickMarks = data.showTickMarks;
|
|
5131
|
+
}
|
|
5132
|
+
}
|
|
5133
|
+
/**
|
|
5134
|
+
* The default function to format values for the number slider thumb label.
|
|
4785
5135
|
*
|
|
4786
|
-
* @param value - The
|
|
4787
|
-
* @
|
|
4788
|
-
* @returns Whether or not the provided value has been changed.
|
|
5136
|
+
* @param value - The value of the slider.
|
|
5137
|
+
* @returns Just the value without any formatting done.
|
|
4789
5138
|
*/
|
|
4790
|
-
function
|
|
4791
|
-
return
|
|
5139
|
+
function defaultFormatThumbLabelValue(value) {
|
|
5140
|
+
return value.toString();
|
|
4792
5141
|
}
|
|
5142
|
+
|
|
4793
5143
|
/**
|
|
4794
|
-
*
|
|
4795
|
-
*
|
|
5144
|
+
* Decorator for setting and getting number property metadata.
|
|
5145
|
+
*
|
|
5146
|
+
* @param metadata - The metadata of the number property.
|
|
5147
|
+
* @returns The method that defines the metadata.
|
|
4796
5148
|
*/
|
|
4797
|
-
|
|
5149
|
+
function number(metadata) {
|
|
5150
|
+
switch (metadata.displayStyle) {
|
|
5151
|
+
case 'dropdown':
|
|
5152
|
+
return baseProperty(new DropdownNumberDecoratorConfigInternal(metadata), DecoratorTypes.NUMBER_DROPDOWN);
|
|
5153
|
+
case 'slider':
|
|
5154
|
+
return baseProperty(new SliderNumberDecoratorConfigInternal(metadata), DecoratorTypes.NUMBER_SLIDER);
|
|
5155
|
+
default:
|
|
5156
|
+
return baseProperty(new DefaultNumberDecoratorConfigInternal(metadata), DecoratorTypes.NUMBER);
|
|
5157
|
+
}
|
|
5158
|
+
}
|
|
5159
|
+
|
|
5160
|
+
/**
|
|
5161
|
+
* Definition for the @object metadata.
|
|
5162
|
+
*/
|
|
5163
|
+
class ObjectDecoratorConfig extends PropertyDecoratorConfig {
|
|
5164
|
+
}
|
|
5165
|
+
|
|
5166
|
+
/**
|
|
5167
|
+
* The internal DefaultObjectDecoratorConfig. Sets default values.
|
|
5168
|
+
*/
|
|
5169
|
+
class DefaultObjectDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
4798
5170
|
constructor(data) {
|
|
4799
|
-
var _a, _b;
|
|
4800
5171
|
super(data);
|
|
4801
|
-
this.
|
|
4802
|
-
this.
|
|
4803
|
-
this.isEqual = (_b = data.isEqual) !== null && _b !== void 0 ? _b : defaultIsEqual;
|
|
4804
|
-
this.customMetadata = data.customMetadata;
|
|
5172
|
+
this.displayStyle = data.displayStyle;
|
|
5173
|
+
this.EntityClass = data.EntityClass;
|
|
4805
5174
|
}
|
|
4806
5175
|
}
|
|
4807
5176
|
|
|
4808
5177
|
/**
|
|
4809
|
-
* Decorator for setting and getting
|
|
5178
|
+
* Decorator for setting and getting object property metadata.
|
|
4810
5179
|
*
|
|
4811
|
-
* @param metadata - The metadata of the
|
|
4812
|
-
* @param metadataKeysToReset - Any metadata keys which values should be set to undefined on reset.
|
|
5180
|
+
* @param metadata - The metadata of the object property.
|
|
4813
5181
|
* @returns The method that defines the metadata.
|
|
4814
5182
|
*/
|
|
4815
|
-
function
|
|
4816
|
-
return baseProperty(new
|
|
5183
|
+
function object(metadata) {
|
|
5184
|
+
return baseProperty(new DefaultObjectDecoratorConfigInternal(metadata), DecoratorTypes.OBJECT);
|
|
5185
|
+
}
|
|
5186
|
+
|
|
5187
|
+
/**
|
|
5188
|
+
* The internal DefaultNumberDecoratorConfig. Sets default values.
|
|
5189
|
+
*/
|
|
5190
|
+
class ReferencesManyDecoratorConfigInternal extends PropertyDecoratorConfigInternal {
|
|
5191
|
+
constructor(data) {
|
|
5192
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
5193
|
+
super(data);
|
|
5194
|
+
this.getReferencedEntities = data.getReferencedEntities;
|
|
5195
|
+
this.getDropdownValues = data.getDropdownValues;
|
|
5196
|
+
this.getEntityForId = (_a = data.getEntityForId) !== null && _a !== void 0 ? _a : defaultGetEntityForId;
|
|
5197
|
+
this.displayColumns = data.displayColumns;
|
|
5198
|
+
this.addButtonLabel = (_b = data.addButtonLabel) !== null && _b !== void 0 ? _b : 'Add';
|
|
5199
|
+
this.removeButtonLabel = (_c = data.removeButtonLabel) !== null && _c !== void 0 ? _c : 'Remove';
|
|
5200
|
+
this.defaultWidths = (_d = data.defaultWidths) !== null && _d !== void 0 ? _d : [12, 12, 12];
|
|
5201
|
+
this.dropdownLabel = (_e = data.dropdownLabel) !== null && _e !== void 0 ? _e : 'Select';
|
|
5202
|
+
this.addAll = (_f = data.addAll) !== null && _f !== void 0 ? _f : false;
|
|
5203
|
+
this.addAllButtonLabel = (_g = data.addAllButtonLabel) !== null && _g !== void 0 ? _g : 'Add all';
|
|
5204
|
+
}
|
|
5205
|
+
}
|
|
5206
|
+
/**
|
|
5207
|
+
* The default function to use when trying to get the referenced entity for the given id.
|
|
5208
|
+
*
|
|
5209
|
+
* @param entityId - The id of the referenced entity.
|
|
5210
|
+
* @param allReferencedEntities - All referenced entities.
|
|
5211
|
+
* @returns The entity that has the given id.
|
|
5212
|
+
*/
|
|
5213
|
+
function defaultGetEntityForId(entityId, allReferencedEntities) {
|
|
5214
|
+
return allReferencedEntities.find(e => e['id'] === entityId);
|
|
5215
|
+
}
|
|
5216
|
+
|
|
5217
|
+
/**
|
|
5218
|
+
* Decorator for setting and getting references many property metadata.
|
|
5219
|
+
*
|
|
5220
|
+
* @param metadata - The metadata of the references many property.
|
|
5221
|
+
* @returns The method that defines the metadata.
|
|
5222
|
+
*/
|
|
5223
|
+
function referencesMany(metadata) {
|
|
5224
|
+
return baseProperty(new ReferencesManyDecoratorConfigInternal(metadata), DecoratorTypes.REFERENCES_MANY);
|
|
5225
|
+
}
|
|
5226
|
+
|
|
5227
|
+
/**
|
|
5228
|
+
* Definition for the @string metadata.
|
|
5229
|
+
*/
|
|
5230
|
+
class StringDecoratorConfig extends PropertyDecoratorConfig {
|
|
5231
|
+
}
|
|
5232
|
+
|
|
5233
|
+
// eslint-disable-next-line jsdoc/require-jsdoc, @typescript-eslint/no-explicit-any
|
|
5234
|
+
function UnsavedChangesGuard(component) {
|
|
5235
|
+
return new Observable((obs) => {
|
|
5236
|
+
if (component.canDeactivate()) {
|
|
5237
|
+
obs.next(true);
|
|
5238
|
+
return;
|
|
5239
|
+
}
|
|
5240
|
+
component.openConfirmNavigationDialog().subscribe(v => {
|
|
5241
|
+
obs.next(v);
|
|
5242
|
+
});
|
|
5243
|
+
});
|
|
4817
5244
|
}
|
|
4818
5245
|
|
|
4819
5246
|
/**
|
|
@@ -4824,5 +5251,5 @@ function custom(metadata, metadataKeysToReset) {
|
|
|
4824
5251
|
* Generated bundle index. Do not edit.
|
|
4825
5252
|
*/
|
|
4826
5253
|
|
|
4827
|
-
export { ArrayDecoratorConfig, DateUtilities, DecoratorTypes, Entity, EntityService, EntityUtilities, FileUtilities, NGX_GET_VALIDATION_ERROR_MESSAGE, NgxMatEntityBaseInputComponent, NgxMatEntityConfirmDialogComponent, NgxMatEntityConfirmDialogModule, NgxMatEntityCreateDialogComponent, NgxMatEntityCreateDialogModule, NgxMatEntityEditDialogComponent, NgxMatEntityEditDialogModule, NgxMatEntityInputComponent, NgxMatEntityInputModule, NgxMatEntityTableComponent, NgxMatEntityTableModule, array, boolean, custom, date, file, number, object, referencesMany, string };
|
|
5254
|
+
export { ArrayDecoratorConfig, DateUtilities, DecoratorTypes, Entity, EntityService, EntityUtilities, FileUtilities, NGX_EDIT_DATA, NGX_EDIT_DATA_ENTITY, NGX_EDIT_DATA_ENTITY_SERVICE, NGX_GET_VALIDATION_ERROR_MESSAGE, NgxMatEntityBaseInputComponent, NgxMatEntityConfirmDialogComponent, NgxMatEntityConfirmDialogModule, NgxMatEntityCreateDialogComponent, NgxMatEntityCreateDialogModule, NgxMatEntityEditDialogComponent, NgxMatEntityEditDialogModule, NgxMatEntityEditPageComponent, NgxMatEntityInputComponent, NgxMatEntityInputModule, NgxMatEntityTableComponent, NgxMatEntityTableModule, UnsavedChangesGuard, array, boolean, custom, date, defaultEditDataRoute, exportAsCsvMultiAction, exportAsJsonMultiAction, exportAsXmlMultiAction, file, number, object, referencesMany, string };
|
|
4828
5255
|
//# sourceMappingURL=ngx-material-entity.mjs.map
|