remult 0.27.21-next.8 → 0.27.21
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/esm/internals.js +2 -1
- package/esm/remult-sqlite3.js +5 -0
- package/esm/server/get-remult-admin-html.js +1 -1
- package/esm/server/test-api-data-provider.js +2 -16
- package/esm/src/data-providers/sql-relations.js +125 -0
- package/esm/src/remult-static.js +1 -0
- package/esm/src/remult3/RepositoryImplementation.js +74 -47
- package/index.d.ts +1 -1
- package/internals.d.ts +2 -1
- package/internals.js +6 -1
- package/package.json +1 -1
- package/remult-sqlite3.d.ts +2 -0
- package/remult-sqlite3.js +16 -0
- package/server/get-remult-admin-html.js +1 -1
- package/server/test-api-data-provider.d.ts +1 -3
- package/server/test-api-data-provider.js +1 -20
- package/src/data-providers/sql-relations.d.ts +40 -0
- package/src/data-providers/sql-relations.js +167 -0
- package/src/remult-static.d.ts +1 -0
- package/src/remult-static.js +1 -0
- package/src/remult3/RepositoryImplementation.d.ts +6 -2
- package/src/remult3/RepositoryImplementation.js +232 -195
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ControllerBase = exports.EntityBase = exports.fieldOptionalValuesFunctionKey = exports.storableMember = exports.ValueListInfo = exports.columnDefsImpl = exports.CaptionTransformer = exports.FieldRefImplementation = exports.controllerRefImpl = exports.rowHelperImplementation = exports.RepositoryImplementation = void 0;
|
|
3
|
+
exports.ControllerBase = exports.EntityBase = exports.fieldOptionalValuesFunctionKey = exports.storableMember = exports.ValueListInfo = exports.columnDefsImpl = exports.CaptionTransformer = exports.fieldOptionsEnricher = exports.FieldRefImplementation = exports.controllerRefImpl = exports.rowHelperImplementation = exports.RepositoryImplementation = void 0;
|
|
4
4
|
exports.createOldEntity = createOldEntity;
|
|
5
5
|
exports.getFields = getFields;
|
|
6
6
|
exports.getControllerRef = getControllerRef;
|
|
@@ -1030,7 +1030,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1030
1030
|
});
|
|
1031
1031
|
});
|
|
1032
1032
|
}
|
|
1033
|
-
var loadFields, _a, _b, col, ei, isRelation, load, repo, toLoad, rawRows_1, rawRows_1_1, r, val, e_13_1, result, fields;
|
|
1033
|
+
var loadFields, _a, _b, col, ei, isRelation, load, repo, toLoad, rawRows_1, rawRows_1_1, r, val, e_13_1, excludeRelationMembers, result, fields;
|
|
1034
1034
|
var e_13, _c, e_14, _d;
|
|
1035
1035
|
var _this = this;
|
|
1036
1036
|
return tslib_1.__generator(this, function (_e) {
|
|
@@ -1095,12 +1095,22 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1095
1095
|
}
|
|
1096
1096
|
finally { if (e_13) throw e_13.error; }
|
|
1097
1097
|
return [7 /*endfinally*/];
|
|
1098
|
-
case 8:
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1098
|
+
case 8:
|
|
1099
|
+
excludeRelationMembers = new Set(this.fields
|
|
1100
|
+
.toArray()
|
|
1101
|
+
.map(function (f) {
|
|
1102
|
+
var i = _this.__getRelationAndInclude(f, loadOptions);
|
|
1103
|
+
if (i.rel && !i.incl)
|
|
1104
|
+
return f.key;
|
|
1105
|
+
return undefined;
|
|
1106
|
+
})
|
|
1107
|
+
.filter(function (x) { return x !== undefined; }));
|
|
1108
|
+
return [4 /*yield*/, promiseAll(rawRows, function (r) { return tslib_1.__awaiter(_this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) {
|
|
1109
|
+
switch (_a.label) {
|
|
1110
|
+
case 0: return [4 /*yield*/, this._mapRawDataToResult(r, loadFields, excludeRelationMembers)];
|
|
1111
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
1112
|
+
}
|
|
1113
|
+
}); }); })];
|
|
1104
1114
|
case 9:
|
|
1105
1115
|
result = _e.sent();
|
|
1106
1116
|
fields = this.metadata.fields.toArray();
|
|
@@ -1112,62 +1122,71 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1112
1122
|
};
|
|
1113
1123
|
RepositoryImplementation.prototype._populateRelationsForFields = function (fields, loadOptions, result, loader) {
|
|
1114
1124
|
var e_16, _a;
|
|
1115
|
-
var _b;
|
|
1116
1125
|
var _loop_1 = function (col) {
|
|
1117
|
-
var e_17, _c;
|
|
1118
|
-
var
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1126
|
+
var e_17, _b, e_18, _c;
|
|
1127
|
+
var _d = this_1.__getRelationAndInclude(col, loadOptions), rel = _d.rel, incl = _d.incl;
|
|
1128
|
+
if (rel)
|
|
1129
|
+
if (incl) {
|
|
1130
|
+
var otherRepo = rel.toRepo;
|
|
1131
|
+
var _loop_2 = function (row) {
|
|
1132
|
+
var _e = this_1._findOptionsBasedOnRelation(rel, col, incl, row, otherRepo), findOptions = _e.findOptions, returnNull = _e.returnNull;
|
|
1133
|
+
var colKey = col.key;
|
|
1134
|
+
if (returnNull)
|
|
1135
|
+
row[colKey] = null;
|
|
1136
|
+
else {
|
|
1137
|
+
var entityType = rel.toEntity;
|
|
1138
|
+
var toRepo_1 = otherRepo;
|
|
1139
|
+
loader
|
|
1140
|
+
.load({
|
|
1141
|
+
entityType: entityType,
|
|
1142
|
+
find: function (options) {
|
|
1143
|
+
return toRepo_1._rawFind(options, false, loader, function (o) {
|
|
1144
|
+
return toRepo_1._edp.find(o);
|
|
1145
|
+
});
|
|
1146
|
+
},
|
|
1147
|
+
metadata: toRepo_1.metadata,
|
|
1148
|
+
}, findOptions)
|
|
1149
|
+
.then(function (result) {
|
|
1150
|
+
if (result.length == 0 && rel.type == 'toOne')
|
|
1151
|
+
return;
|
|
1152
|
+
row[colKey] =
|
|
1153
|
+
rel.type !== 'toMany'
|
|
1154
|
+
? result.length == 0
|
|
1155
|
+
? null
|
|
1156
|
+
: result[0]
|
|
1157
|
+
: result;
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
};
|
|
1161
|
+
try {
|
|
1162
|
+
for (var result_1 = (e_17 = void 0, tslib_1.__values(result)), result_1_1 = result_1.next(); !result_1_1.done; result_1_1 = result_1.next()) {
|
|
1163
|
+
var row = result_1_1.value;
|
|
1164
|
+
_loop_2(row);
|
|
1165
|
+
}
|
|
1155
1166
|
}
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1167
|
+
catch (e_17_1) { e_17 = { error: e_17_1 }; }
|
|
1168
|
+
finally {
|
|
1169
|
+
try {
|
|
1170
|
+
if (result_1_1 && !result_1_1.done && (_b = result_1.return)) _b.call(result_1);
|
|
1171
|
+
}
|
|
1172
|
+
finally { if (e_17) throw e_17.error; }
|
|
1161
1173
|
}
|
|
1162
1174
|
}
|
|
1163
|
-
|
|
1164
|
-
finally {
|
|
1175
|
+
else {
|
|
1165
1176
|
try {
|
|
1166
|
-
|
|
1177
|
+
for (var result_2 = (e_18 = void 0, tslib_1.__values(result)), result_2_1 = result_2.next(); !result_2_1.done; result_2_1 = result_2.next()) {
|
|
1178
|
+
var row = result_2_1.value;
|
|
1179
|
+
Reflect.deleteProperty(row, col.key);
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
catch (e_18_1) { e_18 = { error: e_18_1 }; }
|
|
1183
|
+
finally {
|
|
1184
|
+
try {
|
|
1185
|
+
if (result_2_1 && !result_2_1.done && (_c = result_2.return)) _c.call(result_2);
|
|
1186
|
+
}
|
|
1187
|
+
finally { if (e_18) throw e_18.error; }
|
|
1167
1188
|
}
|
|
1168
|
-
finally { if (e_17) throw e_17.error; }
|
|
1169
1189
|
}
|
|
1170
|
-
}
|
|
1171
1190
|
};
|
|
1172
1191
|
var this_1 = this;
|
|
1173
1192
|
try {
|
|
@@ -1184,9 +1203,20 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1184
1203
|
finally { if (e_16) throw e_16.error; }
|
|
1185
1204
|
}
|
|
1186
1205
|
};
|
|
1206
|
+
RepositoryImplementation.prototype.__getRelationAndInclude = function (col, loadOptions) {
|
|
1207
|
+
var _a;
|
|
1208
|
+
var rel = (0, relationInfoMember_js_1.getRelationFieldInfo)(col);
|
|
1209
|
+
var incl = col.options
|
|
1210
|
+
.defaultIncluded;
|
|
1211
|
+
var include = (_a = loadOptions === null || loadOptions === void 0 ? void 0 : loadOptions.include) === null || _a === void 0 ? void 0 : _a[col.key];
|
|
1212
|
+
if (include !== undefined) {
|
|
1213
|
+
incl = include;
|
|
1214
|
+
}
|
|
1215
|
+
return { rel: rel, incl: incl };
|
|
1216
|
+
};
|
|
1187
1217
|
/*@internal */
|
|
1188
1218
|
RepositoryImplementation.prototype._findOptionsBasedOnRelation = function (rel, field, moreFindOptions, row, otherRepo) {
|
|
1189
|
-
var
|
|
1219
|
+
var e_19, _a, e_20, _b, _c, _d;
|
|
1190
1220
|
var returnNull = false;
|
|
1191
1221
|
var returnUndefined = false;
|
|
1192
1222
|
var where = [];
|
|
@@ -1206,7 +1236,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1206
1236
|
if (source.where)
|
|
1207
1237
|
where.push(source.where);
|
|
1208
1238
|
try {
|
|
1209
|
-
for (var _e = (
|
|
1239
|
+
for (var _e = (e_20 = void 0, tslib_1.__values([
|
|
1210
1240
|
'limit',
|
|
1211
1241
|
'include',
|
|
1212
1242
|
'orderBy',
|
|
@@ -1217,21 +1247,21 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1217
1247
|
findOptions[key] = source[key];
|
|
1218
1248
|
}
|
|
1219
1249
|
}
|
|
1220
|
-
catch (
|
|
1250
|
+
catch (e_20_1) { e_20 = { error: e_20_1 }; }
|
|
1221
1251
|
finally {
|
|
1222
1252
|
try {
|
|
1223
1253
|
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
1224
1254
|
}
|
|
1225
|
-
finally { if (
|
|
1255
|
+
finally { if (e_20) throw e_20.error; }
|
|
1226
1256
|
}
|
|
1227
1257
|
}
|
|
1228
1258
|
}
|
|
1229
|
-
catch (
|
|
1259
|
+
catch (e_19_1) { e_19 = { error: e_19_1 }; }
|
|
1230
1260
|
finally {
|
|
1231
1261
|
try {
|
|
1232
1262
|
if (findOptionsSources_1_1 && !findOptionsSources_1_1.done && (_a = findOptionsSources_1.return)) _a.call(findOptionsSources_1);
|
|
1233
1263
|
}
|
|
1234
|
-
finally { if (
|
|
1264
|
+
finally { if (e_19) throw e_19.error; }
|
|
1235
1265
|
}
|
|
1236
1266
|
var relFields = rel.getFields();
|
|
1237
1267
|
var getFieldValue = function (key) {
|
|
@@ -1270,14 +1300,14 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1270
1300
|
findOptions.limit = 1;
|
|
1271
1301
|
return { findOptions: findOptions, returnNull: returnNull, returnUndefined: returnUndefined };
|
|
1272
1302
|
};
|
|
1273
|
-
RepositoryImplementation.prototype._mapRawDataToResult = function (r, loadFields) {
|
|
1303
|
+
RepositoryImplementation.prototype._mapRawDataToResult = function (r, loadFields, excludeRelationMembers) {
|
|
1274
1304
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1275
1305
|
var x, helper;
|
|
1276
1306
|
return tslib_1.__generator(this, function (_a) {
|
|
1277
1307
|
switch (_a.label) {
|
|
1278
1308
|
case 0:
|
|
1279
1309
|
x = new this._entity(this._remult);
|
|
1280
|
-
helper = new rowHelperImplementation(this._info, x, this, this._edp, this._remult, false);
|
|
1310
|
+
helper = new rowHelperImplementation(this._info, x, this, this._edp, this._remult, false, excludeRelationMembers);
|
|
1281
1311
|
Object.defineProperty(x, getEntityRef_js_1.entityMember, {
|
|
1282
1312
|
//I've used define property to hide this member from console.lo g
|
|
1283
1313
|
get: function () { return helper; },
|
|
@@ -1302,7 +1332,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1302
1332
|
return this.getEntityRef(item).toApiJson(true);
|
|
1303
1333
|
};
|
|
1304
1334
|
RepositoryImplementation.prototype.fromJson = function (json, newRow) {
|
|
1305
|
-
var
|
|
1335
|
+
var e_21, _a;
|
|
1306
1336
|
var _this = this;
|
|
1307
1337
|
if (json === null || json === undefined)
|
|
1308
1338
|
return json;
|
|
@@ -1328,12 +1358,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1328
1358
|
}
|
|
1329
1359
|
}
|
|
1330
1360
|
}
|
|
1331
|
-
catch (
|
|
1361
|
+
catch (e_21_1) { e_21 = { error: e_21_1 }; }
|
|
1332
1362
|
finally {
|
|
1333
1363
|
try {
|
|
1334
1364
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1335
1365
|
}
|
|
1336
|
-
finally { if (
|
|
1366
|
+
finally { if (e_21) throw e_21.error; }
|
|
1337
1367
|
}
|
|
1338
1368
|
this._fixTypes(result);
|
|
1339
1369
|
if (newRow) {
|
|
@@ -1366,8 +1396,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1366
1396
|
};
|
|
1367
1397
|
RepositoryImplementation.prototype.deleteMany = function (_a) {
|
|
1368
1398
|
return tslib_1.__awaiter(this, arguments, void 0, function (_b) {
|
|
1369
|
-
var _c, _d, deleted, _e, _f, _g, item,
|
|
1370
|
-
var _h,
|
|
1399
|
+
var _c, _d, deleted, _e, _f, _g, item, e_22_1;
|
|
1400
|
+
var _h, e_22, _j, _k;
|
|
1371
1401
|
var where = _b.where;
|
|
1372
1402
|
return tslib_1.__generator(this, function (_l) {
|
|
1373
1403
|
switch (_l.label) {
|
|
@@ -1400,8 +1430,8 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1400
1430
|
return [3 /*break*/, 4];
|
|
1401
1431
|
case 8: return [3 /*break*/, 15];
|
|
1402
1432
|
case 9:
|
|
1403
|
-
|
|
1404
|
-
|
|
1433
|
+
e_22_1 = _l.sent();
|
|
1434
|
+
e_22 = { error: e_22_1 };
|
|
1405
1435
|
return [3 /*break*/, 15];
|
|
1406
1436
|
case 10:
|
|
1407
1437
|
_l.trys.push([10, , 13, 14]);
|
|
@@ -1412,7 +1442,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1412
1442
|
_l.label = 12;
|
|
1413
1443
|
case 12: return [3 /*break*/, 14];
|
|
1414
1444
|
case 13:
|
|
1415
|
-
if (
|
|
1445
|
+
if (e_22) throw e_22.error;
|
|
1416
1446
|
return [7 /*endfinally*/];
|
|
1417
1447
|
case 14: return [7 /*endfinally*/];
|
|
1418
1448
|
case 15: return [2 /*return*/, deleted];
|
|
@@ -1503,7 +1533,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1503
1533
|
return this.metadata.fields.toArray().filter(function (x) { return keys.includes(x.key); });
|
|
1504
1534
|
};
|
|
1505
1535
|
RepositoryImplementation.prototype.create = function (item) {
|
|
1506
|
-
var
|
|
1536
|
+
var e_23, _a;
|
|
1507
1537
|
var _b;
|
|
1508
1538
|
var r = new this._entity(this._remult);
|
|
1509
1539
|
if (item) {
|
|
@@ -1514,12 +1544,12 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1514
1544
|
r[key] = item[key];
|
|
1515
1545
|
}
|
|
1516
1546
|
}
|
|
1517
|
-
catch (
|
|
1547
|
+
catch (e_23_1) { e_23 = { error: e_23_1 }; }
|
|
1518
1548
|
finally {
|
|
1519
1549
|
try {
|
|
1520
1550
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
1521
1551
|
}
|
|
1522
|
-
finally { if (
|
|
1552
|
+
finally { if (e_23) throw e_23.error; }
|
|
1523
1553
|
}
|
|
1524
1554
|
this._fixTypes(r);
|
|
1525
1555
|
}
|
|
@@ -1533,7 +1563,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1533
1563
|
RepositoryImplementation.prototype._fixTypes = function (item) {
|
|
1534
1564
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
1535
1565
|
var _a, _b, field, val, _c, _d, _e, type, typeName;
|
|
1536
|
-
var
|
|
1566
|
+
var e_24, _f, e_25, _g;
|
|
1537
1567
|
return tslib_1.__generator(this, function (_h) {
|
|
1538
1568
|
try {
|
|
1539
1569
|
for (_a = tslib_1.__values(this._fieldsOf(item)), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
@@ -1544,7 +1574,7 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1544
1574
|
item[field.key] = field.valueConverter.fromJson(field.valueConverter.toJson(val));
|
|
1545
1575
|
else
|
|
1546
1576
|
try {
|
|
1547
|
-
for (_c = (
|
|
1577
|
+
for (_c = (e_25 = void 0, tslib_1.__values([
|
|
1548
1578
|
[String, 'string'],
|
|
1549
1579
|
[Number, 'number'],
|
|
1550
1580
|
[Boolean, 'boolean'],
|
|
@@ -1554,22 +1584,22 @@ var RepositoryImplementation = /** @class */ (function () {
|
|
|
1554
1584
|
item[field.key] = field.valueConverter.fromJson(field.valueConverter.toJson(val));
|
|
1555
1585
|
}
|
|
1556
1586
|
}
|
|
1557
|
-
catch (
|
|
1587
|
+
catch (e_25_1) { e_25 = { error: e_25_1 }; }
|
|
1558
1588
|
finally {
|
|
1559
1589
|
try {
|
|
1560
1590
|
if (_d && !_d.done && (_g = _c.return)) _g.call(_c);
|
|
1561
1591
|
}
|
|
1562
|
-
finally { if (
|
|
1592
|
+
finally { if (e_25) throw e_25.error; }
|
|
1563
1593
|
}
|
|
1564
1594
|
}
|
|
1565
1595
|
}
|
|
1566
1596
|
}
|
|
1567
|
-
catch (
|
|
1597
|
+
catch (e_24_1) { e_24 = { error: e_24_1 }; }
|
|
1568
1598
|
finally {
|
|
1569
1599
|
try {
|
|
1570
1600
|
if (_b && !_b.done && (_f = _a.return)) _f.call(_a);
|
|
1571
1601
|
}
|
|
1572
|
-
finally { if (
|
|
1602
|
+
finally { if (e_24) throw e_24.error; }
|
|
1573
1603
|
}
|
|
1574
1604
|
return [2 /*return*/, item];
|
|
1575
1605
|
});
|
|
@@ -1646,7 +1676,7 @@ function createOldEntity(entity, remult) {
|
|
|
1646
1676
|
var key = (0, getEntityRef_js_1.getEntityKey)(entity);
|
|
1647
1677
|
var base = Object.getPrototypeOf(entity);
|
|
1648
1678
|
var _loop_3 = function () {
|
|
1649
|
-
var
|
|
1679
|
+
var e_26, _a;
|
|
1650
1680
|
var baseCols = remult_static_js_1.remultStatic.columnsOfType.get(base);
|
|
1651
1681
|
if (baseCols) {
|
|
1652
1682
|
r.unshift.apply(r, tslib_1.__spreadArray([], tslib_1.__read(baseCols.filter(function (x) { return !r.find(function (y) { return y.key == x.key; }); })), false));
|
|
@@ -1689,17 +1719,17 @@ function createOldEntity(entity, remult) {
|
|
|
1689
1719
|
}
|
|
1690
1720
|
};
|
|
1691
1721
|
try {
|
|
1692
|
-
for (var functions_1 = (
|
|
1722
|
+
for (var functions_1 = (e_26 = void 0, tslib_1.__values(functions)), functions_1_1 = functions_1.next(); !functions_1_1.done; functions_1_1 = functions_1.next()) {
|
|
1693
1723
|
var key_1 = functions_1_1.value;
|
|
1694
1724
|
_loop_4(key_1);
|
|
1695
1725
|
}
|
|
1696
1726
|
}
|
|
1697
|
-
catch (
|
|
1727
|
+
catch (e_26_1) { e_26 = { error: e_26_1 }; }
|
|
1698
1728
|
finally {
|
|
1699
1729
|
try {
|
|
1700
1730
|
if (functions_1_1 && !functions_1_1.done && (_a = functions_1.return)) _a.call(functions_1);
|
|
1701
1731
|
}
|
|
1702
|
-
finally { if (
|
|
1732
|
+
finally { if (e_26) throw e_26.error; }
|
|
1703
1733
|
}
|
|
1704
1734
|
}
|
|
1705
1735
|
base = Object.getPrototypeOf(base);
|
|
@@ -1710,8 +1740,8 @@ function createOldEntity(entity, remult) {
|
|
|
1710
1740
|
return new EntityFullInfo(prepareColumnInfo(r, remult), info, remult, entity, key);
|
|
1711
1741
|
}
|
|
1712
1742
|
var rowHelperBase = /** @class */ (function () {
|
|
1713
|
-
function rowHelperBase(fieldsMetadata, instance, remult, isNewRow) {
|
|
1714
|
-
var
|
|
1743
|
+
function rowHelperBase(fieldsMetadata, instance, remult, isNewRow, excludeRelationMembers) {
|
|
1744
|
+
var e_27, _a;
|
|
1715
1745
|
var _this = this;
|
|
1716
1746
|
this.fieldsMetadata = fieldsMetadata;
|
|
1717
1747
|
this.instance = instance;
|
|
@@ -1759,7 +1789,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1759
1789
|
}
|
|
1760
1790
|
refImpl_1._subscribers.reportChanged();
|
|
1761
1791
|
},
|
|
1762
|
-
enumerable:
|
|
1792
|
+
enumerable: !(excludeRelationMembers === null || excludeRelationMembers === void 0 ? void 0 : excludeRelationMembers.has(col.key)),
|
|
1763
1793
|
});
|
|
1764
1794
|
lookup_1.set(val);
|
|
1765
1795
|
}
|
|
@@ -1793,7 +1823,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1793
1823
|
}
|
|
1794
1824
|
}
|
|
1795
1825
|
},
|
|
1796
|
-
enumerable:
|
|
1826
|
+
enumerable: !(excludeRelationMembers === null || excludeRelationMembers === void 0 ? void 0 : excludeRelationMembers.has(col.key)),
|
|
1797
1827
|
});
|
|
1798
1828
|
if (hasVal)
|
|
1799
1829
|
instance[col.key] = val_1;
|
|
@@ -1807,12 +1837,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1807
1837
|
_loop_5(col);
|
|
1808
1838
|
}
|
|
1809
1839
|
}
|
|
1810
|
-
catch (
|
|
1840
|
+
catch (e_27_1) { e_27 = { error: e_27_1 }; }
|
|
1811
1841
|
finally {
|
|
1812
1842
|
try {
|
|
1813
1843
|
if (fieldsMetadata_1_1 && !fieldsMetadata_1_1.done && (_a = fieldsMetadata_1.return)) _a.call(fieldsMetadata_1);
|
|
1814
1844
|
}
|
|
1815
|
-
finally { if (
|
|
1845
|
+
finally { if (e_27) throw e_27.error; }
|
|
1816
1846
|
}
|
|
1817
1847
|
}
|
|
1818
1848
|
Object.defineProperty(rowHelperBase.prototype, "error", {
|
|
@@ -1834,7 +1864,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1834
1864
|
return this._subscribers.subscribe(listener);
|
|
1835
1865
|
};
|
|
1836
1866
|
rowHelperBase.prototype.initSubscribers = function () {
|
|
1837
|
-
var
|
|
1867
|
+
var e_28, _a;
|
|
1838
1868
|
if (!this._subscribers) {
|
|
1839
1869
|
this._subscribers = new SubscribableImp();
|
|
1840
1870
|
var safeSubscribers_1 = this._subscribers;
|
|
@@ -1868,12 +1898,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1868
1898
|
_loop_6(col);
|
|
1869
1899
|
}
|
|
1870
1900
|
}
|
|
1871
|
-
catch (
|
|
1901
|
+
catch (e_28_1) { e_28 = { error: e_28_1 }; }
|
|
1872
1902
|
finally {
|
|
1873
1903
|
try {
|
|
1874
1904
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1875
1905
|
}
|
|
1876
|
-
finally { if (
|
|
1906
|
+
finally { if (e_28) throw e_28.error; }
|
|
1877
1907
|
}
|
|
1878
1908
|
}
|
|
1879
1909
|
};
|
|
@@ -1908,7 +1938,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1908
1938
|
throw this.buildErrorInfoObject();
|
|
1909
1939
|
};
|
|
1910
1940
|
rowHelperBase.prototype.buildErrorInfoObject = function () {
|
|
1911
|
-
var
|
|
1941
|
+
var e_29, _a;
|
|
1912
1942
|
var _b;
|
|
1913
1943
|
var error = {
|
|
1914
1944
|
modelState: Object.assign({}, this.errors),
|
|
@@ -1928,12 +1958,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1928
1958
|
}
|
|
1929
1959
|
}
|
|
1930
1960
|
}
|
|
1931
|
-
catch (
|
|
1961
|
+
catch (e_29_1) { e_29 = { error: e_29_1 }; }
|
|
1932
1962
|
finally {
|
|
1933
1963
|
try {
|
|
1934
1964
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
1935
1965
|
}
|
|
1936
|
-
finally { if (
|
|
1966
|
+
finally { if (e_29) throw e_29.error; }
|
|
1937
1967
|
}
|
|
1938
1968
|
}
|
|
1939
1969
|
return error;
|
|
@@ -1967,7 +1997,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1967
1997
|
this._reportChangedToEntityAndFields();
|
|
1968
1998
|
};
|
|
1969
1999
|
rowHelperBase.prototype._reportChangedToEntityAndFields = function () {
|
|
1970
|
-
var
|
|
2000
|
+
var e_30, _a;
|
|
1971
2001
|
if (this._subscribers) {
|
|
1972
2002
|
this._subscribers.reportChanged();
|
|
1973
2003
|
try {
|
|
@@ -1977,12 +2007,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1977
2007
|
ref._subscribers.reportChanged();
|
|
1978
2008
|
}
|
|
1979
2009
|
}
|
|
1980
|
-
catch (
|
|
2010
|
+
catch (e_30_1) { e_30 = { error: e_30_1 }; }
|
|
1981
2011
|
finally {
|
|
1982
2012
|
try {
|
|
1983
2013
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1984
2014
|
}
|
|
1985
|
-
finally { if (
|
|
2015
|
+
finally { if (e_30) throw e_30.error; }
|
|
1986
2016
|
}
|
|
1987
2017
|
}
|
|
1988
2018
|
};
|
|
@@ -1992,7 +2022,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
1992
2022
|
return !!!this.error && this.errors == undefined;
|
|
1993
2023
|
};
|
|
1994
2024
|
rowHelperBase.prototype.copyDataToObject = function (isNew) {
|
|
1995
|
-
var
|
|
2025
|
+
var e_31, _a;
|
|
1996
2026
|
if (isNew === void 0) { isNew = false; }
|
|
1997
2027
|
var d = {};
|
|
1998
2028
|
try {
|
|
@@ -2024,12 +2054,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2024
2054
|
}
|
|
2025
2055
|
}
|
|
2026
2056
|
}
|
|
2027
|
-
catch (
|
|
2057
|
+
catch (e_31_1) { e_31 = { error: e_31_1 }; }
|
|
2028
2058
|
finally {
|
|
2029
2059
|
try {
|
|
2030
2060
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2031
2061
|
}
|
|
2032
|
-
finally { if (
|
|
2062
|
+
finally { if (e_31) throw e_31.error; }
|
|
2033
2063
|
}
|
|
2034
2064
|
return d;
|
|
2035
2065
|
};
|
|
@@ -2089,7 +2119,7 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2089
2119
|
}); });
|
|
2090
2120
|
};
|
|
2091
2121
|
rowHelperBase.prototype.toApiJson = function (includeRelatedEntities, notJustApi) {
|
|
2092
|
-
var
|
|
2122
|
+
var e_32, _a;
|
|
2093
2123
|
if (includeRelatedEntities === void 0) { includeRelatedEntities = false; }
|
|
2094
2124
|
if (notJustApi === void 0) { notJustApi = false; }
|
|
2095
2125
|
var result = {};
|
|
@@ -2129,19 +2159,19 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2129
2159
|
}
|
|
2130
2160
|
}
|
|
2131
2161
|
}
|
|
2132
|
-
catch (
|
|
2162
|
+
catch (e_32_1) { e_32 = { error: e_32_1 }; }
|
|
2133
2163
|
finally {
|
|
2134
2164
|
try {
|
|
2135
2165
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2136
2166
|
}
|
|
2137
|
-
finally { if (
|
|
2167
|
+
finally { if (e_32) throw e_32.error; }
|
|
2138
2168
|
}
|
|
2139
2169
|
return result;
|
|
2140
2170
|
};
|
|
2141
2171
|
rowHelperBase.prototype._updateEntityBasedOnApi = function (body_1) {
|
|
2142
2172
|
return tslib_1.__awaiter(this, arguments, void 0, function (body, ignoreApiAllowed) {
|
|
2143
2173
|
var keys, _a, _b, col, lu;
|
|
2144
|
-
var
|
|
2174
|
+
var e_33, _c;
|
|
2145
2175
|
if (ignoreApiAllowed === void 0) { ignoreApiAllowed = false; }
|
|
2146
2176
|
return tslib_1.__generator(this, function (_d) {
|
|
2147
2177
|
switch (_d.label) {
|
|
@@ -2164,12 +2194,12 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2164
2194
|
}
|
|
2165
2195
|
}
|
|
2166
2196
|
}
|
|
2167
|
-
catch (
|
|
2197
|
+
catch (e_33_1) { e_33 = { error: e_33_1 }; }
|
|
2168
2198
|
finally {
|
|
2169
2199
|
try {
|
|
2170
2200
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2171
2201
|
}
|
|
2172
|
-
finally { if (
|
|
2202
|
+
finally { if (e_33) throw e_33.error; }
|
|
2173
2203
|
}
|
|
2174
2204
|
return [4 /*yield*/, promiseAll(tslib_1.__spreadArray([], tslib_1.__read(this.fields), false).filter(function (f) { return !(0, relationInfoMember_js_1.getRelationFieldInfo)(f.metadata); }), function (x) { return x.load(); })];
|
|
2175
2205
|
case 1:
|
|
@@ -2183,9 +2213,9 @@ var rowHelperBase = /** @class */ (function () {
|
|
|
2183
2213
|
}());
|
|
2184
2214
|
var rowHelperImplementation = /** @class */ (function (_super) {
|
|
2185
2215
|
tslib_1.__extends(rowHelperImplementation, _super);
|
|
2186
|
-
function rowHelperImplementation(info, instance, repo, edp, remult, _isNew) {
|
|
2187
|
-
var
|
|
2188
|
-
var _this = _super.call(this, info.fieldsMetadata, instance, remult, _isNew) || this;
|
|
2216
|
+
function rowHelperImplementation(info, instance, repo, edp, remult, _isNew, excludeRelationMembers) {
|
|
2217
|
+
var e_34, _a;
|
|
2218
|
+
var _this = _super.call(this, info.fieldsMetadata, instance, remult, _isNew, excludeRelationMembers) || this;
|
|
2189
2219
|
_this.info = info;
|
|
2190
2220
|
_this.repo = repo;
|
|
2191
2221
|
_this.edp = edp;
|
|
@@ -2208,12 +2238,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2208
2238
|
}
|
|
2209
2239
|
}
|
|
2210
2240
|
}
|
|
2211
|
-
catch (
|
|
2241
|
+
catch (e_34_1) { e_34 = { error: e_34_1 }; }
|
|
2212
2242
|
finally {
|
|
2213
2243
|
try {
|
|
2214
2244
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
2215
2245
|
}
|
|
2216
|
-
finally { if (
|
|
2246
|
+
finally { if (e_34) throw e_34.error; }
|
|
2217
2247
|
}
|
|
2218
2248
|
}
|
|
2219
2249
|
if (_this.info.entityInfo.entityRefInit)
|
|
@@ -2315,7 +2345,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2315
2345
|
};
|
|
2316
2346
|
Object.defineProperty(rowHelperImplementation.prototype, "fields", {
|
|
2317
2347
|
get: function () {
|
|
2318
|
-
var _a,
|
|
2348
|
+
var _a, e_35, _b;
|
|
2319
2349
|
if (!this._columns) {
|
|
2320
2350
|
var _items_1 = [];
|
|
2321
2351
|
var r_1 = (_a = {
|
|
@@ -2336,12 +2366,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2336
2366
|
(r_1[c.key] = new FieldRefImplementation(c.options, c, this.instance, this, this)));
|
|
2337
2367
|
}
|
|
2338
2368
|
}
|
|
2339
|
-
catch (
|
|
2369
|
+
catch (e_35_1) { e_35 = { error: e_35_1 }; }
|
|
2340
2370
|
finally {
|
|
2341
2371
|
try {
|
|
2342
2372
|
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
2343
2373
|
}
|
|
2344
|
-
finally { if (
|
|
2374
|
+
finally { if (e_35) throw e_35.error; }
|
|
2345
2375
|
}
|
|
2346
2376
|
this._columns = r_1;
|
|
2347
2377
|
}
|
|
@@ -2352,8 +2382,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2352
2382
|
});
|
|
2353
2383
|
rowHelperImplementation.prototype.save = function (onlyTheseFieldsSentOnlyInTheCaseOfProxySaveWithPartialObject) {
|
|
2354
2384
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2355
|
-
var doNotSave_1, e, _a, _b, col,
|
|
2356
|
-
var
|
|
2385
|
+
var doNotSave_1, e, _a, _b, col, e_36_1, d, ignoreKeys, _c, _d, field, f, updatedRow, isNew, _e, _f, changesOnly, wasChanged, key, element, _g, _h, _j, _k, listener, e_37_1, err_1;
|
|
2386
|
+
var e_36, _l, e_38, _m, _o, _p, e_37, _q;
|
|
2357
2387
|
var _r, _s;
|
|
2358
2388
|
return tslib_1.__generator(this, function (_t) {
|
|
2359
2389
|
switch (_t.label) {
|
|
@@ -2395,14 +2425,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2395
2425
|
return [3 /*break*/, 4];
|
|
2396
2426
|
case 7: return [3 /*break*/, 10];
|
|
2397
2427
|
case 8:
|
|
2398
|
-
|
|
2399
|
-
|
|
2428
|
+
e_36_1 = _t.sent();
|
|
2429
|
+
e_36 = { error: e_36_1 };
|
|
2400
2430
|
return [3 /*break*/, 10];
|
|
2401
2431
|
case 9:
|
|
2402
2432
|
try {
|
|
2403
2433
|
if (_b && !_b.done && (_l = _a.return)) _l.call(_a);
|
|
2404
2434
|
}
|
|
2405
|
-
finally { if (
|
|
2435
|
+
finally { if (e_36) throw e_36.error; }
|
|
2406
2436
|
return [7 /*endfinally*/];
|
|
2407
2437
|
case 10:
|
|
2408
2438
|
if (!this.info.entityInfo.saving) return [3 /*break*/, 12];
|
|
@@ -2428,12 +2458,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2428
2458
|
}
|
|
2429
2459
|
}
|
|
2430
2460
|
}
|
|
2431
|
-
catch (
|
|
2461
|
+
catch (e_38_1) { e_38 = { error: e_38_1 }; }
|
|
2432
2462
|
finally {
|
|
2433
2463
|
try {
|
|
2434
2464
|
if (_d && !_d.done && (_m = _c.return)) _m.call(_c);
|
|
2435
2465
|
}
|
|
2436
|
-
finally { if (
|
|
2466
|
+
finally { if (e_38) throw e_38.error; }
|
|
2437
2467
|
}
|
|
2438
2468
|
updatedRow = void 0;
|
|
2439
2469
|
isNew = this.isNew();
|
|
@@ -2519,14 +2549,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2519
2549
|
return [3 /*break*/, 30];
|
|
2520
2550
|
case 33: return [3 /*break*/, 36];
|
|
2521
2551
|
case 34:
|
|
2522
|
-
|
|
2523
|
-
|
|
2552
|
+
e_37_1 = _t.sent();
|
|
2553
|
+
e_37 = { error: e_37_1 };
|
|
2524
2554
|
return [3 /*break*/, 36];
|
|
2525
2555
|
case 35:
|
|
2526
2556
|
try {
|
|
2527
2557
|
if (_k && !_k.done && (_q = _j.return)) _q.call(_j);
|
|
2528
2558
|
}
|
|
2529
|
-
finally { if (
|
|
2559
|
+
finally { if (e_37) throw e_37.error; }
|
|
2530
2560
|
return [7 /*endfinally*/];
|
|
2531
2561
|
case 36:
|
|
2532
2562
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [{ id: this.getId(), oldId: this.getOriginalId(), deleted: false }]);
|
|
@@ -2565,7 +2595,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2565
2595
|
rowHelperImplementation.prototype.buildDtoForInsert = function () {
|
|
2566
2596
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2567
2597
|
var d, _a, _b, field, f;
|
|
2568
|
-
var
|
|
2598
|
+
var e_39, _c;
|
|
2569
2599
|
return tslib_1.__generator(this, function (_d) {
|
|
2570
2600
|
switch (_d.label) {
|
|
2571
2601
|
case 0: return [4 /*yield*/, this.__validateEntity()];
|
|
@@ -2583,12 +2613,12 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2583
2613
|
}
|
|
2584
2614
|
}
|
|
2585
2615
|
}
|
|
2586
|
-
catch (
|
|
2616
|
+
catch (e_39_1) { e_39 = { error: e_39_1 }; }
|
|
2587
2617
|
finally {
|
|
2588
2618
|
try {
|
|
2589
2619
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2590
2620
|
}
|
|
2591
|
-
finally { if (
|
|
2621
|
+
finally { if (e_39) throw e_39.error; }
|
|
2592
2622
|
}
|
|
2593
2623
|
return [2 /*return*/, d];
|
|
2594
2624
|
}
|
|
@@ -2621,8 +2651,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2621
2651
|
};
|
|
2622
2652
|
rowHelperImplementation.prototype.delete = function () {
|
|
2623
2653
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2624
|
-
var doDelete, e, _a, _b, listener,
|
|
2625
|
-
var
|
|
2654
|
+
var doDelete, e, _a, _b, listener, e_40_1, err_2;
|
|
2655
|
+
var e_40, _c;
|
|
2626
2656
|
var _d;
|
|
2627
2657
|
return tslib_1.__generator(this, function (_e) {
|
|
2628
2658
|
switch (_e.label) {
|
|
@@ -2674,14 +2704,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2674
2704
|
return [3 /*break*/, 9];
|
|
2675
2705
|
case 12: return [3 /*break*/, 15];
|
|
2676
2706
|
case 13:
|
|
2677
|
-
|
|
2678
|
-
|
|
2707
|
+
e_40_1 = _e.sent();
|
|
2708
|
+
e_40 = { error: e_40_1 };
|
|
2679
2709
|
return [3 /*break*/, 15];
|
|
2680
2710
|
case 14:
|
|
2681
2711
|
try {
|
|
2682
2712
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2683
2713
|
}
|
|
2684
|
-
finally { if (
|
|
2714
|
+
finally { if (e_40) throw e_40.error; }
|
|
2685
2715
|
return [7 /*endfinally*/];
|
|
2686
2716
|
case 15:
|
|
2687
2717
|
this.repo._remult.liveQueryPublisher.itemChanged(this.repo.metadata.key, [
|
|
@@ -2700,8 +2730,8 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2700
2730
|
};
|
|
2701
2731
|
rowHelperImplementation.prototype.loadDataFrom = function (data, loadItems) {
|
|
2702
2732
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2703
|
-
var _a, _b, col, lu,
|
|
2704
|
-
var
|
|
2733
|
+
var _a, _b, col, lu, e_41_1;
|
|
2734
|
+
var e_41, _c;
|
|
2705
2735
|
return tslib_1.__generator(this, function (_d) {
|
|
2706
2736
|
switch (_d.label) {
|
|
2707
2737
|
case 0:
|
|
@@ -2730,21 +2760,24 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2730
2760
|
case 6: return [3 /*break*/, 8];
|
|
2731
2761
|
case 7:
|
|
2732
2762
|
if (!(0, relationInfoMember_js_1.getRelationFieldInfo)(col))
|
|
2733
|
-
|
|
2763
|
+
if (data[col.key] === undefined)
|
|
2764
|
+
delete this.instance[col.key];
|
|
2765
|
+
else
|
|
2766
|
+
this.instance[col.key] = data[col.key];
|
|
2734
2767
|
_d.label = 8;
|
|
2735
2768
|
case 8:
|
|
2736
2769
|
_b = _a.next();
|
|
2737
2770
|
return [3 /*break*/, 1];
|
|
2738
2771
|
case 9: return [3 /*break*/, 12];
|
|
2739
2772
|
case 10:
|
|
2740
|
-
|
|
2741
|
-
|
|
2773
|
+
e_41_1 = _d.sent();
|
|
2774
|
+
e_41 = { error: e_41_1 };
|
|
2742
2775
|
return [3 /*break*/, 12];
|
|
2743
2776
|
case 11:
|
|
2744
2777
|
try {
|
|
2745
2778
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2746
2779
|
}
|
|
2747
|
-
finally { if (
|
|
2780
|
+
finally { if (e_41) throw e_41.error; }
|
|
2748
2781
|
return [7 /*endfinally*/];
|
|
2749
2782
|
case 12: return [4 /*yield*/, this.calcServerExpression()];
|
|
2750
2783
|
case 13:
|
|
@@ -2760,41 +2793,40 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2760
2793
|
};
|
|
2761
2794
|
rowHelperImplementation.prototype.calcServerExpression = function () {
|
|
2762
2795
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2763
|
-
var _a, _b, col,
|
|
2764
|
-
var
|
|
2765
|
-
return tslib_1.__generator(this, function (
|
|
2766
|
-
switch (
|
|
2796
|
+
var _a, _b, col, result, e_42_1;
|
|
2797
|
+
var e_42, _c;
|
|
2798
|
+
return tslib_1.__generator(this, function (_d) {
|
|
2799
|
+
switch (_d.label) {
|
|
2767
2800
|
case 0:
|
|
2768
|
-
if (
|
|
2769
|
-
|
|
2801
|
+
if (!!this.repo._dataProvider.isProxy) return [3 /*break*/, 8];
|
|
2802
|
+
_d.label = 1;
|
|
2770
2803
|
case 1:
|
|
2771
|
-
|
|
2804
|
+
_d.trys.push([1, 6, 7, 8]);
|
|
2772
2805
|
_a = tslib_1.__values(this.info.fieldsMetadata), _b = _a.next();
|
|
2773
|
-
|
|
2806
|
+
_d.label = 2;
|
|
2774
2807
|
case 2:
|
|
2775
2808
|
if (!!_b.done) return [3 /*break*/, 5];
|
|
2776
2809
|
col = _b.value;
|
|
2777
2810
|
if (!col.options.serverExpression) return [3 /*break*/, 4];
|
|
2778
|
-
_c = this.instance;
|
|
2779
|
-
_d = col.key;
|
|
2780
2811
|
return [4 /*yield*/, col.options.serverExpression(this.instance)];
|
|
2781
2812
|
case 3:
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2813
|
+
result = (_d.sent());
|
|
2814
|
+
if (result !== undefined)
|
|
2815
|
+
this.instance[col.key] = result;
|
|
2816
|
+
_d.label = 4;
|
|
2785
2817
|
case 4:
|
|
2786
2818
|
_b = _a.next();
|
|
2787
2819
|
return [3 /*break*/, 2];
|
|
2788
2820
|
case 5: return [3 /*break*/, 8];
|
|
2789
2821
|
case 6:
|
|
2790
|
-
|
|
2791
|
-
|
|
2822
|
+
e_42_1 = _d.sent();
|
|
2823
|
+
e_42 = { error: e_42_1 };
|
|
2792
2824
|
return [3 /*break*/, 8];
|
|
2793
2825
|
case 7:
|
|
2794
2826
|
try {
|
|
2795
|
-
if (_b && !_b.done && (
|
|
2827
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
2796
2828
|
}
|
|
2797
|
-
finally { if (
|
|
2829
|
+
finally { if (e_42) throw e_42.error; }
|
|
2798
2830
|
return [7 /*endfinally*/];
|
|
2799
2831
|
case 8: return [2 /*return*/];
|
|
2800
2832
|
}
|
|
@@ -2807,7 +2839,7 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2807
2839
|
return this._isNew;
|
|
2808
2840
|
};
|
|
2809
2841
|
rowHelperImplementation.prototype.wasChanged = function () {
|
|
2810
|
-
var
|
|
2842
|
+
var e_43, _a;
|
|
2811
2843
|
var _b;
|
|
2812
2844
|
(_b = this._subscribers) === null || _b === void 0 ? void 0 : _b.reportObserved();
|
|
2813
2845
|
try {
|
|
@@ -2819,19 +2851,19 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2819
2851
|
return true;
|
|
2820
2852
|
}
|
|
2821
2853
|
}
|
|
2822
|
-
catch (
|
|
2854
|
+
catch (e_43_1) { e_43 = { error: e_43_1 }; }
|
|
2823
2855
|
finally {
|
|
2824
2856
|
try {
|
|
2825
2857
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2826
2858
|
}
|
|
2827
|
-
finally { if (
|
|
2859
|
+
finally { if (e_43) throw e_43.error; }
|
|
2828
2860
|
}
|
|
2829
2861
|
return false;
|
|
2830
2862
|
};
|
|
2831
2863
|
rowHelperImplementation.prototype.__performColumnAndEntityValidations = function () {
|
|
2832
2864
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2833
|
-
var _a, _b, c, col,
|
|
2834
|
-
var
|
|
2865
|
+
var _a, _b, c, col, e_44_1, e, _c, _d, listener, e_45_1;
|
|
2866
|
+
var e_44, _e, e_45, _f;
|
|
2835
2867
|
var _g;
|
|
2836
2868
|
return tslib_1.__generator(this, function (_h) {
|
|
2837
2869
|
switch (_h.label) {
|
|
@@ -2853,14 +2885,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2853
2885
|
return [3 /*break*/, 1];
|
|
2854
2886
|
case 4: return [3 /*break*/, 7];
|
|
2855
2887
|
case 5:
|
|
2856
|
-
|
|
2857
|
-
|
|
2888
|
+
e_44_1 = _h.sent();
|
|
2889
|
+
e_44 = { error: e_44_1 };
|
|
2858
2890
|
return [3 /*break*/, 7];
|
|
2859
2891
|
case 6:
|
|
2860
2892
|
try {
|
|
2861
2893
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
2862
2894
|
}
|
|
2863
|
-
finally { if (
|
|
2895
|
+
finally { if (e_44) throw e_44.error; }
|
|
2864
2896
|
return [7 /*endfinally*/];
|
|
2865
2897
|
case 7:
|
|
2866
2898
|
if (!this.info.entityInfo.validation) return [3 /*break*/, 9];
|
|
@@ -2888,14 +2920,14 @@ var rowHelperImplementation = /** @class */ (function (_super) {
|
|
|
2888
2920
|
return [3 /*break*/, 11];
|
|
2889
2921
|
case 14: return [3 /*break*/, 17];
|
|
2890
2922
|
case 15:
|
|
2891
|
-
|
|
2892
|
-
|
|
2923
|
+
e_45_1 = _h.sent();
|
|
2924
|
+
e_45 = { error: e_45_1 };
|
|
2893
2925
|
return [3 /*break*/, 17];
|
|
2894
2926
|
case 16:
|
|
2895
2927
|
try {
|
|
2896
2928
|
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
2897
2929
|
}
|
|
2898
|
-
finally { if (
|
|
2930
|
+
finally { if (e_45) throw e_45.error; }
|
|
2899
2931
|
return [7 /*endfinally*/];
|
|
2900
2932
|
case 17: return [2 /*return*/];
|
|
2901
2933
|
}
|
|
@@ -2942,7 +2974,7 @@ function getControllerRef(container, remultArg) {
|
|
|
2942
2974
|
var controllerRefImpl = /** @class */ (function (_super) {
|
|
2943
2975
|
tslib_1.__extends(controllerRefImpl, _super);
|
|
2944
2976
|
function controllerRefImpl(columnsInfo, instance, remult) {
|
|
2945
|
-
var _a,
|
|
2977
|
+
var _a, e_46, _b;
|
|
2946
2978
|
var _this = _super.call(this, columnsInfo, instance, remult, false) || this;
|
|
2947
2979
|
var _items = [];
|
|
2948
2980
|
var r = (_a = {
|
|
@@ -2959,20 +2991,20 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
2959
2991
|
_items.push((r[col.key] = new FieldRefImplementation(col.options, col, instance, undefined, _this)));
|
|
2960
2992
|
}
|
|
2961
2993
|
}
|
|
2962
|
-
catch (
|
|
2994
|
+
catch (e_46_1) { e_46 = { error: e_46_1 }; }
|
|
2963
2995
|
finally {
|
|
2964
2996
|
try {
|
|
2965
2997
|
if (columnsInfo_1_1 && !columnsInfo_1_1.done && (_b = columnsInfo_1.return)) _b.call(columnsInfo_1);
|
|
2966
2998
|
}
|
|
2967
|
-
finally { if (
|
|
2999
|
+
finally { if (e_46) throw e_46.error; }
|
|
2968
3000
|
}
|
|
2969
3001
|
_this.fields = r;
|
|
2970
3002
|
return _this;
|
|
2971
3003
|
}
|
|
2972
3004
|
controllerRefImpl.prototype.__performColumnAndEntityValidations = function () {
|
|
2973
3005
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
2974
|
-
var _a, _b, col,
|
|
2975
|
-
var
|
|
3006
|
+
var _a, _b, col, e_47_1;
|
|
3007
|
+
var e_47, _c;
|
|
2976
3008
|
return tslib_1.__generator(this, function (_d) {
|
|
2977
3009
|
switch (_d.label) {
|
|
2978
3010
|
case 0:
|
|
@@ -2992,14 +3024,14 @@ var controllerRefImpl = /** @class */ (function (_super) {
|
|
|
2992
3024
|
return [3 /*break*/, 1];
|
|
2993
3025
|
case 4: return [3 /*break*/, 7];
|
|
2994
3026
|
case 5:
|
|
2995
|
-
|
|
2996
|
-
|
|
3027
|
+
e_47_1 = _d.sent();
|
|
3028
|
+
e_47 = { error: e_47_1 };
|
|
2997
3029
|
return [3 /*break*/, 7];
|
|
2998
3030
|
case 6:
|
|
2999
3031
|
try {
|
|
3000
3032
|
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
|
3001
3033
|
}
|
|
3002
|
-
finally { if (
|
|
3034
|
+
finally { if (e_47) throw e_47.error; }
|
|
3003
3035
|
return [7 /*endfinally*/];
|
|
3004
3036
|
case 7: return [2 /*return*/];
|
|
3005
3037
|
}
|
|
@@ -3196,8 +3228,8 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3196
3228
|
};
|
|
3197
3229
|
FieldRefImplementation.prototype.__performValidation = function () {
|
|
3198
3230
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
3199
|
-
var processValidation, self_1, event_1, _a, _b, v, _c,
|
|
3200
|
-
var
|
|
3231
|
+
var processValidation, self_1, event_1, _a, _b, v, _c, e_48_1, _d, error_1;
|
|
3232
|
+
var e_48, _e;
|
|
3201
3233
|
var _this = this;
|
|
3202
3234
|
var _f, _g;
|
|
3203
3235
|
return tslib_1.__generator(this, function (_h) {
|
|
@@ -3251,14 +3283,14 @@ var FieldRefImplementation = /** @class */ (function () {
|
|
|
3251
3283
|
return [3 /*break*/, 2];
|
|
3252
3284
|
case 5: return [3 /*break*/, 8];
|
|
3253
3285
|
case 6:
|
|
3254
|
-
|
|
3255
|
-
|
|
3286
|
+
e_48_1 = _h.sent();
|
|
3287
|
+
e_48 = { error: e_48_1 };
|
|
3256
3288
|
return [3 /*break*/, 8];
|
|
3257
3289
|
case 7:
|
|
3258
3290
|
try {
|
|
3259
3291
|
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
3260
3292
|
}
|
|
3261
|
-
finally { if (
|
|
3293
|
+
finally { if (e_48) throw e_48.error; }
|
|
3262
3294
|
return [7 /*endfinally*/];
|
|
3263
3295
|
case 8: return [3 /*break*/, 11];
|
|
3264
3296
|
case 9:
|
|
@@ -3299,6 +3331,9 @@ exports.FieldRefImplementation = FieldRefImplementation;
|
|
|
3299
3331
|
var tempCaptionTransformer = {
|
|
3300
3332
|
transformCaption: function (remult, key, caption, entityMetaData) { return caption; },
|
|
3301
3333
|
};
|
|
3334
|
+
exports.fieldOptionsEnricher = remult_static_js_1.remultStatic.fieldOptionsEnricher || {
|
|
3335
|
+
enrichFieldOptions: function (options) { return options; },
|
|
3336
|
+
};
|
|
3302
3337
|
exports.CaptionTransformer = remult_static_js_1.remultStatic.captionTransformer ||
|
|
3303
3338
|
(remult_static_js_1.remultStatic.captionTransformer = tempCaptionTransformer);
|
|
3304
3339
|
function buildCaption(caption, key, remult, metaData) {
|
|
@@ -3409,7 +3444,7 @@ var columnDefsImpl = /** @class */ (function () {
|
|
|
3409
3444
|
exports.columnDefsImpl = columnDefsImpl;
|
|
3410
3445
|
var EntityFullInfo = /** @class */ (function () {
|
|
3411
3446
|
function EntityFullInfo(columnsInfo, entityInfo, remult, entityType, key) {
|
|
3412
|
-
var _a,
|
|
3447
|
+
var _a, e_49, _b;
|
|
3413
3448
|
var _this = this;
|
|
3414
3449
|
this.entityInfo = entityInfo;
|
|
3415
3450
|
this.remult = remult;
|
|
@@ -3513,12 +3548,12 @@ var EntityFullInfo = /** @class */ (function () {
|
|
|
3513
3548
|
this.fieldsMetadata.push((r[x.key] = new columnDefsImpl(x, this, remult)));
|
|
3514
3549
|
}
|
|
3515
3550
|
}
|
|
3516
|
-
catch (
|
|
3551
|
+
catch (e_49_1) { e_49 = { error: e_49_1 }; }
|
|
3517
3552
|
finally {
|
|
3518
3553
|
try {
|
|
3519
3554
|
if (columnsInfo_2_1 && !columnsInfo_2_1.done && (_b = columnsInfo_2.return)) _b.call(columnsInfo_2);
|
|
3520
3555
|
}
|
|
3521
|
-
finally { if (
|
|
3556
|
+
finally { if (e_49) throw e_49.error; }
|
|
3522
3557
|
}
|
|
3523
3558
|
this.fields = r;
|
|
3524
3559
|
this.caption = buildCaption(entityInfo.caption, this.key, remult, this);
|
|
@@ -3628,7 +3663,7 @@ function ValueListFieldType() {
|
|
|
3628
3663
|
}
|
|
3629
3664
|
var ValueListInfo = /** @class */ (function () {
|
|
3630
3665
|
function ValueListInfo(valueListType) {
|
|
3631
|
-
var
|
|
3666
|
+
var e_50, _a, _b;
|
|
3632
3667
|
var _this = this;
|
|
3633
3668
|
this.valueListType = valueListType;
|
|
3634
3669
|
this.byIdMap = new Map();
|
|
@@ -3666,12 +3701,12 @@ var ValueListInfo = /** @class */ (function () {
|
|
|
3666
3701
|
}
|
|
3667
3702
|
}
|
|
3668
3703
|
}
|
|
3669
|
-
catch (
|
|
3704
|
+
catch (e_50_1) { e_50 = { error: e_50_1 }; }
|
|
3670
3705
|
finally {
|
|
3671
3706
|
try {
|
|
3672
3707
|
if (options_1_1 && !options_1_1.done && (_a = options_1.return)) _a.call(options_1);
|
|
3673
3708
|
}
|
|
3674
|
-
finally { if (
|
|
3709
|
+
finally { if (e_50) throw e_50.error; }
|
|
3675
3710
|
}
|
|
3676
3711
|
if (this.values.find(function (s) { return s.id === undefined; }))
|
|
3677
3712
|
throw new Error("ValueType ".concat(this.valueListType, " has values without an id"));
|
|
@@ -3743,7 +3778,8 @@ function getValueList(type) {
|
|
|
3743
3778
|
exports.storableMember = Symbol.for('storableMember');
|
|
3744
3779
|
exports.fieldOptionalValuesFunctionKey = Symbol.for('fieldOptionalValues');
|
|
3745
3780
|
function buildOptions(options, remult) {
|
|
3746
|
-
var
|
|
3781
|
+
var e_51, _a;
|
|
3782
|
+
var _b;
|
|
3747
3783
|
var r = {};
|
|
3748
3784
|
try {
|
|
3749
3785
|
for (var options_2 = tslib_1.__values(options), options_2_1 = options_2.next(); !options_2_1.done; options_2_1 = options_2.next()) {
|
|
@@ -3759,13 +3795,14 @@ function buildOptions(options, remult) {
|
|
|
3759
3795
|
}
|
|
3760
3796
|
}
|
|
3761
3797
|
}
|
|
3762
|
-
catch (
|
|
3798
|
+
catch (e_51_1) { e_51 = { error: e_51_1 }; }
|
|
3763
3799
|
finally {
|
|
3764
3800
|
try {
|
|
3765
3801
|
if (options_2_1 && !options_2_1.done && (_a = options_2.return)) _a.call(options_2);
|
|
3766
3802
|
}
|
|
3767
|
-
finally { if (
|
|
3803
|
+
finally { if (e_51) throw e_51.error; }
|
|
3768
3804
|
}
|
|
3805
|
+
(_b = exports.fieldOptionsEnricher.enrichFieldOptions) === null || _b === void 0 ? void 0 : _b.call(exports.fieldOptionsEnricher, r);
|
|
3769
3806
|
return r;
|
|
3770
3807
|
}
|
|
3771
3808
|
function decorateColumnSettings(settings, remult) {
|
|
@@ -3806,7 +3843,7 @@ function decorateColumnSettings(settings, remult) {
|
|
|
3806
3843
|
};
|
|
3807
3844
|
settings.valueConverter = new Proxy(settings.valueConverter, {
|
|
3808
3845
|
get: function (target, property) {
|
|
3809
|
-
var
|
|
3846
|
+
var e_52, _a;
|
|
3810
3847
|
if (target[property] === undefined) {
|
|
3811
3848
|
if (isIdNumeric_1 === undefined) {
|
|
3812
3849
|
if (property === 'inputType')
|
|
@@ -3829,12 +3866,12 @@ function decorateColumnSettings(settings, remult) {
|
|
|
3829
3866
|
: valueConverters_js_1.ValueConverters.String[key];
|
|
3830
3867
|
}
|
|
3831
3868
|
}
|
|
3832
|
-
catch (
|
|
3869
|
+
catch (e_52_1) { e_52 = { error: e_52_1 }; }
|
|
3833
3870
|
finally {
|
|
3834
3871
|
try {
|
|
3835
3872
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
3836
3873
|
}
|
|
3837
|
-
finally { if (
|
|
3874
|
+
finally { if (e_52) throw e_52.error; }
|
|
3838
3875
|
}
|
|
3839
3876
|
}
|
|
3840
3877
|
}
|