@creatio-devkit/common 0.830.0 → 0.831.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/esm2022/lib/base-exports.mjs +1 -1
- package/esm2022/lib/internal/models/transaction/index.mjs +2 -1
- package/esm2022/lib/internal/models/transaction/transaction-factory.mjs +2 -0
- package/esm2022/lib/internal/models/transaction/transaction-operation.mjs +1 -1
- package/esm2022/lib/internal/models/transaction/transaction.mjs +1 -1
- package/esm2022/lib/internal/services/design-time-view-element-registry/design-time-view-element-registry.mjs +4 -4
- package/esm2022/lib/internal/services/interface-designer-item-registry/index.mjs +2 -1
- package/esm2022/lib/internal/services/interface-designer-item-registry/interface-designer-item-registry.mjs +35 -10
- package/esm2022/lib/internal/services/interface-designer-item-registry/mobile-interface-designer-item-registry.mjs +12 -0
- package/esm2022/lib/internal/services/request-handler-registry/request-handler-registry.service.mjs +1 -1
- package/esm2022/lib/internal/services/view-element-registry/base-view-element-registry.mjs +70 -0
- package/esm2022/lib/internal/services/view-element-registry/index.mjs +3 -1
- package/esm2022/lib/internal/services/view-element-registry/mobile-view-element-registry.mjs +13 -0
- package/esm2022/lib/internal/services/view-element-registry/view-element-registry.mjs +3 -66
- package/esm2022/lib/internal/utils/index.mjs +1 -2
- package/esm2022/lib/internal/utils/metadata-utils.mjs +35 -7
- package/esm2022/lib/internal/utils/module-utils.mjs +1 -1
- package/esm2022/lib/public/decorators/interface-designer-item/index.mjs +3 -1
- package/esm2022/lib/public/decorators/interface-designer-item/interface-designer-item-decorator-utils.mjs +29 -0
- package/esm2022/lib/public/decorators/interface-designer-item/interface-designer-item.decorator.mjs +4 -19
- package/esm2022/lib/public/decorators/interface-designer-item/mobile-interface-designer-item.decorator.mjs +10 -0
- package/esm2022/lib/public/decorators/view-element/index.mjs +3 -1
- package/esm2022/lib/public/decorators/view-element/mobile-view-element.decorator.mjs +9 -0
- package/esm2022/lib/public/decorators/view-element/view-element-decorator-utils.mjs +33 -0
- package/esm2022/lib/public/decorators/view-element/view-element.decorator.mjs +4 -23
- package/esm2022/lib/public/functions/bootstrap-crt-module.mjs +30 -13
- package/esm2022/lib/public/models/module-definition.mjs +1 -1
- package/esm2022/lib/public/models/request/view-model-attribute-change-event-options.mjs +1 -1
- package/esm2022/lib/public/services/index.mjs +2 -1
- package/esm2022/lib/public/services/model/model.mjs +19 -2
- package/esm2022/lib/public/services/transaction-factory/index.mjs +2 -0
- package/esm2022/lib/public/services/transaction-factory/transaction-factory.service.mjs +40 -0
- package/fesm2022/creatio-devkit-common.mjs +241 -56
- package/fesm2022/creatio-devkit-common.mjs.map +1 -1
- package/index.d.ts +138 -7
- package/package.json +2 -2
- package/esm2022/lib/internal/utils/component-config-utils.mjs +0 -12
|
@@ -361,7 +361,9 @@ class HandlersOrderComparer {
|
|
|
361
361
|
|
|
362
362
|
const moduleMetadataKey = 'module';
|
|
363
363
|
const viewElementMetadataKey = 'viewElement';
|
|
364
|
+
const mobileViewElementMetadataKey = 'mobileViewElement';
|
|
364
365
|
const interfaceDesignerItemMetadataKey = 'interfaceDesignerItem';
|
|
366
|
+
const mobileInterfaceDesignerItemMetadataKey = 'mobileInterfaceDesignerItem';
|
|
365
367
|
const requestHandlerMetadataKey = 'requestHandler';
|
|
366
368
|
const designTimeViewElementMetadataKey = 'designTimeViewElement';
|
|
367
369
|
const validatorMetadataKey = 'validator';
|
|
@@ -388,14 +390,24 @@ function getModuleMetadata(type) {
|
|
|
388
390
|
function setViewElementMetadata(metadata, type) {
|
|
389
391
|
Reflect.defineMetadata(viewElementMetadataKey, metadata, type);
|
|
390
392
|
}
|
|
393
|
+
/**
|
|
394
|
+
* @internal
|
|
395
|
+
*/
|
|
396
|
+
function setMobileViewElementMetadata(metadata, type) {
|
|
397
|
+
Reflect.defineMetadata(mobileViewElementMetadataKey, metadata, type);
|
|
398
|
+
}
|
|
391
399
|
/**
|
|
392
400
|
* @internal
|
|
393
401
|
*/
|
|
394
402
|
function getViewElementMetadata(type) {
|
|
395
403
|
const metadata = Reflect.getMetadata(viewElementMetadataKey, type);
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
404
|
+
return metadata;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* @internal
|
|
408
|
+
*/
|
|
409
|
+
function getMobileViewElementMetadata(type) {
|
|
410
|
+
const metadata = Reflect.getMetadata(mobileViewElementMetadataKey, type);
|
|
399
411
|
return metadata;
|
|
400
412
|
}
|
|
401
413
|
/**
|
|
@@ -436,14 +448,24 @@ function getConverterMetadata(type) {
|
|
|
436
448
|
function setInterfaceDesignerItemMetadata(metadata, type) {
|
|
437
449
|
Reflect.defineMetadata(interfaceDesignerItemMetadataKey, metadata, type);
|
|
438
450
|
}
|
|
451
|
+
/**
|
|
452
|
+
* @internal
|
|
453
|
+
*/
|
|
454
|
+
function setMobileInterfaceDesignerItemMetadata(metadata, type) {
|
|
455
|
+
Reflect.defineMetadata(mobileInterfaceDesignerItemMetadataKey, metadata, type);
|
|
456
|
+
}
|
|
439
457
|
/**
|
|
440
458
|
* @internal
|
|
441
459
|
*/
|
|
442
460
|
function getInterfaceDesignerItemMetadata(type) {
|
|
443
461
|
const metadata = Reflect.getOwnMetadata(interfaceDesignerItemMetadataKey, type);
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
462
|
+
return metadata;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* @internal
|
|
466
|
+
*/
|
|
467
|
+
function getMobileInterfaceDesignerItemMetadata(type) {
|
|
468
|
+
const metadata = Reflect.getOwnMetadata(mobileInterfaceDesignerItemMetadataKey, type);
|
|
447
469
|
return metadata;
|
|
448
470
|
}
|
|
449
471
|
/**
|
|
@@ -468,6 +490,12 @@ function getDesignTimeViewElementMetadata(type) {
|
|
|
468
490
|
function hasInterfaceDesignerItemMetadata(type) {
|
|
469
491
|
return Reflect.hasOwnMetadata(interfaceDesignerItemMetadataKey, type);
|
|
470
492
|
}
|
|
493
|
+
/**
|
|
494
|
+
* @internal
|
|
495
|
+
*/
|
|
496
|
+
function hasMobileInterfaceDesignerItemMetadata(type) {
|
|
497
|
+
return Reflect.hasOwnMetadata(mobileInterfaceDesignerItemMetadataKey, type);
|
|
498
|
+
}
|
|
471
499
|
/**
|
|
472
500
|
* @internal
|
|
473
501
|
*/
|
|
@@ -1189,21 +1217,16 @@ class ConverterRegistry extends ɵBaseRegistry {
|
|
|
1189
1217
|
|
|
1190
1218
|
/**
|
|
1191
1219
|
* @internal
|
|
1220
|
+
* @hostPublicApi available through window.creatio.registry.BaseViewElementRegistry
|
|
1192
1221
|
*/
|
|
1193
|
-
|
|
1194
|
-
/**
|
|
1195
|
-
* @internal
|
|
1196
|
-
* @hostPublicApi available through window.creatio.registry.ValidatorRegistry
|
|
1197
|
-
*/
|
|
1198
|
-
class ViewElementRegistry extends ɵBaseRegistry {
|
|
1199
|
-
static { this.registryKey = viewElementRegistryKey; }
|
|
1222
|
+
class BaseViewElementRegistry extends ɵBaseRegistry {
|
|
1200
1223
|
static validate(config) {
|
|
1201
1224
|
checkTypeNameFormat(config.type, 'ViewElementTypeName');
|
|
1202
|
-
const existingItem =
|
|
1225
|
+
const existingItem = this.viewElements.get(config.type);
|
|
1203
1226
|
if (existingItem?.lazy && !('selector' in existingItem) && !existingItem.typeRef) {
|
|
1204
1227
|
return;
|
|
1205
1228
|
}
|
|
1206
|
-
checkOnlyOneRegistration(config.type, config,
|
|
1229
|
+
checkOnlyOneRegistration(config.type, config, this.viewElements);
|
|
1207
1230
|
}
|
|
1208
1231
|
static get viewElements() {
|
|
1209
1232
|
return this.store.typeInfos;
|
|
@@ -1260,6 +1283,29 @@ class ViewElementRegistry extends ɵBaseRegistry {
|
|
|
1260
1283
|
}
|
|
1261
1284
|
}
|
|
1262
1285
|
|
|
1286
|
+
/**
|
|
1287
|
+
* @internal
|
|
1288
|
+
*/
|
|
1289
|
+
const viewElementRegistryKey = 'ViewElementRegistry';
|
|
1290
|
+
/**
|
|
1291
|
+
* @internal
|
|
1292
|
+
*/
|
|
1293
|
+
class ViewElementRegistry extends BaseViewElementRegistry {
|
|
1294
|
+
static { this.registryKey = viewElementRegistryKey; }
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* @internal
|
|
1299
|
+
*/
|
|
1300
|
+
const mobileViewElementRegistryKey = 'MobileViewElementRegistry';
|
|
1301
|
+
/**
|
|
1302
|
+
* @internal
|
|
1303
|
+
* @hostPublicApi available through window.creatio.registry.MobileViewElementRegistry
|
|
1304
|
+
*/
|
|
1305
|
+
class MobileViewElementRegistry extends BaseViewElementRegistry {
|
|
1306
|
+
static { this.registryKey = mobileViewElementRegistryKey; }
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1263
1309
|
/**
|
|
1264
1310
|
* @internal
|
|
1265
1311
|
*/
|
|
@@ -1268,22 +1314,58 @@ const interfaceDesignerItemRegistryKey = 'InterfaceDesignerItemRegistry';
|
|
|
1268
1314
|
* @internal
|
|
1269
1315
|
* @hostPublicApi available through window.creatio.registry.InterfaceDesignerItemRegistry
|
|
1270
1316
|
*/
|
|
1271
|
-
class
|
|
1272
|
-
static
|
|
1317
|
+
class BaseInterfaceDesignerItemRegistry extends ɵBaseRegistry {
|
|
1318
|
+
static get _interfaceDesignerItemRegistrationInfos() {
|
|
1319
|
+
return this.store.typeInfos;
|
|
1320
|
+
}
|
|
1273
1321
|
static validate(config) {
|
|
1274
1322
|
checkTypeNameFormat(config.type, 'InterfaceDesignerItemTypeName');
|
|
1275
1323
|
checkCrtTypeNamePascalCase(config.type);
|
|
1276
|
-
checkOnlyOneRegistration(config.type, config, this.
|
|
1277
|
-
}
|
|
1278
|
-
static register(config) {
|
|
1279
|
-
this.interfaceDesignerItemRegistrationInfos.set(config.type, config);
|
|
1324
|
+
checkOnlyOneRegistration(config.type, config, this._interfaceDesignerItemRegistrationInfos);
|
|
1280
1325
|
}
|
|
1281
|
-
static
|
|
1282
|
-
|
|
1326
|
+
static register(typeOrConfig, config) {
|
|
1327
|
+
if (typeof typeOrConfig === 'string' && config) {
|
|
1328
|
+
this._interfaceDesignerItemRegistrationInfos.set(typeOrConfig, config);
|
|
1329
|
+
}
|
|
1330
|
+
else if (typeof typeOrConfig !== 'string') {
|
|
1331
|
+
this._interfaceDesignerItemRegistrationInfos.set(typeOrConfig.type, typeOrConfig);
|
|
1332
|
+
}
|
|
1333
|
+
else {
|
|
1334
|
+
throw new Error('Invalid arguments provided to register method.');
|
|
1335
|
+
}
|
|
1283
1336
|
}
|
|
1284
1337
|
static get(type) {
|
|
1285
|
-
return this.
|
|
1338
|
+
return this._interfaceDesignerItemRegistrationInfos.get(type);
|
|
1339
|
+
}
|
|
1340
|
+
static has(type) {
|
|
1341
|
+
return this._interfaceDesignerItemRegistrationInfos.has(type);
|
|
1286
1342
|
}
|
|
1343
|
+
static getAll() {
|
|
1344
|
+
return this._interfaceDesignerItemRegistrationInfos;
|
|
1345
|
+
}
|
|
1346
|
+
static values() {
|
|
1347
|
+
return [...this._interfaceDesignerItemRegistrationInfos.values()];
|
|
1348
|
+
}
|
|
1349
|
+
static clear() {
|
|
1350
|
+
this._interfaceDesignerItemRegistrationInfos.clear();
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* @internal
|
|
1355
|
+
*/
|
|
1356
|
+
class InterfaceDesignerItemRegistry extends BaseInterfaceDesignerItemRegistry {
|
|
1357
|
+
static { this.registryKey = interfaceDesignerItemRegistryKey; }
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
* @internal
|
|
1362
|
+
*/
|
|
1363
|
+
const mobileInterfaceDesignerItemRegistryKey = 'MobileInterfaceDesignerItemRegistry';
|
|
1364
|
+
/**
|
|
1365
|
+
* @internal
|
|
1366
|
+
*/
|
|
1367
|
+
class MobileInterfaceDesignerItemRegistry extends BaseInterfaceDesignerItemRegistry {
|
|
1368
|
+
static { this.registryKey = mobileInterfaceDesignerItemRegistryKey; }
|
|
1287
1369
|
}
|
|
1288
1370
|
|
|
1289
1371
|
const global = window;
|
|
@@ -1348,6 +1430,9 @@ const designTimeViewElementRegistryKey = 'DesignTimeViewElementRegistry';
|
|
|
1348
1430
|
*/
|
|
1349
1431
|
class DesignTimeViewElementRegistry extends ɵBaseRegistry {
|
|
1350
1432
|
static { this.registryKey = designTimeViewElementRegistryKey; }
|
|
1433
|
+
static get infos() {
|
|
1434
|
+
return this.store.typeInfos;
|
|
1435
|
+
}
|
|
1351
1436
|
static validate(config) {
|
|
1352
1437
|
checkTypeNameFormat(config.type, 'DesignTimeViewElementRegistryItemTypeName');
|
|
1353
1438
|
checkCrtTypeNamePascalCase(config.type);
|
|
@@ -1363,9 +1448,6 @@ class DesignTimeViewElementRegistry extends ɵBaseRegistry {
|
|
|
1363
1448
|
}
|
|
1364
1449
|
return null;
|
|
1365
1450
|
}
|
|
1366
|
-
static get infos() {
|
|
1367
|
-
return this.store.typeInfos;
|
|
1368
|
-
}
|
|
1369
1451
|
}
|
|
1370
1452
|
|
|
1371
1453
|
/**
|
|
@@ -1520,17 +1602,6 @@ function objectDeepKeys(obj) {
|
|
|
1520
1602
|
.reduce((x, y) => [...x, ...y], Object.keys(obj).map((x) => [x]));
|
|
1521
1603
|
}
|
|
1522
1604
|
|
|
1523
|
-
/**
|
|
1524
|
-
* @internal
|
|
1525
|
-
*/
|
|
1526
|
-
function isComponentPropertyBindable(viewConfigType, componentProperty) {
|
|
1527
|
-
const componentConfig = ViewElementRegistry.viewElements.get(viewConfigType);
|
|
1528
|
-
if (!componentConfig?.inputs) {
|
|
1529
|
-
return false;
|
|
1530
|
-
}
|
|
1531
|
-
return !!componentConfig?.inputs[componentProperty]?.propertyBindable;
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
1605
|
/**
|
|
1535
1606
|
* @internal
|
|
1536
1607
|
*/
|
|
@@ -1773,8 +1844,18 @@ function resistantForEach(items, callback) {
|
|
|
1773
1844
|
function registerViewElements(types) {
|
|
1774
1845
|
resistantForEach(types, (type) => {
|
|
1775
1846
|
const registrationConfig = getViewElementMetadata(type);
|
|
1776
|
-
|
|
1777
|
-
|
|
1847
|
+
if (registrationConfig) {
|
|
1848
|
+
ViewElementRegistry.validate(registrationConfig);
|
|
1849
|
+
ViewElementRegistry.register(registrationConfig);
|
|
1850
|
+
}
|
|
1851
|
+
const mobileRegistrationConfig = getMobileViewElementMetadata(type);
|
|
1852
|
+
if (mobileRegistrationConfig) {
|
|
1853
|
+
MobileViewElementRegistry.validate(mobileRegistrationConfig);
|
|
1854
|
+
MobileViewElementRegistry.register(mobileRegistrationConfig);
|
|
1855
|
+
}
|
|
1856
|
+
if (!registrationConfig && !mobileRegistrationConfig) {
|
|
1857
|
+
throw new Error(`View element metadata was not found on '${type.name}' class`);
|
|
1858
|
+
}
|
|
1778
1859
|
});
|
|
1779
1860
|
}
|
|
1780
1861
|
/**
|
|
@@ -1792,15 +1873,22 @@ function registerLazyViewElements(configs, lazyModuleRef) {
|
|
|
1792
1873
|
*/
|
|
1793
1874
|
function registerInterfaceDesignerItems(types, localizeFn) {
|
|
1794
1875
|
resistantForEach(types, (type) => {
|
|
1795
|
-
if (
|
|
1796
|
-
|
|
1876
|
+
if (hasInterfaceDesignerItemMetadata(type)) {
|
|
1877
|
+
let config = getInterfaceDesignerItemMetadata(type);
|
|
1878
|
+
config = applyLocalizeMetadataFn(config, localizeFn);
|
|
1879
|
+
const viewElementMetadata = getViewElementMetadata(type);
|
|
1880
|
+
config.type = viewElementMetadata.type;
|
|
1881
|
+
InterfaceDesignerItemRegistry.validate(config);
|
|
1882
|
+
InterfaceDesignerItemRegistry.register(config);
|
|
1883
|
+
}
|
|
1884
|
+
if (hasMobileInterfaceDesignerItemMetadata(type)) {
|
|
1885
|
+
let config = getMobileInterfaceDesignerItemMetadata(type);
|
|
1886
|
+
config = applyLocalizeMetadataFn(config, localizeFn);
|
|
1887
|
+
const viewElementMetadata = getMobileViewElementMetadata(type);
|
|
1888
|
+
config.type = viewElementMetadata.type;
|
|
1889
|
+
MobileInterfaceDesignerItemRegistry.validate(config);
|
|
1890
|
+
MobileInterfaceDesignerItemRegistry.register(config);
|
|
1797
1891
|
}
|
|
1798
|
-
let config = getInterfaceDesignerItemMetadata(type);
|
|
1799
|
-
config = applyLocalizeMetadataFn(config, localizeFn);
|
|
1800
|
-
const viewElementMetadata = getViewElementMetadata(type);
|
|
1801
|
-
config.type = viewElementMetadata.type;
|
|
1802
|
-
InterfaceDesignerItemRegistry.validate(config);
|
|
1803
|
-
InterfaceDesignerItemRegistry.register(config);
|
|
1804
1892
|
});
|
|
1805
1893
|
}
|
|
1806
1894
|
/**
|
|
@@ -2285,8 +2373,7 @@ function CrtValidationInput() {
|
|
|
2285
2373
|
/**
|
|
2286
2374
|
* @internal
|
|
2287
2375
|
*/
|
|
2288
|
-
|
|
2289
|
-
function CrtViewElement(config) {
|
|
2376
|
+
function viewElementRegister(config, platform) {
|
|
2290
2377
|
return function (type) {
|
|
2291
2378
|
checkTypeNamePascalCase(config.type);
|
|
2292
2379
|
const inputs = getCrtInputsMetadata(type);
|
|
@@ -2303,10 +2390,32 @@ function CrtViewElement(config) {
|
|
|
2303
2390
|
: { ...baseRegistrationConfig, typeRef: type };
|
|
2304
2391
|
registrationConfig.reuseStrategy = config?.reuseStrategy ?? ViewElementReuseStrategy.Rerender;
|
|
2305
2392
|
defineRenderConfig(registrationConfig);
|
|
2306
|
-
|
|
2393
|
+
if (platform === 'web') {
|
|
2394
|
+
setViewElementMetadata(registrationConfig, type);
|
|
2395
|
+
}
|
|
2396
|
+
else {
|
|
2397
|
+
setMobileViewElementMetadata(registrationConfig, type);
|
|
2398
|
+
}
|
|
2307
2399
|
};
|
|
2308
2400
|
}
|
|
2309
2401
|
|
|
2402
|
+
/**
|
|
2403
|
+
* @internal
|
|
2404
|
+
*/
|
|
2405
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2406
|
+
function CrtMobileViewElement(config) {
|
|
2407
|
+
return viewElementRegister(config, 'mobile');
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
/**
|
|
2411
|
+
* @internal
|
|
2412
|
+
*/
|
|
2413
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2414
|
+
function CrtViewElement(config) {
|
|
2415
|
+
// Register the view element with the 'web' platform type
|
|
2416
|
+
return viewElementRegister(config, 'web');
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2310
2419
|
/**
|
|
2311
2420
|
* @internal
|
|
2312
2421
|
*/
|
|
@@ -2317,8 +2426,7 @@ function CrtModule(moduleDefinition) {
|
|
|
2317
2426
|
/**
|
|
2318
2427
|
* @internal
|
|
2319
2428
|
*/
|
|
2320
|
-
|
|
2321
|
-
function CrtInterfaceDesignerItem(config) {
|
|
2429
|
+
function interfaceDesignerItemRegister(config, platform) {
|
|
2322
2430
|
function _applyTypeCaption() {
|
|
2323
2431
|
if (!config.typeCaption && config.toolbarConfig) {
|
|
2324
2432
|
const toolbarConfig = Array.isArray(config.toolbarConfig)
|
|
@@ -2332,10 +2440,33 @@ function CrtInterfaceDesignerItem(config) {
|
|
|
2332
2440
|
config.viewElementGroupType ??= ViewElementGroupType.CustomElements;
|
|
2333
2441
|
_applyTypeCaption();
|
|
2334
2442
|
defineRenderConfig(config);
|
|
2335
|
-
|
|
2443
|
+
if (platform === 'mobile') {
|
|
2444
|
+
setMobileInterfaceDesignerItemMetadata(config, type);
|
|
2445
|
+
}
|
|
2446
|
+
else {
|
|
2447
|
+
setInterfaceDesignerItemMetadata(config, type);
|
|
2448
|
+
}
|
|
2336
2449
|
};
|
|
2337
2450
|
}
|
|
2338
2451
|
|
|
2452
|
+
// noinspection ES6PreferShortImport
|
|
2453
|
+
/**
|
|
2454
|
+
* @internal
|
|
2455
|
+
*/
|
|
2456
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2457
|
+
function CrtInterfaceDesignerItem(config) {
|
|
2458
|
+
return interfaceDesignerItemRegister(config, 'web');
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
// noinspection ES6PreferShortImport
|
|
2462
|
+
/**
|
|
2463
|
+
* @internal
|
|
2464
|
+
*/
|
|
2465
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2466
|
+
function CrtMobileInterfaceDesignerItem(config) {
|
|
2467
|
+
return interfaceDesignerItemRegister(config, 'mobile');
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2339
2470
|
/**
|
|
2340
2471
|
* @public
|
|
2341
2472
|
* @description
|
|
@@ -2844,7 +2975,15 @@ class Model extends BaseHandlerChainService {
|
|
|
2844
2975
|
insert(dto) {
|
|
2845
2976
|
return this._crtModel._getAsyncResult(this._crtModel.insert(dto));
|
|
2846
2977
|
}
|
|
2847
|
-
update(dto, parameters) {
|
|
2978
|
+
async update(dto, parameters) {
|
|
2979
|
+
const changedAttributes = Object.keys(dto);
|
|
2980
|
+
if (changedAttributes.length) {
|
|
2981
|
+
const schema = await this.getSchema();
|
|
2982
|
+
const primaryAttributeName = schema.primaryAttributeName;
|
|
2983
|
+
changedAttributes
|
|
2984
|
+
.filter((attribute) => attribute !== primaryAttributeName)
|
|
2985
|
+
.forEach((attribute) => this._crtModel.attributeChanged(attribute));
|
|
2986
|
+
}
|
|
2848
2987
|
return this._crtModel._getAsyncResult(this._crtModel.update(dto, parameters));
|
|
2849
2988
|
}
|
|
2850
2989
|
copy(primaryColumnValue, data = {}) {
|
|
@@ -2862,6 +3001,15 @@ class Model extends BaseHandlerChainService {
|
|
|
2862
3001
|
canDelete(params) {
|
|
2863
3002
|
return this._crtModel._getAsyncResult(this._crtModel.canDelete(params));
|
|
2864
3003
|
}
|
|
3004
|
+
insertInTransaction(transaction, dto) {
|
|
3005
|
+
return this._crtModel.insertInTransaction(transaction, dto);
|
|
3006
|
+
}
|
|
3007
|
+
updateInTransaction(transaction, dto, parameters) {
|
|
3008
|
+
return this._crtModel.updateInTransaction(transaction, dto, parameters);
|
|
3009
|
+
}
|
|
3010
|
+
deleteInTransaction(transaction, parameters) {
|
|
3011
|
+
return this._crtModel.deleteInTransaction(transaction, parameters);
|
|
3012
|
+
}
|
|
2865
3013
|
}
|
|
2866
3014
|
__decorate([
|
|
2867
3015
|
ImplementUsingHandlerChain({
|
|
@@ -3044,9 +3192,46 @@ class AiContextService {
|
|
|
3044
3192
|
}
|
|
3045
3193
|
}
|
|
3046
3194
|
|
|
3195
|
+
/**
|
|
3196
|
+
* @public
|
|
3197
|
+
* @class TransactionFactoryService
|
|
3198
|
+
* @classdesc Service to working with transaction factory using a handler chain
|
|
3199
|
+
* @extends {BaseHandlerChainService}
|
|
3200
|
+
*/
|
|
3201
|
+
class TransactionFactoryService extends BaseHandlerChainService {
|
|
3202
|
+
/**
|
|
3203
|
+
* @internal
|
|
3204
|
+
*/
|
|
3205
|
+
constructor() {
|
|
3206
|
+
super();
|
|
3207
|
+
/**
|
|
3208
|
+
* @internal
|
|
3209
|
+
*/
|
|
3210
|
+
this.requestType = 'crt.TransactionFactoryService';
|
|
3211
|
+
}
|
|
3212
|
+
/**
|
|
3213
|
+
* @internal
|
|
3214
|
+
*/
|
|
3215
|
+
static get instance() {
|
|
3216
|
+
if (!this._instance) {
|
|
3217
|
+
this._instance = new TransactionFactoryService();
|
|
3218
|
+
}
|
|
3219
|
+
return this._instance;
|
|
3220
|
+
}
|
|
3221
|
+
static create() {
|
|
3222
|
+
return this.instance.create();
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
__decorate([
|
|
3226
|
+
ImplementUsingHandlerChain({
|
|
3227
|
+
methodName: 'create',
|
|
3228
|
+
}),
|
|
3229
|
+
__metadata("design:type", Function)
|
|
3230
|
+
], TransactionFactoryService.prototype, "create", void 0);
|
|
3231
|
+
|
|
3047
3232
|
/**
|
|
3048
3233
|
* Generated bundle index. Do not edit.
|
|
3049
3234
|
*/
|
|
3050
3235
|
|
|
3051
|
-
export { AiContextService, BaseRequestHandler, BaseValidator, BootstrapNotifier, ChatMessageTypeRegistry, ConverterRegistry, CrtChatMessageType, CrtConverter, CrtDesignTimeViewElement, CrtInject, CrtInput, CrtInputRegistrationConfig, CrtInterfaceDesignerItem, CrtModule, CrtOutput, CrtRequest, CrtRequestHandler, CrtValidationInput, CrtValidator, CrtViewElement, CrtZoneService, DataRequest, DataSourceLoadType, DesignTimeViewElementRegistry, DesignerToolGroupType, DialogService, FeatureService, HandleViewModelAttributeChangeRequest, HandlerChainService, HandlerChainServicesRegistry, HandlerSourceType, HandlersOrderComparer, HttpClientService, ImplementUsingHandlerChain, InterfaceDesignerItemRegistrationConfig, InterfaceDesignerItemRegistry, InternalRequestHandlerRegistry, InternalRequestHandlerRegistryType, LazyModuleRef, LazyModulesManager, LicenseService, LocalizableValue, MaskService, MessageChannelService, MethodInvokeRequest, Model, PkgTopology, ProcessEngineService, ProcessStatus, RemoteEntriesRegistry, RemoteEntryType, RequestHandlerRegistryService, RequestRegistryService, RightsService, RunProcessRequest, SysSetting, SysSettingValue, SysSettingsService, SysValuesService, VIEW_ELEMENT_DEFAULT_HEIGHT, ValidatorMapValue, ValidatorRegistry, ViewElementDataGroupType, ViewElementGroupType, ViewElementProperty, ViewElementRegistry, ViewElementRenderStrategy, ViewElementReuseStrategy, _from, applyLocalizeMetadataFn, bootstrapCrtModule, bootstrapCrtModuleHandlerChainServices, bootstrappedCrtModules, callOnContextCreateHooks, callOnContextDestroyHooks, callOnContextUpdateHooks, checkCrtTypeNamePascalCase, checkIfTypeRegistered, checkOnlyOneRegistration, checkTypeNameFormat, checkTypeNamePascalCase, crtInjectPrefix, crtInputPrefix, crtOutputPrefix, crtValidationInputPrefix, defineRenderConfig, designTimeViewElementRegistryKey, getConverterMetadata, getCrtInputsMetadata, getCrtOutputsMetadata, getCrtValidationInputsMetadata, getDeepModuleDependencies, getDesignTimeViewElementMetadata, getHandlerChainServiceMetadata, getInterfaceDesignerItemMetadata, getModuleMetadata, getRequestHandlerMetadata, getTypeDependencies, getValidatorMetadata, getViewElementMetadata, hasInterfaceDesignerItemMetadata, instantiate,
|
|
3236
|
+
export { AiContextService, BaseInterfaceDesignerItemRegistry, BaseRequestHandler, BaseValidator, BaseViewElementRegistry, BootstrapNotifier, ChatMessageTypeRegistry, ConverterRegistry, CrtChatMessageType, CrtConverter, CrtDesignTimeViewElement, CrtInject, CrtInput, CrtInputRegistrationConfig, CrtInterfaceDesignerItem, CrtMobileInterfaceDesignerItem, CrtMobileViewElement, CrtModule, CrtOutput, CrtRequest, CrtRequestHandler, CrtValidationInput, CrtValidator, CrtViewElement, CrtZoneService, DataRequest, DataSourceLoadType, DesignTimeViewElementRegistry, DesignerToolGroupType, DialogService, FeatureService, HandleViewModelAttributeChangeRequest, HandlerChainService, HandlerChainServicesRegistry, HandlerSourceType, HandlersOrderComparer, HttpClientService, ImplementUsingHandlerChain, InterfaceDesignerItemRegistrationConfig, InterfaceDesignerItemRegistry, InternalRequestHandlerRegistry, InternalRequestHandlerRegistryType, LazyModuleRef, LazyModulesManager, LicenseService, LocalizableValue, MaskService, MessageChannelService, MethodInvokeRequest, MobileInterfaceDesignerItemRegistry, MobileViewElementRegistry, Model, PkgTopology, ProcessEngineService, ProcessStatus, RemoteEntriesRegistry, RemoteEntryType, RequestHandlerRegistryService, RequestRegistryService, RightsService, RunProcessRequest, SysSetting, SysSettingValue, SysSettingsService, SysValuesService, TransactionFactoryService, VIEW_ELEMENT_DEFAULT_HEIGHT, ValidatorMapValue, ValidatorRegistry, ViewElementDataGroupType, ViewElementGroupType, ViewElementProperty, ViewElementRegistry, ViewElementRenderStrategy, ViewElementReuseStrategy, _from, applyLocalizeMetadataFn, bootstrapCrtModule, bootstrapCrtModuleHandlerChainServices, bootstrappedCrtModules, callOnContextCreateHooks, callOnContextDestroyHooks, callOnContextUpdateHooks, checkCrtTypeNamePascalCase, checkIfTypeRegistered, checkOnlyOneRegistration, checkTypeNameFormat, checkTypeNamePascalCase, crtInjectPrefix, crtInputPrefix, crtOutputPrefix, crtValidationInputPrefix, defineRenderConfig, designTimeViewElementRegistryKey, getConverterMetadata, getCrtInputsMetadata, getCrtOutputsMetadata, getCrtValidationInputsMetadata, getDeepModuleDependencies, getDesignTimeViewElementMetadata, getHandlerChainServiceMetadata, getInterfaceDesignerItemMetadata, getMobileInterfaceDesignerItemMetadata, getMobileViewElementMetadata, getModuleMetadata, getRequestHandlerMetadata, getTypeDependencies, getValidatorMetadata, getViewElementMetadata, hasInterfaceDesignerItemMetadata, hasMobileInterfaceDesignerItemMetadata, instantiate, interfaceDesignerItemRegister, interfaceDesignerItemRegistryKey, localize, matchScopes, mobileInterfaceDesignerItemRegistryKey, mobileViewElementRegistryKey, objectDeepKeys, registerAngularViewElement, registerViewElement, registryKey, resetGlobals, setConverterMetadata, setDesignTimeViewElementMetadata, setInterfaceDesignerItemMetadata, setMobileInterfaceDesignerItemMetadata, setMobileViewElementMetadata, setModuleMetadata, setRequestHandlerMetadata, setValidatorMetadata, setViewElementMetadata, toAggregationEval, toAggregationEvalType, toAggregationFunction, toAggregationType, toDatePart, toDatePartType, toNumericFunctionType, toOrderDirection, toPascalCase, toSortDirection, toStringFunctionType, validatorRegistryKey, viewElementRegister, viewElementRegistryKey, ɵBaseRegistry, ɵcheckTypeNameFormat, ɵinstantiate };
|
|
3052
3237
|
//# sourceMappingURL=creatio-devkit-common.mjs.map
|