@creatio-devkit/common 0.813.0 → 0.815.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/esm2020/lib/base-exports.mjs +3 -3
  3. package/esm2020/lib/internal/decorators/request/request.decorator.mjs +1 -1
  4. package/esm2020/lib/internal/models/injection-context/injection-context.mjs +1 -1
  5. package/esm2020/lib/internal/models/lazy-module-ref.mjs +5 -2
  6. package/esm2020/lib/internal/services/chat-message-type-registry/chat-message-type-registry.mjs +22 -0
  7. package/esm2020/lib/internal/services/chat-message-type-registry/index.mjs +2 -0
  8. package/esm2020/lib/internal/services/index.mjs +2 -1
  9. package/esm2020/lib/internal/services/lazy-modules-manager/lazy-modules-manager.mjs +4 -1
  10. package/esm2020/lib/public/decorators/chat-message-type/chat-message-type.decorator.mjs +20 -0
  11. package/esm2020/lib/public/decorators/chat-message-type/index.mjs +2 -0
  12. package/esm2020/lib/public/decorators/index.mjs +2 -1
  13. package/esm2020/lib/public/functions/bootstrap-crt-module.mjs +18 -5
  14. package/esm2020/lib/public/functions/bootstrapped-crt-modules.mjs +9 -0
  15. package/esm2020/lib/public/functions/crt-module-context-hooks.mjs +30 -0
  16. package/esm2020/lib/public/functions/index.mjs +3 -1
  17. package/esm2020/lib/public/functions/reset-globals.mjs +3 -1
  18. package/esm2020/lib/public/models/index.mjs +2 -1
  19. package/esm2020/lib/public/models/input/input-registration-config.model.mjs +1 -1
  20. package/esm2020/lib/public/models/item-creation-config.mjs +2 -0
  21. package/esm2020/lib/public/models/request/handle-view-model-attribute-change.request.mjs +29 -0
  22. package/esm2020/lib/public/models/request/index.mjs +4 -1
  23. package/esm2020/lib/public/models/request/model-event.model.mjs +2 -0
  24. package/esm2020/lib/public/models/request/view-model-attribute-change-event-options.mjs +2 -0
  25. package/esm2020/lib/public/services/dialog-service/dialog.service.mjs +24 -0
  26. package/esm2020/lib/public/services/dialog-service/index.mjs +2 -0
  27. package/esm2020/lib/public/services/handler-chain/handler-chain.service.mjs +1 -1
  28. package/esm2020/lib/public/services/handler-chain/internal-handler-chain.mjs +12 -8
  29. package/esm2020/lib/public/services/index.mjs +2 -1
  30. package/esm2020/lib/public/services/license/license.service.mjs +1 -1
  31. package/fesm2015/creatio-devkit-common.mjs +176 -29
  32. package/fesm2015/creatio-devkit-common.mjs.map +1 -1
  33. package/fesm2020/creatio-devkit-common.mjs +175 -29
  34. package/fesm2020/creatio-devkit-common.mjs.map +1 -1
  35. package/index.d.ts +149 -22
  36. package/package.json +2 -2
  37. package/esm2020/lib/public/types/index.mjs +0 -2
  38. package/esm2020/lib/public/types/teardown-logic.type.mjs +0 -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, ɵ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, ɵMessageChannelType as MessageChannelType, ɵ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, ɵisEmptyGuid as isEmptyGuid, ɵisGuid as isGuid, ɵtoLocalISOString as toLocalISOString } from '@creatio/base';
3
3
  import { __awaiter, __decorate, __metadata } from 'tslib';
4
4
  import { get, set, upperFirst, camelCase, isEqual, cloneDeep } from 'lodash';
5
5
  import 'reflect-metadata';
@@ -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$3 = window;
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$3, this._prefix + this.registryKey);
291
+ let globalInstance = get(global$4, this._prefix + this.registryKey);
289
292
  if (!globalInstance) {
290
293
  globalInstance = new this();
291
- set(global$3, this._prefix + this.registryKey, globalInstance);
294
+ set(global$4, this._prefix + this.registryKey, globalInstance);
292
295
  }
293
296
  this._instance = globalInstance;
294
297
  }
@@ -365,6 +368,45 @@ function matchScopes(handlerScopes, requestScopes) {
365
368
  return handlerScopes.some((s) => requestScopes === null || requestScopes === void 0 ? void 0 : requestScopes.includes(s));
366
369
  }
367
370
 
