@masterteam/components 0.0.295 → 0.0.297
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/assets/i18n/ar.json +387 -387
- package/assets/i18n/en.json +387 -387
- package/fesm2022/masterteam-components-business-fields.mjs +38 -163
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-checkbox-field.mjs +2 -2
- package/fesm2022/masterteam-components-checkbox-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-radio-button-field.mjs +2 -2
- package/fesm2022/masterteam-components-radio-button-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-toggle-field.mjs +2 -2
- package/fesm2022/masterteam-components-toggle-field.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-business-fields.d.ts +7 -56
- package/types/masterteam-components.d.ts +0 -7
|
@@ -888,14 +888,6 @@ class EntityListField {
|
|
|
888
888
|
const metadata = this.metadata();
|
|
889
889
|
return metadata?.sourceType === 'Module' && Number(metadata.moduleId) > 0;
|
|
890
890
|
}, ...(ngDevMode ? [{ debugName: "moduleBacked" }] : /* istanbul ignore next */ []));
|
|
891
|
-
/**
|
|
892
|
-
* Rows live in this property's own value rather than in target records: the
|
|
893
|
-
* module supplies the columns and the editors, nothing else. The whole row
|
|
894
|
-
* array is submitted on every save and no target record is ever written.
|
|
895
|
-
*/
|
|
896
|
-
embedded = computed(() => this.moduleBacked() && this.metadata()?.storageMode === 'Embedded', ...(ngDevMode ? [{ debugName: "embedded" }] : /* istanbul ignore next */ []));
|
|
897
|
-
/** The module record that owns an embedded value — the rows `instanceId`. */
|
|
898
|
-
ownerRecordId = computed(() => Number(this.runtimeContext()?.moduleDataId ?? 0), ...(ngDevMode ? [{ debugName: "ownerRecordId" }] : /* istanbul ignore next */ []));
|
|
899
891
|
canRead = computed(() => {
|
|
900
892
|
const access = this.accessMode();
|
|
901
893
|
return access === 'Auto' || access === 'Read' || access === 'ReadWrite';
|
|
@@ -944,11 +936,6 @@ class EntityListField {
|
|
|
944
936
|
}, ...(ngDevMode ? [{ debugName: "deletedIds" }] : /* istanbul ignore next */ []));
|
|
945
937
|
/** rowId → original form values / option labels (view state only). */
|
|
946
938
|
rowDrafts = signal({}, ...(ngDevMode ? [{ debugName: "rowDrafts" }] : /* istanbul ignore next */ []));
|
|
947
|
-
/**
|
|
948
|
-
* rowId → the backend's rendered cells for a saved embedded row, from the
|
|
949
|
-
* rows endpoint. View state only: the submitted values stay `pendingRows`.
|
|
950
|
-
*/
|
|
951
|
-
renderedRows = signal({}, ...(ngDevMode ? [{ debugName: "renderedRows" }] : /* istanbul ignore next */ []));
|
|
952
939
|
localRowSeq = 0;
|
|
953
940
|
/** Serialized copy of the last value we emitted, to ignore CVA echoes. */
|
|
954
941
|
lastEmittedJson = null;
|
|
@@ -962,23 +949,14 @@ class EntityListField {
|
|
|
962
949
|
}
|
|
963
950
|
return map;
|
|
964
951
|
}, ...(ngDevMode ? [{ debugName: "rowsByEntityId" }] : /* istanbul ignore next */ []));
|
|
965
|
-
/**
|
|
966
|
-
* Rows with no target record: locally created ones in a linked list, and
|
|
967
|
-
* *every* row of an embedded list.
|
|
968
|
-
*
|
|
969
|
-
* Three sources, in order: what the user last entered (`rowDrafts`), what the
|
|
970
|
-
* rows endpoint rendered for a saved embedded row, and the stored value's own
|
|
971
|
-
* cells. The middle one is what turns a saved `rawValue` of `"3fa85f64…"`
|
|
972
|
-
* back into an assignee's name after a reload.
|
|
973
|
-
*/
|
|
952
|
+
/** Locally created rows (not yet persisted). */
|
|
974
953
|
createdRows = computed(() => {
|
|
975
954
|
const drafts = this.rowDrafts();
|
|
976
|
-
const rendered = this.renderedRows();
|
|
977
955
|
return this.pendingRows()
|
|
978
956
|
.filter((row) => !(row.entityId > 0))
|
|
979
957
|
.map((row) => {
|
|
980
|
-
const
|
|
981
|
-
return this.buildRow(row.rowId, row.rowId, 0,
|
|
958
|
+
const draft = drafts[row.rowId];
|
|
959
|
+
return this.buildRow(row.rowId, row.rowId, 0, draft?.values ?? this.toValueMap(row.values), draft?.display ?? this.toDisplayMap(row.values));
|
|
982
960
|
});
|
|
983
961
|
}, ...(ngDevMode ? [{ debugName: "createdRows" }] : /* istanbul ignore next */ []));
|
|
984
962
|
/** Pending edits of existing rows, keyed by entity id. */
|
|
@@ -1032,10 +1010,7 @@ class EntityListField {
|
|
|
1032
1010
|
*/
|
|
1033
1011
|
showsPendingOperations = computed(() => this.canWrite() ||
|
|
1034
1012
|
this.accessMode() === 'Write' ||
|
|
1035
|
-
this.pendingSubmission()
|
|
1036
|
-
// An embedded list has nothing else to show: its rows *are* the value,
|
|
1037
|
-
// so they render even when the field is read-only.
|
|
1038
|
-
this.embedded(), ...(ngDevMode ? [{ debugName: "showsPendingOperations" }] : /* istanbul ignore next */ []));
|
|
1013
|
+
this.pendingSubmission(), ...(ngDevMode ? [{ debugName: "showsPendingOperations" }] : /* istanbul ignore next */ []));
|
|
1039
1014
|
/**
|
|
1040
1015
|
* Rows rendered in the table: existing rows merged with pending edits,
|
|
1041
1016
|
* removed rows hidden, and created rows appended.
|
|
@@ -1215,7 +1190,6 @@ class EntityListField {
|
|
|
1215
1190
|
levelDataId: this.levelDataId(),
|
|
1216
1191
|
writeFields: this.writeFields(),
|
|
1217
1192
|
lookups: this.lookups(),
|
|
1218
|
-
useRootModuleSchema: this.embedded(),
|
|
1219
1193
|
},
|
|
1220
1194
|
});
|
|
1221
1195
|
ref.onClose.pipe(take(1)).subscribe((result) => {
|
|
@@ -1261,7 +1235,6 @@ class EntityListField {
|
|
|
1261
1235
|
levelDataId: this.levelDataId(),
|
|
1262
1236
|
writeFields: this.writeFields(),
|
|
1263
1237
|
lookups: this.lookups(),
|
|
1264
|
-
useRootModuleSchema: this.embedded(),
|
|
1265
1238
|
initialValues: prefillValues,
|
|
1266
1239
|
isEdit: true,
|
|
1267
1240
|
},
|
|
@@ -1377,16 +1350,15 @@ class EntityListField {
|
|
|
1377
1350
|
delete next[rowId];
|
|
1378
1351
|
this.rowDrafts.set(next);
|
|
1379
1352
|
}
|
|
1380
|
-
buildRow(id, rowId, entityId, values, display = {}
|
|
1353
|
+
buildRow(id, rowId, entityId, values, display = {}) {
|
|
1381
1354
|
const row = {
|
|
1382
1355
|
Id: id,
|
|
1383
1356
|
[ROW_ID_KEY]: rowId,
|
|
1384
1357
|
[ROW_ENTITY_ID_KEY]: entityId,
|
|
1385
1358
|
[ROW_VALUES_KEY]: values,
|
|
1386
1359
|
// A drafted row is built from control values already, so there is
|
|
1387
|
-
// nothing to resolve — the two maps are the same.
|
|
1388
|
-
|
|
1389
|
-
[ROW_PREFILL_KEY]: prefill ?? values,
|
|
1360
|
+
// nothing to resolve — the two maps are the same.
|
|
1361
|
+
[ROW_PREFILL_KEY]: values,
|
|
1390
1362
|
};
|
|
1391
1363
|
for (const column of this.columns()) {
|
|
1392
1364
|
// Form values are keyed by catalog property key (e.g. "task_name"),
|
|
@@ -1499,31 +1471,27 @@ class EntityListField {
|
|
|
1499
1471
|
// ============================================================================
|
|
1500
1472
|
emitValue() {
|
|
1501
1473
|
const current = this.storedValue();
|
|
1502
|
-
// `
|
|
1503
|
-
//
|
|
1504
|
-
//
|
|
1505
|
-
const
|
|
1506
|
-
...
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1474
|
+
// `entityIds` / `createdIds` / `updatedIds` / `snapshot` are backend-owned
|
|
1475
|
+
// and passed through untouched; the frontend only contributes pending rows
|
|
1476
|
+
// and delete intents.
|
|
1477
|
+
const next = {
|
|
1478
|
+
...(current ?? {}),
|
|
1479
|
+
// `values[].value` is the backend's rendered label, carried only so the
|
|
1480
|
+
// table can print it. Submitting it back would echo a user object where
|
|
1481
|
+
// the stored scalar belongs.
|
|
1482
|
+
rows: this.pendingRows().map((row) => ({
|
|
1483
|
+
...row,
|
|
1484
|
+
values: (row.values ?? []).map(({ propertyKey, rawValue }) => ({
|
|
1485
|
+
propertyKey,
|
|
1486
|
+
rawValue,
|
|
1487
|
+
})),
|
|
1510
1488
|
})),
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
// row is simply absent from it, and linked bookkeeping has no meaning —
|
|
1514
|
-
// the backend strips `entityIds` / `deletedIds` / `snapshot` for it anyway.
|
|
1515
|
-
// A linked value instead carries pending intent over backend-owned fields,
|
|
1516
|
-
// which are passed through untouched.
|
|
1517
|
-
const next = this.embedded()
|
|
1518
|
-
? { rows }
|
|
1519
|
-
: { ...(current ?? {}), rows, deletedIds: this.deletedIds() };
|
|
1489
|
+
deletedIds: this.deletedIds(),
|
|
1490
|
+
};
|
|
1520
1491
|
this.storedValue.set(next);
|
|
1521
|
-
// Normalized the same way `isEchoOfLastEmit` reads the incoming value —
|
|
1522
|
-
// an embedded payload has no `deletedIds`, and an absent key would make
|
|
1523
|
-
// every echo look like a new value and reset the user's edits.
|
|
1524
1492
|
this.lastEmittedJson = JSON.stringify({
|
|
1525
|
-
rows: next.rows
|
|
1526
|
-
deletedIds: next.deletedIds
|
|
1493
|
+
rows: next.rows,
|
|
1494
|
+
deletedIds: next.deletedIds,
|
|
1527
1495
|
});
|
|
1528
1496
|
this.onModelChange(next);
|
|
1529
1497
|
this.onTouched();
|
|
@@ -1649,7 +1617,6 @@ class EntityListField {
|
|
|
1649
1617
|
this.metadataFailure.set(null);
|
|
1650
1618
|
this.columns.set([]);
|
|
1651
1619
|
this.rows.set([]);
|
|
1652
|
-
this.renderedRows.set({});
|
|
1653
1620
|
this.errorMessage.set(null);
|
|
1654
1621
|
this.loading.set(false);
|
|
1655
1622
|
if (!(propertyId > 0) || levelId == null || !(Number(levelId) > 0))
|
|
@@ -1689,101 +1656,15 @@ class EntityListField {
|
|
|
1689
1656
|
applyMetadata(metadata, levelDataId) {
|
|
1690
1657
|
this.metadata.set(metadata);
|
|
1691
1658
|
this.columns.set(this.buildColumns(metadata));
|
|
1692
|
-
if (!this.moduleBacked() ||
|
|
1693
|
-
this.
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
// An embedded list reads its own saved rows, keyed by the record that owns
|
|
1697
|
-
// them — never the schema module's records. Before that record exists the
|
|
1698
|
-
// rows are purely local, exactly like a draft parent's.
|
|
1699
|
-
if (this.embedded()) {
|
|
1700
|
-
const ownerRecordId = this.ownerRecordId();
|
|
1701
|
-
if (ownerRecordId > 0) {
|
|
1702
|
-
this.fetchEmbeddedRows(metadata.propertyId, ownerRecordId);
|
|
1703
|
-
}
|
|
1704
|
-
else {
|
|
1705
|
-
this.loading.set(false);
|
|
1706
|
-
}
|
|
1707
|
-
return;
|
|
1708
|
-
}
|
|
1709
|
-
if (levelDataId == null || Number(levelDataId) <= 0) {
|
|
1659
|
+
if (!this.moduleBacked() ||
|
|
1660
|
+
!this.canRead() ||
|
|
1661
|
+
levelDataId == null ||
|
|
1662
|
+
Number(levelDataId) <= 0) {
|
|
1710
1663
|
this.loading.set(false);
|
|
1711
1664
|
return;
|
|
1712
1665
|
}
|
|
1713
1666
|
this.fetchRows(metadata.levelId, levelDataId, metadata.moduleId, this.projectedKeys());
|
|
1714
1667
|
}
|
|
1715
|
-
/**
|
|
1716
|
-
* Saved rows of an embedded list, rendered by the backend.
|
|
1717
|
-
*
|
|
1718
|
-
* They are not merged into `rows` — that signal is target module records,
|
|
1719
|
-
* which an embedded list has none of. They land in `renderedRows`, which
|
|
1720
|
-
* `createdRows` consults to render the value's own rows with resolved labels
|
|
1721
|
-
* instead of stored scalars.
|
|
1722
|
-
*
|
|
1723
|
-
* The stored value stays authoritative for *which* rows exist, so a value
|
|
1724
|
-
* that already carries them is left alone; the response only seeds the array
|
|
1725
|
-
* when the control arrived without one.
|
|
1726
|
-
*/
|
|
1727
|
-
fetchEmbeddedRows(propertyId, ownerRecordId) {
|
|
1728
|
-
this.loading.set(true);
|
|
1729
|
-
this.errorMessage.set(null);
|
|
1730
|
-
const ctx = this.context();
|
|
1731
|
-
this.fetchSubscription = this.http
|
|
1732
|
-
.get(`Properties/${propertyId}/entitylist/rows`, {
|
|
1733
|
-
params: { instanceId: String(ownerRecordId) },
|
|
1734
|
-
headers: { noMessage: 'true' },
|
|
1735
|
-
...(ctx ? { context: ctx } : {}),
|
|
1736
|
-
})
|
|
1737
|
-
.pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.loading.set(false)), catchError((error) => {
|
|
1738
|
-
// `404` is "no saved rows for this owner" as much as it is a
|
|
1739
|
-
// misconfiguration, and the value's own rows still render.
|
|
1740
|
-
if (error.status !== 404 && error.status !== 403) {
|
|
1741
|
-
this.errorMessage.set(this.transloco.translate('components.entityListField.loadFailed'));
|
|
1742
|
-
}
|
|
1743
|
-
return of({ data: [] });
|
|
1744
|
-
}))
|
|
1745
|
-
.subscribe((response) => this.applyEmbeddedRows(response.data ?? []));
|
|
1746
|
-
}
|
|
1747
|
-
applyEmbeddedRows(rows) {
|
|
1748
|
-
const rendered = {};
|
|
1749
|
-
const stored = [];
|
|
1750
|
-
const properties = this.propertyByKey();
|
|
1751
|
-
for (const row of rows) {
|
|
1752
|
-
const rowId = row.rowId?.trim();
|
|
1753
|
-
if (!rowId)
|
|
1754
|
-
continue;
|
|
1755
|
-
const values = {};
|
|
1756
|
-
const display = {};
|
|
1757
|
-
const prefill = {};
|
|
1758
|
-
const submitted = [];
|
|
1759
|
-
for (const cell of row.values ?? []) {
|
|
1760
|
-
if (!cell?.propertyKey)
|
|
1761
|
-
continue;
|
|
1762
|
-
values[cell.propertyKey] = cell.rawValue;
|
|
1763
|
-
if (cell.value !== undefined)
|
|
1764
|
-
display[cell.propertyKey] = cell.value;
|
|
1765
|
-
// A user picker binds the resolved object, not the stored id, so the
|
|
1766
|
-
// edit dialog is pre-filled from the rendered value for those view
|
|
1767
|
-
// types — the same exception the loaded linked rows make. The rendered
|
|
1768
|
-
// counterpart is only usable when the backend resolved one.
|
|
1769
|
-
const resolved = cell.value !== null &&
|
|
1770
|
-
typeof cell.value === 'object' &&
|
|
1771
|
-
OBJECT_VALUED_VIEW_TYPES.has(properties.get(cell.propertyKey)?.viewType ?? '');
|
|
1772
|
-
prefill[cell.propertyKey] = resolved ? cell.value : cell.rawValue;
|
|
1773
|
-
submitted.push({
|
|
1774
|
-
propertyKey: cell.propertyKey,
|
|
1775
|
-
rawValue: cell.rawValue,
|
|
1776
|
-
});
|
|
1777
|
-
}
|
|
1778
|
-
rendered[rowId] = { values, display, prefill };
|
|
1779
|
-
// `entityId` is always 0 here: an embedded row has no target record.
|
|
1780
|
-
stored.push({ rowId, entityId: 0, values: submitted });
|
|
1781
|
-
}
|
|
1782
|
-
this.renderedRows.set(rendered);
|
|
1783
|
-
if (this.pendingRows().length === 0 && stored.length > 0) {
|
|
1784
|
-
this.pendingRows.set(stored);
|
|
1785
|
-
}
|
|
1786
|
-
}
|
|
1787
1668
|
/**
|
|
1788
1669
|
* Table columns, in the order the backend returned them.
|
|
1789
1670
|
*
|
|
@@ -1792,16 +1673,12 @@ class EntityListField {
|
|
|
1792
1673
|
* value directly. The lookup still falls back to `normalizedKey` so a column
|
|
1793
1674
|
* fed from any other projection keeps resolving.
|
|
1794
1675
|
*
|
|
1795
|
-
* The columns are the *union* of readable and writable fields, so
|
|
1796
|
-
*
|
|
1797
|
-
*
|
|
1798
|
-
*
|
|
1799
|
-
*
|
|
1800
|
-
*
|
|
1801
|
-
* - **Write-only access**, whose readable set is empty by definition and
|
|
1802
|
-
* whose stored rows have nothing else to render through.
|
|
1803
|
-
* - **Embedded storage**, where the rows endpoint returns cells for the whole
|
|
1804
|
-
* union by design, "so saved editor values can be rendered after reload".
|
|
1676
|
+
* The columns are the *union* of readable and writable fields, so a
|
|
1677
|
+
* write-only key arrives as a column too — a `Planned Finish` the user may
|
|
1678
|
+
* set in the dialog but may not read. It is not projected into the rows and
|
|
1679
|
+
* would render as an empty column, so only readable keys become columns.
|
|
1680
|
+
* Write-only access is the exception: its readable set is empty by
|
|
1681
|
+
* definition, and its stored rows have nothing else to render through.
|
|
1805
1682
|
*/
|
|
1806
1683
|
buildColumns(metadata) {
|
|
1807
1684
|
const propertyByKey = new Map();
|
|
@@ -1810,9 +1687,7 @@ class EntityListField {
|
|
|
1810
1687
|
propertyByKey.set(property.key, property);
|
|
1811
1688
|
propertyByNormalizedKey.set(property.normalizedKey, property);
|
|
1812
1689
|
}
|
|
1813
|
-
const readable = metadata.
|
|
1814
|
-
? new Set()
|
|
1815
|
-
: new Set(metadata.readFields);
|
|
1690
|
+
const readable = new Set(metadata.readFields);
|
|
1816
1691
|
return (metadata.projectionMeta?.columns ?? [])
|
|
1817
1692
|
.filter((column) => column.visible)
|
|
1818
1693
|
.filter((column) => readable.size === 0 || readable.has(column.key))
|
|
@@ -1942,7 +1817,7 @@ class EntityListField {
|
|
|
1942
1817
|
};
|
|
1943
1818
|
}
|
|
1944
1819
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1945
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityListField, isStandalone: true, selector: "mt-entity-list-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null }, pendingSubmission: { classPropertyName: "pendingSubmission", publicName: "pendingSubmission", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n @if (label()) {\n <label class=\"font-medium text-color\">\n {{ label() }}\n @if (required()) {\n <span class=\"text-red-500\">*</span>\n }\n </label>\n }\n\n @if (errorMessage(); as err) {\n <p-message severity=\"error\" [text]=\"err\" styleClass=\"w-full\" />\n } @else if (noticeKey(); as notice) {\n <div\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\n >\n {{ notice | transloco }}\n </div>\n } @else if (canWrite()) {\n <div class=\"flex justify-end\">\n <mt-button\n [label]=\"'components.entityListField.add' | transloco\"\n icon=\"general.plus\"\n size=\"small\"\n [disabled]=\"disabled()\"\n (onClick)=\"openAddDialog()\"\n />\n </div>\n <mt-table\n [noCard]=\"true\"\n [data]=\"displayRows()\"\n [columns]=\"columns()\"\n [rowActions]=\"writeRowActions()\"\n dataKey=\"Id\"\n [loading]=\"loading()\"\n />\n } @else if (loading() && !hasRows()) {\n <div class=\"flex flex-col gap-2\">\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\n </div>\n } @else if (!hasRows()) {\n <div\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\n >\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\n </div>\n } @else {\n <mt-table\n [noCard]=\"true\"\n [data]=\"displayRows()\"\n [columns]=\"columns()\"\n dataKey=\"Id\"\n [loading]=\"loading()\"\n />\n }\n\n @if (ngControl?.control) {\n <mt-field-validation\n [control]=\"ngControl?.control!\"\n [touched]=\"ngControl?.touched ?? false\"\n />\n }\n</div>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1820
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: EntityListField, isStandalone: true, selector: "mt-entity-list-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, propertyId: { classPropertyName: "propertyId", publicName: "propertyId", isSignal: true, isRequired: false, transformFunction: null }, configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, runtimeContext: { classPropertyName: "runtimeContext", publicName: "runtimeContext", isSignal: true, isRequired: false, transformFunction: null }, pendingSubmission: { classPropertyName: "pendingSubmission", publicName: "pendingSubmission", isSignal: true, isRequired: false, transformFunction: null }, lookups: { classPropertyName: "lookups", publicName: "lookups", isSignal: true, isRequired: false, transformFunction: null }, context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "grid gap-1" }, ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\r\n @if (label()) {\r\n <label class=\"font-medium text-color\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"text-red-500\">*</span>\r\n }\r\n </label>\r\n }\r\n\r\n @if (errorMessage(); as err) {\r\n <p-message severity=\"error\" [text]=\"err\" styleClass=\"w-full\" />\r\n } @else if (noticeKey(); as notice) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ notice | transloco }}\r\n </div>\r\n } @else if (canWrite()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.add' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openAddDialog()\"\r\n />\r\n </div>\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n [rowActions]=\"writeRowActions()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n } @else if (loading() && !hasRows()) {\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n </div>\r\n } @else if (!hasRows()) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\r\n </div>\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n }\r\n\r\n @if (ngControl?.control) {\r\n <mt-field-validation\r\n [control]=\"ngControl?.control!\"\r\n [touched]=\"ngControl?.touched ?? false\"\r\n />\r\n }\r\n</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: FieldValidation, selector: "mt-field-validation", inputs: ["control", "touched", "messageId"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "component", type: Table, selector: "mt-table", inputs: ["filters", "data", "columns", "rowActions", "size", "showGridlines", "stripedRows", "selectableRows", "clickableRows", "generalSearch", "lazyLocalSearch", "showFilters", "filterMode", "loading", "updating", "lazy", "lazyLocalSort", "lazyTotalRecords", "reorderableColumns", "reorderableRows", "dataKey", "storageKey", "storageMode", "persistStateExclude", "exportable", "printable", "groupable", "groupCountMap", "cellClickFilter", "freezeActions", "virtualScroll", "virtualScrollItemSize", "scrollHeight", "printTitle", "exportFilename", "actionShape", "rowActionsLoadingFn", "tableLayout", "noCard", "tabs", "tabsOptionLabel", "tabsOptionValue", "activeTab", "actions", "captionStartTemplate", "captionEndTemplate", "emptyTitle", "emptyDescription", "emptyActionLabel", "emptyActionIcon", "paginatorPosition", "alwaysShowPaginator", "rowsPerPageOptions", "pageSize", "currentPage", "first", "filterTerm", "groupBy", "sortField", "sortDirection"], outputs: ["selectionChange", "cellChange", "lazyLoad", "columnReorder", "rowReorder", "rowClick", "emptyAction", "rowActionsRequested", "filtersChange", "activeTabChange", "onTabChange", "pageSizeChange", "currentPageChange", "firstChange", "filterTermChange", "groupByChange", "sortFieldChange", "sortDirectionChange"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1946
1821
|
}
|
|
1947
1822
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: EntityListField, decorators: [{
|
|
1948
1823
|
type: Component,
|
|
@@ -1954,7 +1829,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1954
1829
|
Table,
|
|
1955
1830
|
Button,
|
|
1956
1831
|
TranslocoPipe,
|
|
1957
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'grid gap-1' }, template: "<div class=\"flex flex-col gap-2\">\n @if (label()) {\n <label class=\"font-medium text-color\">\n {{ label() }}\n @if (required()) {\n <span class=\"text-red-500\">*</span>\n }\n </label>\n }\n\n @if (errorMessage(); as err) {\n <p-message severity=\"error\" [text]=\"err\" styleClass=\"w-full\" />\n } @else if (noticeKey(); as notice) {\n <div\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\n >\n {{ notice | transloco }}\n </div>\n } @else if (canWrite()) {\n <div class=\"flex justify-end\">\n <mt-button\n [label]=\"'components.entityListField.add' | transloco\"\n icon=\"general.plus\"\n size=\"small\"\n [disabled]=\"disabled()\"\n (onClick)=\"openAddDialog()\"\n />\n </div>\n <mt-table\n [noCard]=\"true\"\n [data]=\"displayRows()\"\n [columns]=\"columns()\"\n [rowActions]=\"writeRowActions()\"\n dataKey=\"Id\"\n [loading]=\"loading()\"\n />\n } @else if (loading() && !hasRows()) {\n <div class=\"flex flex-col gap-2\">\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\n </div>\n } @else if (!hasRows()) {\n <div\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\n >\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\n </div>\n } @else {\n <mt-table\n [noCard]=\"true\"\n [data]=\"displayRows()\"\n [columns]=\"columns()\"\n dataKey=\"Id\"\n [loading]=\"loading()\"\n />\n }\n\n @if (ngControl?.control) {\n <mt-field-validation\n [control]=\"ngControl?.control!\"\n [touched]=\"ngControl?.touched ?? false\"\n />\n }\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
1832
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'grid gap-1' }, template: "<div class=\"flex flex-col gap-2\">\r\n @if (label()) {\r\n <label class=\"font-medium text-color\">\r\n {{ label() }}\r\n @if (required()) {\r\n <span class=\"text-red-500\">*</span>\r\n }\r\n </label>\r\n }\r\n\r\n @if (errorMessage(); as err) {\r\n <p-message severity=\"error\" [text]=\"err\" styleClass=\"w-full\" />\r\n } @else if (noticeKey(); as notice) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ notice | transloco }}\r\n </div>\r\n } @else if (canWrite()) {\r\n <div class=\"flex justify-end\">\r\n <mt-button\r\n [label]=\"'components.entityListField.add' | transloco\"\r\n icon=\"general.plus\"\r\n size=\"small\"\r\n [disabled]=\"disabled()\"\r\n (onClick)=\"openAddDialog()\"\r\n />\r\n </div>\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n [rowActions]=\"writeRowActions()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n } @else if (loading() && !hasRows()) {\r\n <div class=\"flex flex-col gap-2\">\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n <p-skeleton width=\"100%\" height=\"3rem\" borderRadius=\"0.375rem\" />\r\n </div>\r\n } @else if (!hasRows()) {\r\n <div\r\n class=\"rounded-md border border-dashed border-surface-300 bg-surface-50 p-3 text-sm text-muted-color\"\r\n >\r\n {{ \"components.entityListField.noRelatedItems\" | transloco }}\r\n </div>\r\n } @else {\r\n <mt-table\r\n [noCard]=\"true\"\r\n [data]=\"displayRows()\"\r\n [columns]=\"columns()\"\r\n dataKey=\"Id\"\r\n [loading]=\"loading()\"\r\n />\r\n }\r\n\r\n @if (ngControl?.control) {\r\n <mt-field-validation\r\n [control]=\"ngControl?.control!\"\r\n [touched]=\"ngControl?.touched ?? false\"\r\n />\r\n }\r\n</div>\r\n", styles: [":host{display:block}\n"] }]
|
|
1958
1833
|
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], propertyId: [{ type: i0.Input, args: [{ isSignal: true, alias: "propertyId", required: false }] }], configuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "configuration", required: false }] }], runtimeContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "runtimeContext", required: false }] }], pendingSubmission: [{ type: i0.Input, args: [{ isSignal: true, alias: "pendingSubmission", required: false }] }], lookups: [{ type: i0.Input, args: [{ isSignal: true, alias: "lookups", required: false }] }], context: [{ type: i0.Input, args: [{ isSignal: true, alias: "context", required: false }] }] } });
|
|
1959
1834
|
|
|
1960
1835
|
/** Page size when loading the full deliverable list, and a hard safety cap. */
|