@creatio-devkit/common 0.813.0 → 0.814.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 +7 -2
- package/esm2020/lib/base-exports.mjs +2 -2
- package/esm2020/lib/internal/decorators/request/request.decorator.mjs +1 -1
- package/esm2020/lib/internal/models/injection-context/injection-context.mjs +1 -1
- package/esm2020/lib/internal/models/lazy-module-ref.mjs +5 -2
- package/esm2020/lib/internal/services/chat-message-type-registry/chat-message-type-registry.mjs +22 -0
- package/esm2020/lib/internal/services/chat-message-type-registry/index.mjs +2 -0
- package/esm2020/lib/internal/services/index.mjs +2 -1
- package/esm2020/lib/internal/services/lazy-modules-manager/lazy-modules-manager.mjs +4 -1
- package/esm2020/lib/public/decorators/chat-message-type/chat-message-type.decorator.mjs +20 -0
- package/esm2020/lib/public/decorators/chat-message-type/index.mjs +2 -0
- package/esm2020/lib/public/decorators/index.mjs +2 -1
- package/esm2020/lib/public/functions/bootstrap-crt-module.mjs +18 -5
- package/esm2020/lib/public/functions/bootstrapped-crt-modules.mjs +9 -0
- package/esm2020/lib/public/functions/crt-module-context-hooks.mjs +30 -0
- package/esm2020/lib/public/functions/index.mjs +3 -1
- package/esm2020/lib/public/functions/reset-globals.mjs +3 -1
- package/esm2020/lib/public/models/index.mjs +2 -1
- package/esm2020/lib/public/models/input/input-registration-config.model.mjs +1 -1
- package/esm2020/lib/public/models/item-creation-config.mjs +2 -0
- package/esm2020/lib/public/models/request/handle-view-model-attribute-change.request.mjs +29 -0
- package/esm2020/lib/public/models/request/index.mjs +4 -1
- package/esm2020/lib/public/models/request/model-event.model.mjs +2 -0
- package/esm2020/lib/public/models/request/view-model-attribute-change-event-options.mjs +2 -0
- package/esm2020/lib/public/services/dialog-service/dialog.service.mjs +24 -0
- package/esm2020/lib/public/services/dialog-service/index.mjs +2 -0
- package/esm2020/lib/public/services/handler-chain/internal-handler-chain.mjs +12 -8
- package/esm2020/lib/public/services/index.mjs +2 -1
- package/esm2020/lib/public/services/license/license.service.mjs +1 -1
- package/fesm2015/creatio-devkit-common.mjs +176 -29
- package/fesm2015/creatio-devkit-common.mjs.map +1 -1
- package/fesm2020/creatio-devkit-common.mjs +175 -29
- package/fesm2020/creatio-devkit-common.mjs.map +1 -1
- package/index.d.ts +135 -4
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ɵAggregationType, ɵAggregationFunction, ɵAggregationEvalType, ɵDatePartType, ɵFunctionType, ɵOrderDirection, ɵgenerateGuid, ɵNextHandlerAlreadySpecifiedException, ɵBaseRequest, ɵSchemaViewMaskRequest, ɵSchemaViewMaskRequestAction } from '@creatio/base';
|
|
2
|
-
export { ɵAggregationEvalType as AggregationEvalType, ɵAggregationFunction as AggregationFunction, ɵAggregationFunctionColumn as AggregationFunctionColumn, ɵAggregationFunctionExpression as AggregationFunctionExpression, ɵAggregationSubQueryColumn as AggregationSubQueryColumn, ɵAggregationSubQueryExpression as AggregationSubQueryExpression, ɵAggregationType as AggregationType, ɵArgumentEmptyException as ArgumentEmptyException, ɵArgumentFunctionExpression as ArgumentFunctionExpression, ɵArgumentOutOfRangeException as ArgumentOutOfRangeException, ɵArithmeticExpression as ArithmeticExpression, ɵArithmeticOperation as ArithmeticOperation, ɵArithmeticQueryColumn as ArithmeticQueryColumn, ɵBaseExpression as BaseExpression, ɵBaseExpressionParser as BaseExpressionParser, ɵBaseFilter as BaseFilter, ɵBaseFilterParser as BaseFilterParser, ɵBaseFilterableQuery as BaseFilterableQuery, ɵBaseQuery as BaseQuery, ɵBaseQueryColumn as BaseQueryColumn, ɵBaseRequest as BaseRequest, ɵBetweenFilter as BetweenFilter, ɵColumnExpression as ColumnExpression, ɵCompareFilter as CompareFilter, ɵComparisonType as ComparisonType, ɵDEFAULT_COLUMN_PLAIN_OBJ as DEFAULT_COLUMN_PLAIN_OBJ, ɵDEFAULT_FILTER_PLAIN_OBJ as DEFAULT_FILTER_PLAIN_OBJ, ɵDataSchemaAttributeType as DataSchemaAttributeType, ɵDataSchemaAttributeUsageType as DataSchemaAttributeUsageType, ɵDataSchemaType as DataSchemaType, ɵDataSourceScope as DataSourceScope, ɵDataValueType as DataValueType, ɵDatePartFunctionColumn as DatePartFunctionColumn, ɵDatePartFunctionExpression as DatePartFunctionExpression, ɵDatePartType as DatePartType, ɵDefaultValueSource as DefaultValueSource, ɵDeleteQuery as DeleteQuery, ɵEMPTY_GUID as EMPTY_GUID, ɵEntityQueryColumn as EntityQueryColumn, ɵEntitySchemaQuery as EntitySchemaQuery, ɵExistsFilter as ExistsFilter, ɵExpressionMock as ExpressionMock, ɵExpressionParser as ExpressionParser, ɵExpressionResolver as ExpressionResolver, ɵExpressionType as ExpressionType, ɵFilterGroup as FilterGroup, ɵFilterMock as FilterMock, ɵFilterParser as FilterParser, ɵFilterResolver as FilterResolver, ɵFilterType as FilterType, ɵFunctionExpression as FunctionExpression, ɵFunctionType as FunctionType, ɵInFilter as InFilter, ɵInsertQuery as InsertQuery, ɵIsNullFilter as IsNullFilter, ɵItemNotFoundException as ItemNotFoundException, ɵLengthFunctionColumn as LengthFunctionColumn, ɵLengthFunctionExpression as LengthFunctionExpression, ɵLogicalOperatorType as LogicalOperatorType, ɵMacrosFunctionColumn as MacrosFunctionColumn, ɵMacrosFunctionExpression as MacrosFunctionExpression, ɵModelInPageAction as ModelInPageAction, ɵModelParameterType as ModelParameterType, ɵNextHandlerAlreadySpecifiedException as NextHandlerAlreadySpecifiedException, ɵOrderDirection as OrderDirection, ɵParameterExpression as ParameterExpression, ɵParameterQueryColumn as ParameterQueryColumn, ɵQueryMacrosType as QueryMacrosType, ɵQueryOperationType as QueryOperationType, ɵSchemaViewMaskRequest as SchemaViewMaskRequest, ɵSchemaViewMaskRequestAction as SchemaViewMaskRequestAction, ɵSelectLocalizationQuery as SelectLocalizationQuery, ɵSingleFilter as SingleFilter, ɵSubQueryColumn as SubQueryColumn, ɵSubQueryExpression as SubQueryExpression, ɵUpdateQuery as UpdateQuery, ɵValidationUtilities as ValidationUtilities, ɵWindowFunctionColumn as WindowFunctionColumn, ɵWindowFunctionExpression as WindowFunctionExpression, ɵencodeDate as encodeDate, ɵgenerateGuid as generateGuid, ɵgetColumnPlainObj as getColumnPlainObj, ɵgetFilterPlainObj as getFilterPlainObj, ɵisEmptyGuid as isEmptyGuid, ɵisGuid as isGuid, ɵparserMock as parserMock, ɵtoLocalISOString as toLocalISOString } from '@creatio/base';
|
|
2
|
+
export { ɵAggregationEvalType as AggregationEvalType, ɵAggregationFunction as AggregationFunction, ɵAggregationFunctionColumn as AggregationFunctionColumn, ɵAggregationFunctionExpression as AggregationFunctionExpression, ɵAggregationSubQueryColumn as AggregationSubQueryColumn, ɵAggregationSubQueryExpression as AggregationSubQueryExpression, ɵAggregationType as AggregationType, ɵArgumentEmptyException as ArgumentEmptyException, ɵArgumentFunctionExpression as ArgumentFunctionExpression, ɵArgumentOutOfRangeException as ArgumentOutOfRangeException, ɵArithmeticExpression as ArithmeticExpression, ɵArithmeticOperation as ArithmeticOperation, ɵArithmeticQueryColumn as ArithmeticQueryColumn, ɵBaseExpression as BaseExpression, ɵBaseExpressionParser as BaseExpressionParser, ɵBaseFilter as BaseFilter, ɵBaseFilterParser as BaseFilterParser, ɵBaseFilterableQuery as BaseFilterableQuery, ɵBaseQuery as BaseQuery, ɵBaseQueryColumn as BaseQueryColumn, ɵBaseRequest as BaseRequest, ɵBetweenFilter as BetweenFilter, ɵColumnExpression as ColumnExpression, ɵCompareFilter as CompareFilter, ɵComparisonType as ComparisonType, ɵDEFAULT_COLUMN_PLAIN_OBJ as DEFAULT_COLUMN_PLAIN_OBJ, ɵDEFAULT_FILTER_PLAIN_OBJ as DEFAULT_FILTER_PLAIN_OBJ, ɵDataSchemaAttributeType as DataSchemaAttributeType, ɵDataSchemaAttributeUsageType as DataSchemaAttributeUsageType, ɵDataSchemaType as DataSchemaType, ɵDataSourceScope as DataSourceScope, ɵDataValueType as DataValueType, ɵDatePartFunctionColumn as DatePartFunctionColumn, ɵDatePartFunctionExpression as DatePartFunctionExpression, ɵDatePartType as DatePartType, ɵDefaultValueSource as DefaultValueSource, ɵDeleteQuery as DeleteQuery, ɵEMPTY_GUID as EMPTY_GUID, ɵEntityQueryColumn as EntityQueryColumn, ɵEntitySchemaQuery as EntitySchemaQuery, ɵExistsFilter as ExistsFilter, ɵExpressionMock as ExpressionMock, ɵExpressionParser as ExpressionParser, ɵExpressionResolver as ExpressionResolver, ɵExpressionType as ExpressionType, ɵFilterGroup as FilterGroup, ɵFilterMock as FilterMock, ɵFilterParser as FilterParser, ɵFilterResolver as FilterResolver, ɵFilterType as FilterType, ɵFunctionExpression as FunctionExpression, ɵFunctionType as FunctionType, ɵInFilter as InFilter, ɵInsertQuery as InsertQuery, ɵIsNullFilter as IsNullFilter, ɵItemNotFoundException as ItemNotFoundException, ɵLengthFunctionColumn as LengthFunctionColumn, ɵLengthFunctionExpression as LengthFunctionExpression, ɵLogicalOperatorType as LogicalOperatorType, ɵMacrosFunctionColumn as MacrosFunctionColumn, ɵMacrosFunctionExpression as MacrosFunctionExpression, ɵModelInPageAction as ModelInPageAction, ɵModelParameterType as ModelParameterType, ɵNextHandlerAlreadySpecifiedException as NextHandlerAlreadySpecifiedException, ɵOrderDirection as OrderDirection, ɵParameterExpression as ParameterExpression, ɵParameterQueryColumn as ParameterQueryColumn, ɵPlatformAPIs as PlatformAPIs, ɵQueryMacrosType as QueryMacrosType, ɵQueryOperationType as QueryOperationType, ɵSchemaViewMaskRequest as SchemaViewMaskRequest, ɵSchemaViewMaskRequestAction as SchemaViewMaskRequestAction, ɵSelectLocalizationQuery as SelectLocalizationQuery, ɵSingleFilter as SingleFilter, ɵSubQueryColumn as SubQueryColumn, ɵSubQueryExpression as SubQueryExpression, ɵUpdateQuery as UpdateQuery, ɵValidationUtilities as ValidationUtilities, ɵWindowFunctionColumn as WindowFunctionColumn, ɵWindowFunctionExpression as WindowFunctionExpression, ɵencodeDate as encodeDate, ɵgenerateGuid as generateGuid, ɵgetColumnPlainObj as getColumnPlainObj, ɵgetFilterPlainObj as getFilterPlainObj, ɵisEmptyGuid as isEmptyGuid, ɵisGuid as isGuid, ɵparserMock as parserMock, ɵtoLocalISOString as toLocalISOString } from '@creatio/base';
|
|
3
3
|
import { get, set, upperFirst, camelCase, isEqual, cloneDeep } from 'lodash';
|
|
4
4
|
import 'reflect-metadata';
|
|
5
5
|
import { __decorate, __metadata } from 'tslib';
|
|
@@ -218,6 +218,9 @@ class LazyModulesManager {
|
|
|
218
218
|
add(ref) {
|
|
219
219
|
this._refs.add(ref);
|
|
220
220
|
}
|
|
221
|
+
size() {
|
|
222
|
+
return this._refs.size;
|
|
223
|
+
}
|
|
221
224
|
loadAll() {
|
|
222
225
|
return Promise.all(Array.from(this._refs).map((ref) => ref.loadAndBootstrap()));
|
|
223
226
|
}
|
|
@@ -267,7 +270,7 @@ var HandlerSourceType;
|
|
|
267
270
|
HandlerSourceType[HandlerSourceType["Host"] = 2] = "Host";
|
|
268
271
|
})(HandlerSourceType || (HandlerSourceType = {}));
|
|
269
272
|
|
|
270
|
-
const global$
|
|
273
|
+
const global$4 = window;
|
|
271
274
|
/**
|
|
272
275
|
* @public
|
|
273
276
|
* @description For internal use only.
|
|
@@ -285,10 +288,10 @@ class ɵBaseRegistry {
|
|
|
285
288
|
}
|
|
286
289
|
static get store() {
|
|
287
290
|
if (!this._instance) {
|
|
288
|
-
let globalInstance = get(global$
|
|
291
|
+
let globalInstance = get(global$4, this._prefix + this.registryKey);
|
|
289
292
|
if (!globalInstance) {
|
|
290
293
|
globalInstance = new this();
|
|
291
|
-
set(global$
|
|
294
|
+
set(global$4, this._prefix + this.registryKey, globalInstance);
|
|
292
295
|
}
|
|
293
296
|
this._instance = globalInstance;
|
|
294
297
|
}
|
|
@@ -364,6 +367,44 @@ function matchScopes(handlerScopes, requestScopes) {
|
|
|
364
367
|
return handlerScopes.some((s) => requestScopes?.includes(s));
|
|
365
368
|
}
|
|
366
369
|
|
|
370
|
+
var _a;
|
|
371
|
+
const global$3 = window;
|
|
372
|
+
global$3.creatio ?? (global$3.creatio = {});
|
|
373
|
+
(_a = global$3.creatio)._bootstrappedCrtModules ?? (_a._bootstrappedCrtModules = new Map());
|
|
374
|
+
/**
|
|
375
|
+
* @internal
|
|
376
|
+
*/
|
|
377
|
+
const bootstrappedCrtModules = global$3.creatio._bootstrappedCrtModules;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* @internal
|
|
381
|
+
*/
|
|
382
|
+
function iterateRootModules(callback) {
|
|
383
|
+
bootstrappedCrtModules.forEach((info, type) => {
|
|
384
|
+
if (info.root) {
|
|
385
|
+
callback(info, type);
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* @internal
|
|
391
|
+
*/
|
|
392
|
+
function callOnContextCreateHooks(context) {
|
|
393
|
+
iterateRootModules((info) => info.options?.onContextCreate?.(context));
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* @internal
|
|
397
|
+
*/
|
|
398
|
+
function callOnContextUpdateHooks(context) {
|
|
399
|
+
iterateRootModules((info) => info.options?.onContextUpdate?.(context));
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* @internal
|
|
403
|
+
*/
|
|
404
|
+
function callOnContextDestroyHooks(context) {
|
|
405
|
+
iterateRootModules((info) => info.options?.onContextDestroy?.(context));
|
|
406
|
+
}
|
|
407
|
+
|
|
367
408
|
/**
|
|
368
409
|
* @internal
|
|
369
410
|
* @hostPublicApi available through window.handlerChain
|
|
@@ -389,7 +430,7 @@ class InternalHandlerChain {
|
|
|
389
430
|
else {
|
|
390
431
|
const handlers = this._getMatchedHandlers(request);
|
|
391
432
|
if (!LazyModulesManager.instance.lazyLoadingDisabled) {
|
|
392
|
-
await this._loadLazyHandlers(handlers);
|
|
433
|
+
await this._loadLazyHandlers(request, handlers);
|
|
393
434
|
}
|
|
394
435
|
handler = this._buildHandlersChain(request, handlers);
|
|
395
436
|
}
|
|
@@ -499,14 +540,19 @@ class InternalHandlerChain {
|
|
|
499
540
|
throw new Error('Handler should implement "BaseRequestHandler"');
|
|
500
541
|
}
|
|
501
542
|
}
|
|
502
|
-
async _loadLazyHandlers(configs) {
|
|
543
|
+
async _loadLazyHandlers(request, configs) {
|
|
503
544
|
const lazyModules = new Set();
|
|
504
545
|
configs.forEach((config) => {
|
|
505
546
|
if (config.lazy && !config.createHandler) {
|
|
506
547
|
lazyModules.add(config.lazyModuleRef);
|
|
507
548
|
}
|
|
508
549
|
});
|
|
509
|
-
await Promise.all(
|
|
550
|
+
await Promise.all([...lazyModules].map((m) => m.loadAndBootstrap()));
|
|
551
|
+
const injectionContext = this._getInjectionContext(request?.$context);
|
|
552
|
+
if (injectionContext && lazyModules.size) {
|
|
553
|
+
lazyModules.forEach((ref) => injectionContext.addLazyModule(ref.typeRef));
|
|
554
|
+
callOnContextUpdateHooks(injectionContext);
|
|
555
|
+
}
|
|
510
556
|
}
|
|
511
557
|
_getMatchedHandlers(request) {
|
|
512
558
|
return this._handlers.filter((h) => {
|
|
@@ -519,10 +565,8 @@ class InternalHandlerChain {
|
|
|
519
565
|
_buildHandlersChain(request, handlers) {
|
|
520
566
|
const comparer = new HandlersOrderComparer(request);
|
|
521
567
|
handlers.sort((a, b) => comparer.compare(a, b));
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
return handlerConfig.createHandler.call(handlerConfig, injectionContext);
|
|
525
|
-
});
|
|
568
|
+
const injectionContext = this._getInjectionContext(request?.$context);
|
|
569
|
+
const handlerInstances = handlers.map((handlerConfig) => handlerConfig.createHandler.call(handlerConfig, injectionContext));
|
|
526
570
|
handlerInstances.forEach((handler) => this._checkHandlerInstanceOf(handler));
|
|
527
571
|
this._joinHandlersInChain(handlerInstances);
|
|
528
572
|
const result = handlerInstances[0];
|
|
@@ -1102,6 +1146,27 @@ class RemoteEntriesRegistry extends ɵBaseRegistry {
|
|
|
1102
1146
|
*/
|
|
1103
1147
|
RemoteEntriesRegistry.registryKey = 'remotes';
|
|
1104
1148
|
|
|
1149
|
+
/**
|
|
1150
|
+
* @internal
|
|
1151
|
+
*/
|
|
1152
|
+
const registryKey = 'ChatMessageTypeRegistry';
|
|
1153
|
+
/**
|
|
1154
|
+
* @internal
|
|
1155
|
+
* @hostPublicApi available through window.creatio.registry.ChatMessageTypeRegistry
|
|
1156
|
+
*/
|
|
1157
|
+
class ChatMessageTypeRegistry extends ɵBaseRegistry {
|
|
1158
|
+
static get messageTypes() {
|
|
1159
|
+
return this.store.typeInfos;
|
|
1160
|
+
}
|
|
1161
|
+
static register(messageType, selector) {
|
|
1162
|
+
this.messageTypes.set(messageType, selector);
|
|
1163
|
+
}
|
|
1164
|
+
static getSelector(messageType) {
|
|
1165
|
+
return this.store.typeInfos.get(messageType);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
ChatMessageTypeRegistry.registryKey = registryKey;
|
|
1169
|
+
|
|
1105
1170
|
/**
|
|
1106
1171
|
* @internal
|
|
1107
1172
|
*/
|
|
@@ -1365,6 +1430,43 @@ class DataRequest extends ɵBaseRequest {
|
|
|
1365
1430
|
* @property {unknown} params - request parameters.
|
|
1366
1431
|
*/
|
|
1367
1432
|
|
|
1433
|
+
/**
|
|
1434
|
+
* @internal
|
|
1435
|
+
*/
|
|
1436
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1437
|
+
function CrtRequest(config) {
|
|
1438
|
+
return function (type) {
|
|
1439
|
+
checkTypeNameFormat(config.type, 'RequestTypeName');
|
|
1440
|
+
checkCrtTypeNamePascalCase(config.type);
|
|
1441
|
+
RequestRegistryService.register(config, type);
|
|
1442
|
+
};
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
/**
|
|
1446
|
+
* @hostPublicApi
|
|
1447
|
+
* TODO: RND-55882
|
|
1448
|
+
*/
|
|
1449
|
+
let HandleViewModelAttributeChangeRequest = class HandleViewModelAttributeChangeRequest extends ɵBaseRequest {
|
|
1450
|
+
constructor(payload) {
|
|
1451
|
+
super();
|
|
1452
|
+
this.type = 'crt.HandleViewModelAttributeChangeRequest';
|
|
1453
|
+
this.attributeName = payload.attributeName;
|
|
1454
|
+
this.value = payload.value;
|
|
1455
|
+
this.oldValue = payload.oldValue;
|
|
1456
|
+
// eslint-disable-next-line sonar/deprecation
|
|
1457
|
+
this.silent = Boolean(payload.silent);
|
|
1458
|
+
this.preventAttributeChangeRequest = Boolean(payload.preventAttributeChangeRequest);
|
|
1459
|
+
this.preventStateChange = Boolean(payload.preventStateChange);
|
|
1460
|
+
this.preventRunBusinessRules = Boolean(payload.preventRunBusinessRules);
|
|
1461
|
+
}
|
|
1462
|
+
};
|
|
1463
|
+
HandleViewModelAttributeChangeRequest = __decorate([
|
|
1464
|
+
CrtRequest({
|
|
1465
|
+
type: 'crt.HandleViewModelAttributeChangeRequest',
|
|
1466
|
+
}),
|
|
1467
|
+
__metadata("design:paramtypes", [Object])
|
|
1468
|
+
], HandleViewModelAttributeChangeRequest);
|
|
1469
|
+
|
|
1368
1470
|
/**
|
|
1369
1471
|
* @internal
|
|
1370
1472
|
*/
|
|
@@ -1491,18 +1593,6 @@ function CrtDesignTimeViewElement(config) {
|
|
|
1491
1593
|
};
|
|
1492
1594
|
}
|
|
1493
1595
|
|
|
1494
|
-
/**
|
|
1495
|
-
* @internal
|
|
1496
|
-
*/
|
|
1497
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1498
|
-
function CrtRequest(config) {
|
|
1499
|
-
return function (type) {
|
|
1500
|
-
checkTypeNameFormat(config.type, 'RequestTypeName');
|
|
1501
|
-
checkCrtTypeNamePascalCase(config.type);
|
|
1502
|
-
RequestRegistryService.register(config, type);
|
|
1503
|
-
};
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
1596
|
/**
|
|
1507
1597
|
* @internal
|
|
1508
1598
|
* @hostPublicApi
|
|
@@ -1537,9 +1627,12 @@ class LazyModuleRef {
|
|
|
1537
1627
|
get typeRef() {
|
|
1538
1628
|
return this._typeRef;
|
|
1539
1629
|
}
|
|
1540
|
-
constructor(_metadata, _bootstrapFn
|
|
1630
|
+
constructor(_metadata, _bootstrapFn,
|
|
1631
|
+
/** Name of source build ('host' or remote name) */
|
|
1632
|
+
sourceName) {
|
|
1541
1633
|
this._metadata = _metadata;
|
|
1542
1634
|
this._bootstrapFn = _bootstrapFn;
|
|
1635
|
+
this.sourceName = sourceName;
|
|
1543
1636
|
}
|
|
1544
1637
|
loadAndBootstrap() {
|
|
1545
1638
|
if (!this._modulePromise) {
|
|
@@ -1750,6 +1843,25 @@ function CrtConverter(config) {
|
|
|
1750
1843
|
};
|
|
1751
1844
|
}
|
|
1752
1845
|
|
|
1846
|
+
/**
|
|
1847
|
+
* @public
|
|
1848
|
+
* @description CrtChatMessageType decorator allows user to register components as a message type in chat.
|
|
1849
|
+
* @param config - registration config. {@link ChatMessageTypeRegistrationConfig}.
|
|
1850
|
+
*
|
|
1851
|
+
* @example
|
|
1852
|
+
* @CrtChatMessageType({
|
|
1853
|
+
* selector: 'usr-video-message',
|
|
1854
|
+
* messageType: 'video',
|
|
1855
|
+
* })
|
|
1856
|
+
* export class AppComponent { }
|
|
1857
|
+
*/
|
|
1858
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1859
|
+
function CrtChatMessageType(config) {
|
|
1860
|
+
return function (type) {
|
|
1861
|
+
ChatMessageTypeRegistry.register(config.messageType, config.selector);
|
|
1862
|
+
};
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1753
1865
|
/**
|
|
1754
1866
|
* @internal
|
|
1755
1867
|
*/
|
|
@@ -1801,6 +1913,9 @@ function registerAngularViewElement(config, typeRef) {
|
|
|
1801
1913
|
});
|
|
1802
1914
|
}
|
|
1803
1915
|
|
|
1916
|
+
/**
|
|
1917
|
+
* @internal
|
|
1918
|
+
*/
|
|
1804
1919
|
function checkRemoteName(remoteName) {
|
|
1805
1920
|
if (!RemoteEntriesRegistry.items.has(remoteName)) {
|
|
1806
1921
|
throw new Error(`Remote entry with name '${remoteName}' does not exist`);
|
|
@@ -2010,7 +2125,12 @@ function bootstrapLazyCrtModule(name, descriptor, options, lazyModuleRef) {
|
|
|
2010
2125
|
/**
|
|
2011
2126
|
* @internal
|
|
2012
2127
|
*/
|
|
2013
|
-
function bootstrapDefaultCrtModule(name, type, options) {
|
|
2128
|
+
function bootstrapDefaultCrtModule(name, type, options, root) {
|
|
2129
|
+
if (bootstrappedCrtModules.has(type)) {
|
|
2130
|
+
return;
|
|
2131
|
+
}
|
|
2132
|
+
const source = options.moduleType === 'host' ? 'host' : name;
|
|
2133
|
+
bootstrappedCrtModules.set(type, { source, root, options });
|
|
2014
2134
|
try {
|
|
2015
2135
|
const moduleDefinition = getModuleMetadata(type);
|
|
2016
2136
|
if (moduleDefinition.viewElements) {
|
|
@@ -2031,11 +2151,15 @@ function bootstrapDefaultCrtModule(name, type, options) {
|
|
|
2031
2151
|
}
|
|
2032
2152
|
moduleDefinition.includes?.forEach((t) => {
|
|
2033
2153
|
if (typeof t === 'function') {
|
|
2034
|
-
bootstrapDefaultCrtModule(name, t, options);
|
|
2154
|
+
bootstrapDefaultCrtModule(name, t, options, false);
|
|
2035
2155
|
bootstrapPredefinedModules(name, t, options);
|
|
2036
2156
|
}
|
|
2037
2157
|
else if (typeof t === 'object') {
|
|
2038
|
-
|
|
2158
|
+
if (options.moduleType === 'remote' && !name) {
|
|
2159
|
+
console.error("To use lazy loading, 'remoteName' parameter should be specified.");
|
|
2160
|
+
return;
|
|
2161
|
+
}
|
|
2162
|
+
const ref = new LazyModuleRef(t, (x) => bootstrapDefaultCrtModule(name, x, options, false), source);
|
|
2039
2163
|
bootstrapLazyCrtModule(name, t, options, ref);
|
|
2040
2164
|
LazyModulesManager.instance.add(ref);
|
|
2041
2165
|
}
|
|
@@ -2080,7 +2204,7 @@ function bootstrapCrtModule(...args) {
|
|
|
2080
2204
|
throw new Error('Host module cannot have name');
|
|
2081
2205
|
}
|
|
2082
2206
|
}
|
|
2083
|
-
bootstrapDefaultCrtModule(name, type, options);
|
|
2207
|
+
bootstrapDefaultCrtModule(name, type, options, true);
|
|
2084
2208
|
bootstrapPredefinedModules(name, type, options);
|
|
2085
2209
|
if (options.moduleType === 'remote') {
|
|
2086
2210
|
BootstrapNotifier.instance.notify(type);
|
|
@@ -2159,6 +2283,7 @@ function bootstrapCrtModuleHandlerChainServices(type) {
|
|
|
2159
2283
|
* });
|
|
2160
2284
|
*/
|
|
2161
2285
|
function resetGlobals() {
|
|
2286
|
+
bootstrappedCrtModules.clear();
|
|
2162
2287
|
ViewElementRegistry.viewElements.clear();
|
|
2163
2288
|
InternalRequestHandlerRegistry.clear();
|
|
2164
2289
|
HandlerChainService.instance.clear();
|
|
@@ -2573,9 +2698,30 @@ __decorate([
|
|
|
2573
2698
|
__metadata("design:type", Function)
|
|
2574
2699
|
], CrtZoneService.prototype, "runOutside", void 0);
|
|
2575
2700
|
|
|
2701
|
+
/**
|
|
2702
|
+
* @public
|
|
2703
|
+
* @classdesc Service to working with dialog using handler chain.
|
|
2704
|
+
* @extends {BaseHandlerChainService}
|
|
2705
|
+
*/
|
|
2706
|
+
class DialogService extends BaseHandlerChainService {
|
|
2707
|
+
constructor() {
|
|
2708
|
+
super(...arguments);
|
|
2709
|
+
/**
|
|
2710
|
+
* @internal
|
|
2711
|
+
*/
|
|
2712
|
+
this.requestType = 'crt.DialogService';
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
__decorate([
|
|
2716
|
+
ImplementUsingHandlerChain({
|
|
2717
|
+
methodName: 'openDialog',
|
|
2718
|
+
}),
|
|
2719
|
+
__metadata("design:type", Function)
|
|
2720
|
+
], DialogService.prototype, "open", void 0);
|
|
2721
|
+
|
|
2576
2722
|
/**
|
|
2577
2723
|
* Generated bundle index. Do not edit.
|
|
2578
2724
|
*/
|
|
2579
2725
|
|
|
2580
|
-
export { BaseRequestHandler, BaseValidator, BootstrapNotifier, ConverterRegistry, CrtConverter, CrtDesignTimeViewElement, CrtInject, CrtInput, CrtInputRegistrationConfig, CrtInterfaceDesignerItem, CrtModule, CrtOutput, CrtRequest, CrtRequestHandler, CrtValidationInput, CrtValidator, CrtViewElement, CrtZoneService, DataRequest, DataSourceLoadType, DesignTimeViewElementRegistry, DesignerToolGroupType, FeatureService, HandlerChainService, HandlerChainServicesRegistry, HandlerSourceType, HandlersOrderComparer, HttpClientService, ImplementUsingHandlerChain, InterfaceDesignerItemRegistrationConfig, InterfaceDesignerItemRegistry, InternalRequestHandlerRegistry, InternalRequestHandlerRegistryType, LazyModuleRef, LazyModulesManager, LicenseService, LocalizableValue, MaskService, MethodInvokeRequest, Model, PkgTopology, RemoteEntriesRegistry, RemoteEntryType, RequestHandlerRegistryService, RequestRegistryService, RightsService, SysSetting, SysSettingValue, SysSettingsService, SysValuesService, VIEW_ELEMENT_DEFAULT_HEIGHT, ValidatorMapValue, ValidatorRegistry, ViewElementDataGroupType, ViewElementGroupType, ViewElementProperty, ViewElementRegistry, ViewElementReuseStrategy, ViewElementVisibilityStrategy, _from, applyLocalizeMetadataFn, bootstrapCrtModule, bootstrapCrtModuleHandlerChainServices, checkCrtTypeNamePascalCase, checkIfTypeRegistered, checkOnlyOneRegistration, checkTypeNameFormat, checkTypeNamePascalCase, crtInjectPrefix, crtInputPrefix, crtOutputPrefix, crtValidationInputPrefix, designTimeViewElementRegistryKey, getConverterMetadata, getCrtInputsMetadata, getCrtOutputsMetadata, getCrtValidationInputsMetadata, getDesignTimeViewElementMetadata, getHandlerChainServiceMetadata, getInterfaceDesignerItemMetadata, getModuleMetadata, getRequestHandlerMetadata, getTypeDependencies, getValidatorMetadata, getViewElementMetadata, hasInterfaceDesignerItemMetadata, instantiate, interfaceDesignerItemRegistryKey, isComponentPropertyBindable, localize, matchScopes, objectDeepKeys, registerAngularViewElement, registerViewElement, resetGlobals, setConverterMetadata, setDesignTimeViewElementMetadata, setInterfaceDesignerItemMetadata, setModuleMetadata, setRequestHandlerMetadata, setValidatorMetadata, setViewElementMetadata, toAggregationEval, toAggregationEvalType, toAggregationFunction, toAggregationType, toDatePart, toDatePartType, toNumericFunctionType, toOrderDirection, toPascalCase, toSortDirection, toStringFunctionType, validatorRegistryKey, viewElementRegistryKey, ɵBaseRegistry, ɵcheckTypeNameFormat, ɵinstantiate };
|
|
2726
|
+
export { 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, MethodInvokeRequest, Model, PkgTopology, RemoteEntriesRegistry, RemoteEntryType, RequestHandlerRegistryService, RequestRegistryService, RightsService, SysSetting, SysSettingValue, SysSettingsService, SysValuesService, VIEW_ELEMENT_DEFAULT_HEIGHT, ValidatorMapValue, ValidatorRegistry, ViewElementDataGroupType, ViewElementGroupType, ViewElementProperty, ViewElementRegistry, ViewElementReuseStrategy, ViewElementVisibilityStrategy, _from, applyLocalizeMetadataFn, bootstrapCrtModule, bootstrapCrtModuleHandlerChainServices, bootstrappedCrtModules, callOnContextCreateHooks, callOnContextDestroyHooks, callOnContextUpdateHooks, checkCrtTypeNamePascalCase, checkIfTypeRegistered, checkOnlyOneRegistration, checkTypeNameFormat, checkTypeNamePascalCase, crtInjectPrefix, crtInputPrefix, crtOutputPrefix, crtValidationInputPrefix, designTimeViewElementRegistryKey, getConverterMetadata, getCrtInputsMetadata, getCrtOutputsMetadata, getCrtValidationInputsMetadata, getDesignTimeViewElementMetadata, getHandlerChainServiceMetadata, getInterfaceDesignerItemMetadata, getModuleMetadata, getRequestHandlerMetadata, getTypeDependencies, getValidatorMetadata, getViewElementMetadata, hasInterfaceDesignerItemMetadata, instantiate, interfaceDesignerItemRegistryKey, isComponentPropertyBindable, localize, matchScopes, objectDeepKeys, registerAngularViewElement, registerViewElement, registryKey, resetGlobals, setConverterMetadata, setDesignTimeViewElementMetadata, setInterfaceDesignerItemMetadata, setModuleMetadata, setRequestHandlerMetadata, setValidatorMetadata, setViewElementMetadata, toAggregationEval, toAggregationEvalType, toAggregationFunction, toAggregationType, toDatePart, toDatePartType, toNumericFunctionType, toOrderDirection, toPascalCase, toSortDirection, toStringFunctionType, validatorRegistryKey, viewElementRegistryKey, ɵBaseRegistry, ɵcheckTypeNameFormat, ɵinstantiate };
|
|
2581
2727
|
//# sourceMappingURL=creatio-devkit-common.mjs.map
|