371
+ var _b, _c;
372
+ var _a$1;
373
+ const global$3 = window;
374
+ (_b = global$3.creatio) !== null && _b !== void 0 ? _b : (global$3.creatio = {});
375
+ (_c = (_a$1 = global$3.creatio)._bootstrappedCrtModules) !== null && _c !== void 0 ? _c : (_a$1._bootstrappedCrtModules = new Map());
376
+ /**
377
+ * @internal
378
+ */
379
+ const bootstrappedCrtModules = global$3.creatio._bootstrappedCrtModules;
380
+
381
+ /**
382
+ * @internal
383
+ */
384
+ function iterateRootModules(callback) {
385
+ bootstrappedCrtModules.forEach((info, type) => {
386
+ if (info.root) {
387
+ callback(info, type);
388
+ }
389
+ });
390
+ }
391
+ /**
392
+ * @internal
393
+ */
394
+ function callOnContextCreateHooks(context) {
395
+ iterateRootModules((info) => { var _a, _b; return (_b = (_a = info.options) === null || _a === void 0 ? void 0 : _a.onContextCreate) === null || _b === void 0 ? void 0 : _b.call(_a, context); });
396
+ }
397
+ /**
398
+ * @internal
399
+ */
400
+ function callOnContextUpdateHooks(context) {
401
+ iterateRootModules((info) => { var _a, _b; return (_b = (_a = info.options) === null || _a === void 0 ? void 0 : _a.onContextUpdate) === null || _b === void 0 ? void 0 : _b.call(_a, context); });
402
+ }
403
+ /**
404
+ * @internal
405
+ */
406
+ function callOnContextDestroyHooks(context) {
407
+ iterateRootModules((info) => { var _a, _b; return (_b = (_a = info.options) === null || _a === void 0 ? void 0 : _a.onContextDestroy) === null || _b === void 0 ? void 0 : _b.call(_a, context); });
408
+ }
409
+
368
410
  /**
369
411
  * @internal
370
412
  * @hostPublicApi available through window.handlerChain
@@ -390,7 +432,7 @@ class InternalHandlerChain {
390
432
  else {
391
433
  const handlers = this._getMatchedHandlers(request);
392
434
  if (!LazyModulesManager.instance.lazyLoadingDisabled) {
393
- yield this._loadLazyHandlers(handlers);
435
+ yield this._loadLazyHandlers(request, handlers);
394
436
  }
395
437
  handler = this._buildHandlersChain(request, handlers);
396
438
  }
@@ -504,7 +546,7 @@ class InternalHandlerChain {
504
546
  throw new Error('Handler should implement "BaseRequestHandler"');
505
547
  }
506
548
  }
507
- _loadLazyHandlers(configs) {
549
+ _loadLazyHandlers(request, configs) {
508
550
  return __awaiter(this, void 0, void 0, function* () {
509
551
  const lazyModules = new Set();
510
552
  configs.forEach((config) => {
@@ -512,7 +554,12 @@ class InternalHandlerChain {
512
554
  lazyModules.add(config.lazyModuleRef);
513
555
  }
514
556
  });
515
- yield Promise.all(Array.from(lazyModules).map((m) => m.loadAndBootstrap()));
557
+ yield Promise.all([...lazyModules].map((m) => m.loadAndBootstrap()));
558
+ const injectionContext = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context);
559
+ if (injectionContext && lazyModules.size) {
560
+ lazyModules.forEach((ref) => injectionContext.addLazyModule(ref.typeRef));
561
+ callOnContextUpdateHooks(injectionContext);
562
+ }
516
563
  });
517
564
  }
518
565
  _getMatchedHandlers(request) {
@@ -526,10 +573,8 @@ class InternalHandlerChain {
526
573
  _buildHandlersChain(request, handlers) {
527
574
  const comparer = new HandlersOrderComparer(request);
528
575
  handlers.sort((a, b) => comparer.compare(a, b));
529
- const handlerInstances = handlers.map((handlerConfig) => {
530
- const injectionContext = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context);
531
- return handlerConfig.createHandler.call(handlerConfig, injectionContext);
532
- });
576
+ const injectionContext = this._getInjectionContext(request === null || request === void 0 ? void 0 : request.$context);
577
+ const handlerInstances = handlers.map((handlerConfig) => handlerConfig.createHandler.call(handlerConfig, injectionContext));
533
578
  handlerInstances.forEach((handler) => this._checkHandlerInstanceOf(handler));
534
579
  this._joinHandlersInChain(handlerInstances);
535
580
  const result = handlerInstances[0];
@@ -1104,6 +1149,27 @@ class RemoteEntriesRegistry extends ɵBaseRegistry {
1104
1149
  */
1105
1150
  RemoteEntriesRegistry.registryKey = 'remotes';
1106
1151
 
1152
+ /**
1153
+ * @internal
1154
+ */
1155
+ const registryKey = 'ChatMessageTypeRegistry';
1156
+ /**
1157
+ * @internal
1158
+ * @hostPublicApi available through window.creatio.registry.ChatMessageTypeRegistry
1159
+ */
1160
+ class ChatMessageTypeRegistry extends ɵBaseRegistry {
1161
+ static get messageTypes() {
1162
+ return this.store.typeInfos;
1163
+ }
1164
+ static register(messageType, selector) {
1165
+ this.messageTypes.set(messageType, selector);
1166
+ }
1167
+ static getSelector(messageType) {
1168
+ return this.store.typeInfos.get(messageType);
1169
+ }
1170
+ }
1171
+ ChatMessageTypeRegistry.registryKey = registryKey;
1172
+
1107
1173
  /**
1108
1174
  * @internal
1109
1175
  */
@@ -1361,6 +1427,43 @@ class CrtInputRegistrationConfig {
1361
1427
  class DataRequest extends ɵBaseRequest {
1362
1428
  }
1363
1429
 
1430
+ /**
1431
+ * @internal
1432
+ */
1433
+ // eslint-disable-next-line @typescript-eslint/naming-convention
1434
+ function CrtRequest(config) {
1435
+ return function (type) {
1436
+ checkTypeNameFormat(config.type, 'RequestTypeName');
1437
+ checkCrtTypeNamePascalCase(config.type);
1438
+ RequestRegistryService.register(config, type);
1439
+ };
1440
+ }
1441
+
1442
+ /**
1443
+ * @hostPublicApi
1444
+ * TODO: RND-55882
1445
+ */
1446
+ let HandleViewModelAttributeChangeRequest = class HandleViewModelAttributeChangeRequest extends ɵBaseRequest {
1447
+ constructor(payload) {
1448
+ super();
1449
+ this.type = 'crt.HandleViewModelAttributeChangeRequest';
1450
+ this.attributeName = payload.attributeName;
1451
+ this.value = payload.value;
1452
+ this.oldValue = payload.oldValue;
1453
+ // eslint-disable-next-line sonar/deprecation
1454
+ this.silent = Boolean(payload.silent);
1455
+ this.preventAttributeChangeRequest = Boolean(payload.preventAttributeChangeRequest);
1456
+ this.preventStateChange = Boolean(payload.preventStateChange);
1457
+ this.preventRunBusinessRules = Boolean(payload.preventRunBusinessRules);
1458
+ }
1459
+ };
1460
+ HandleViewModelAttributeChangeRequest = __decorate([
1461
+ CrtRequest({
1462
+ type: 'crt.HandleViewModelAttributeChangeRequest',
1463
+ }),
1464
+ __metadata("design:paramtypes", [Object])
1465
+ ], HandleViewModelAttributeChangeRequest);
1466
+
1364
1467
  /**
1365
1468
  * @internal
1366
1469
  */
@@ -1487,18 +1590,6 @@ function CrtDesignTimeViewElement(config) {
1487
1590
  };
1488
1591
  }
1489
1592
 
1490
- /**
1491
- * @internal
1492
- */
1493
- // eslint-disable-next-line @typescript-eslint/naming-convention
1494
- function CrtRequest(config) {
1495
- return function (type) {
1496
- checkTypeNameFormat(config.type, 'RequestTypeName');
1497
- checkCrtTypeNamePascalCase(config.type);
1498
- RequestRegistryService.register(config, type);
1499
- };
1500
- }
1501
-
1502
1593
  /**
1503
1594
  * @internal
1504
1595
  * @hostPublicApi
@@ -1533,9 +1624,12 @@ class LazyModuleRef {
1533
1624
  get typeRef() {
1534
1625
  return this._typeRef;
1535
1626
  }
1536
- constructor(_metadata, _bootstrapFn) {
1627
+ constructor(_metadata, _bootstrapFn,
1628
+ /** Name of source build ('host' or remote name) */
1629
+ sourceName) {
1537
1630
  this._metadata = _metadata;
1538
1631
  this._bootstrapFn = _bootstrapFn;
1632
+ this.sourceName = sourceName;
1539
1633
  }
1540
1634
  loadAndBootstrap() {
1541
1635
  if (!this._modulePromise) {
@@ -1741,6 +1835,25 @@ function CrtConverter(config) {
1741
1835
  };
1742
1836
  }
1743
1837
 
1838
+ /**
1839
+ * @public
1840
+ * @description CrtChatMessageType decorator allows user to register components as a message type in chat.
1841
+ * @param config - registration config. {@link ChatMessageTypeRegistrationConfig}.
1842
+ *
1843
+ * @example
1844
+ * @CrtChatMessageType({
1845
+ * selector: 'usr-video-message',
1846
+ * messageType: 'video',
1847
+ * })
1848
+ * export class AppComponent { }
1849
+ */
1850
+ // eslint-disable-next-line @typescript-eslint/naming-convention
1851
+ function CrtChatMessageType(config) {
1852
+ return function (type) {
1853
+ ChatMessageTypeRegistry.register(config.messageType, config.selector);
1854
+ };
1855
+ }
1856
+
1744
1857
  /**
1745
1858
  * @internal
1746
1859
  */
@@ -1789,6 +1902,9 @@ function registerAngularViewElement(config, typeRef) {
1789
1902
  ViewElementRegistry.register(Object.assign(Object.assign({}, config), { typeRef }));
1790
1903
  }
1791
1904
 
1905
+ /**
1906
+ * @internal
1907
+ */
1792
1908
  function checkRemoteName(remoteName) {
1793
1909
  if (!RemoteEntriesRegistry.items.has(remoteName)) {
1794
1910
  throw new Error(`Remote entry with name '${remoteName}' does not exist`);
@@ -1981,8 +2097,13 @@ function bootstrapLazyCrtModule(name, descriptor, options, lazyModuleRef) {
1981
2097
  /**
1982
2098
  * @internal
1983
2099
  */
1984
- function bootstrapDefaultCrtModule(name, type, options) {
2100
+ function bootstrapDefaultCrtModule(name, type, options, root) {
1985
2101
  var _a;
2102
+ if (bootstrappedCrtModules.has(type)) {
2103
+ return;
2104
+ }
2105
+ const source = options.moduleType === 'host' ? 'host' : name;
2106
+ bootstrappedCrtModules.set(type, { source, root, options });
1986
2107
  try {
1987
2108
  const moduleDefinition = getModuleMetadata(type);
1988
2109
  if (moduleDefinition.viewElements) {
@@ -2003,11 +2124,15 @@ function bootstrapDefaultCrtModule(name, type, options) {
2003
2124
  }
2004
2125
  (_a = moduleDefinition.includes) === null || _a === void 0 ? void 0 : _a.forEach((t) => {
2005
2126
  if (typeof t === 'function') {
2006
- bootstrapDefaultCrtModule(name, t, options);
2127
+ bootstrapDefaultCrtModule(name, t, options, false);
2007
2128
  bootstrapPredefinedModules(name, t, options);
2008
2129
  }
2009
2130
  else if (typeof t === 'object') {
2010
- const ref = new LazyModuleRef(t, (x) => bootstrapDefaultCrtModule(name, x, options));
2131
+ if (options.moduleType === 'remote' && !name) {
2132
+ console.error("To use lazy loading, 'remoteName' parameter should be specified.");
2133
+ return;
2134
+ }
2135
+ const ref = new LazyModuleRef(t, (x) => bootstrapDefaultCrtModule(name, x, options, false), source);
2011
2136
  bootstrapLazyCrtModule(name, t, options, ref);
2012
2137
  LazyModulesManager.instance.add(ref);
2013
2138
  }
@@ -2053,7 +2178,7 @@ function bootstrapCrtModule(...args) {
2053
2178
  throw new Error('Host module cannot have name');
2054
2179
  }
2055
2180
  }
2056
- bootstrapDefaultCrtModule(name, type, options);
2181
+ bootstrapDefaultCrtModule(name, type, options, true);
2057
2182
  bootstrapPredefinedModules(name, type, options);
2058
2183
  if (options.moduleType === 'remote') {
2059
2184
  BootstrapNotifier.instance.notify(type);
@@ -2133,6 +2258,7 @@ function bootstrapCrtModuleHandlerChainServices(type) {
2133
2258
  * });
2134
2259
  */
2135
2260
  function resetGlobals() {
2261
+ bootstrappedCrtModules.clear();
2136
2262
  ViewElementRegistry.viewElements.clear();
2137
2263
  InternalRequestHandlerRegistry.clear();
2138
2264
  HandlerChainService.instance.clear();
@@ -2555,9 +2681,30 @@ __decorate([
2555
2681
  __metadata("design:type", Function)
2556
2682
  ], CrtZoneService.prototype, "runOutside", void 0);
2557
2683
 
2684
+ /**
2685
+ * @public
2686
+ * @classdesc Service to working with dialog using handler chain.
2687
+ * @extends {BaseHandlerChainService}
2688
+ */
2689
+ class DialogService extends BaseHandlerChainService {
2690
+ constructor() {
2691
+ super(...arguments);
2692
+ /**
2693
+ * @internal
2694
+ */
2695
+ this.requestType = 'crt.DialogService';
2696
+ }
2697
+ }
2698
+ __decorate([
2699
+ ImplementUsingHandlerChain({
2700
+ methodName: 'openDialog',
2701
+ }),
2702
+ __metadata("design:type", Function)
2703
+ ], DialogService.prototype, "open", void 0);
2704
+
2558
2705
  /**
2559
2706
  * Generated bundle index. Do not edit.
2560
2707
  */
2561
2708
 
2562
- 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 };
2709
+ 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 };
2563
2710
  //# sourceMappingURL=creatio-devkit-common.mjs.map