@creatio-devkit/common 0.811.1 → 0.813.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 +17 -1
- package/esm2020/lib/base-exports.mjs +4 -2
- package/esm2020/lib/external/models/index.mjs +1 -2
- package/esm2020/lib/internal/constants/default-size.const.mjs +5 -0
- package/esm2020/lib/internal/constants/index.mjs +2 -1
- package/esm2020/lib/internal/decorators/request/request.decorator.mjs +1 -1
- package/esm2020/lib/internal/enums/index.mjs +1 -2
- package/esm2020/lib/internal/models/attribute-property-config.interface.mjs +2 -0
- package/esm2020/lib/internal/models/converter/converter-registry-item.mjs +1 -1
- package/esm2020/lib/internal/models/index.mjs +4 -1
- package/esm2020/lib/internal/models/internal-interface-designer-item-registration-config.model.mjs +1 -1
- package/esm2020/lib/internal/models/internal-module-definition.mjs +2 -0
- package/esm2020/lib/internal/models/lazy-module-metadata.mjs +2 -0
- package/esm2020/lib/internal/models/lazy-module-ref.mjs +23 -0
- package/esm2020/lib/internal/models/lazy-registry-item.mjs +2 -0
- package/esm2020/lib/internal/models/request-handler/handler-config.mjs +1 -1
- package/esm2020/lib/internal/models/request-handler/request-handler-registration-config.model.mjs +1 -1
- package/esm2020/lib/internal/models/validator/validator-registry-item.mjs +1 -1
- package/esm2020/lib/internal/models/view-element/angular-view-element-registration-config.model.mjs +1 -1
- package/esm2020/lib/internal/models/view-element-registry-item.mjs +1 -1
- package/esm2020/lib/internal/services/global-converters-registry/converter-registry.mjs +9 -2
- package/esm2020/lib/internal/services/index.mjs +2 -1
- package/esm2020/lib/internal/services/lazy-modules-manager/index.mjs +2 -0
- package/esm2020/lib/internal/services/lazy-modules-manager/lazy-modules-manager.mjs +32 -0
- package/esm2020/lib/internal/services/request-handler-registry/request-handler-registry.service.mjs +18 -5
- package/esm2020/lib/internal/services/request-registry/request-registry.service.mjs +1 -1
- package/esm2020/lib/internal/services/validator-registry/validator-registry.mjs +11 -3
- package/esm2020/lib/internal/services/view-element-registry/view-element-registry.mjs +34 -2
- package/esm2020/lib/internal/utils/index.mjs +2 -1
- package/esm2020/lib/internal/utils/metadata-utils.mjs +1 -1
- package/esm2020/lib/internal/utils/request-handler-scopes.mjs +10 -0
- package/esm2020/lib/public/decorators/module/module.decorator.mjs +2 -18
- package/esm2020/lib/public/decorators/view-element/view-element.decorator.mjs +7 -1
- package/esm2020/lib/public/enums/index.mjs +2 -1
- package/esm2020/lib/public/enums/view-element-property.enum.mjs +9 -0
- package/esm2020/lib/public/functions/bootstrap-crt-module-handler-chain-services.mjs +6 -2
- package/esm2020/lib/public/functions/bootstrap-crt-module.mjs +92 -4
- package/esm2020/lib/public/functions/index.mjs +2 -1
- package/esm2020/lib/public/functions/reset-globals.mjs +35 -0
- 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/license/index.mjs +2 -0
- package/esm2020/lib/public/models/license/license-restriction-operation-values.model.mjs +2 -0
- package/esm2020/lib/public/models/request/index.mjs +1 -2
- package/esm2020/lib/public/models/view-element/base-view-element-registration-config.mjs +1 -1
- package/esm2020/lib/public/models/view-element/index.mjs +2 -1
- package/esm2020/lib/public/models/view-element/view-element-visibility-strategy.mjs +16 -0
- package/esm2020/lib/public/services/handler-chain/handler-chain.service.mjs +13 -1
- package/esm2020/lib/public/services/handler-chain/internal-handler-chain.mjs +43 -11
- package/esm2020/lib/public/services/index.mjs +2 -1
- package/esm2020/lib/public/services/license/index.mjs +2 -0
- package/esm2020/lib/public/services/license/license.service.mjs +22 -0
- package/esm2020/lib/public/services/mask-service/index.mjs +1 -2
- package/esm2020/lib/public/services/mask-service/mask.service.mjs +2 -2
- package/esm2020/lib/public/services/model/model.mjs +4 -1
- package/fesm2015/creatio-devkit-common.mjs +353 -70
- package/fesm2015/creatio-devkit-common.mjs.map +1 -1
- package/fesm2020/creatio-devkit-common.mjs +361 -69
- package/fesm2020/creatio-devkit-common.mjs.map +1 -1
- package/index.d.ts +79 -7
- package/package.json +4 -4
- package/esm2020/lib/external/models/model-init-config.mjs +0 -2
- package/esm2020/lib/internal/enums/model-in-page-action.enum.mjs +0 -10
- package/esm2020/lib/public/models/request/request-registration-config.model.mjs +0 -2
- package/esm2020/lib/public/services/mask-service/schema-view-mask.request.mjs +0 -22
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ɵAggregationType, ɵAggregationFunction, ɵAggregationEvalType, ɵDatePartType, ɵFunctionType, ɵOrderDirection, ɵgenerateGuid, ɵNextHandlerAlreadySpecifiedException, ɵBaseRequest } 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, ɵModelParameterType as ModelParameterType, ɵNextHandlerAlreadySpecifiedException as NextHandlerAlreadySpecifiedException, ɵOrderDirection as OrderDirection, ɵParameterExpression as ParameterExpression, ɵParameterQueryColumn as ParameterQueryColumn, ɵQueryMacrosType as QueryMacrosType, ɵQueryOperationType as QueryOperationType, ɵ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';
|
|
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';
|
|
3
3
|
import { get, set, upperFirst, camelCase, isEqual, cloneDeep } from 'lodash';
|
|
4
4
|
import 'reflect-metadata';
|
|
5
5
|
import { __decorate, __metadata } from 'tslib';
|
|
@@ -191,6 +191,42 @@ const crtValidationInputPrefix = 'crtValidationInput:';
|
|
|
191
191
|
*/
|
|
192
192
|
const crtInjectPrefix = 'crtInject:';
|
|
193
193
|
|
|
194
|
+
/**
|
|
195
|
+
* @internal
|
|
196
|
+
*/
|
|
197
|
+
const VIEW_ELEMENT_DEFAULT_HEIGHT = '39px';
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @internal
|
|
201
|
+
*/
|
|
202
|
+
class LazyModulesManager {
|
|
203
|
+
constructor() {
|
|
204
|
+
this._refs = new Set();
|
|
205
|
+
this.lazyLoadingDisabled = false;
|
|
206
|
+
}
|
|
207
|
+
static get instance() {
|
|
208
|
+
if (!this._instance) {
|
|
209
|
+
let globalInstance = get(window, this._globalInstancePath);
|
|
210
|
+
if (!globalInstance) {
|
|
211
|
+
globalInstance = new this();
|
|
212
|
+
set(window, this._globalInstancePath, globalInstance);
|
|
213
|
+
}
|
|
214
|
+
this._instance = globalInstance;
|
|
215
|
+
}
|
|
216
|
+
return this._instance;
|
|
217
|
+
}
|
|
218
|
+
add(ref) {
|
|
219
|
+
this._refs.add(ref);
|
|
220
|
+
}
|
|
221
|
+
loadAll() {
|
|
222
|
+
return Promise.all(Array.from(this._refs).map((ref) => ref.loadAndBootstrap()));
|
|
223
|
+
}
|
|
224
|
+
clear() {
|
|
225
|
+
this._refs.clear();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
LazyModulesManager._globalInstancePath = 'creatio._lazyModulesManager';
|
|
229
|
+
|
|
194
230
|
/**
|
|
195
231
|
* @internal
|
|
196
232
|
* @hostPublicApi
|
|
@@ -231,16 +267,6 @@ var HandlerSourceType;
|
|
|
231
267
|
HandlerSourceType[HandlerSourceType["Host"] = 2] = "Host";
|
|
232
268
|
})(HandlerSourceType || (HandlerSourceType = {}));
|
|
233
269
|
|
|
234
|
-
/**
|
|
235
|
-
* @internal
|
|
236
|
-
*/
|
|
237
|
-
var ModelInPageAction;
|
|
238
|
-
(function (ModelInPageAction) {
|
|
239
|
-
ModelInPageAction["Edit"] = "edit";
|
|
240
|
-
ModelInPageAction["Add"] = "add";
|
|
241
|
-
ModelInPageAction["Copy"] = "copy";
|
|
242
|
-
})(ModelInPageAction || (ModelInPageAction = {}));
|
|
243
|
-
|
|
244
270
|
const global$3 = window;
|
|
245
271
|
/**
|
|
246
272
|
* @public
|
|
@@ -328,6 +354,16 @@ class HandlersOrderComparer {
|
|
|
328
354
|
}
|
|
329
355
|
}
|
|
330
356
|
|
|
357
|
+
/**
|
|
358
|
+
* @internal
|
|
359
|
+
*/
|
|
360
|
+
function matchScopes(handlerScopes, requestScopes) {
|
|
361
|
+
if (!handlerScopes?.length) {
|
|
362
|
+
return true;
|
|
363
|
+
}
|
|
364
|
+
return handlerScopes.some((s) => requestScopes?.includes(s));
|
|
365
|
+
}
|
|
366
|
+
|
|
331
367
|
/**
|
|
332
368
|
* @internal
|
|
333
369
|
* @hostPublicApi available through window.handlerChain
|
|
@@ -346,7 +382,17 @@ class InternalHandlerChain {
|
|
|
346
382
|
* @hostPublicApi
|
|
347
383
|
*/
|
|
348
384
|
process: async (request) => {
|
|
349
|
-
|
|
385
|
+
let handler;
|
|
386
|
+
if (this._hasCacheHandler(request)) {
|
|
387
|
+
handler = this._getCacheHandler(request);
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
const handlers = this._getMatchedHandlers(request);
|
|
391
|
+
if (!LazyModulesManager.instance.lazyLoadingDisabled) {
|
|
392
|
+
await this._loadLazyHandlers(handlers);
|
|
393
|
+
}
|
|
394
|
+
handler = this._buildHandlersChain(request, handlers);
|
|
395
|
+
}
|
|
350
396
|
this._requestListeners.forEach((listener) => listener?.(request));
|
|
351
397
|
return handler?.handle(request);
|
|
352
398
|
},
|
|
@@ -367,6 +413,15 @@ class InternalHandlerChain {
|
|
|
367
413
|
}
|
|
368
414
|
};
|
|
369
415
|
},
|
|
416
|
+
/**
|
|
417
|
+
* @hostPublicApi
|
|
418
|
+
*/
|
|
419
|
+
update: (updatedInfo) => {
|
|
420
|
+
const config = this._handlers.find((h) => h.type === updatedInfo.type);
|
|
421
|
+
if (config) {
|
|
422
|
+
config.createHandler = updatedInfo.createHandler;
|
|
423
|
+
}
|
|
424
|
+
},
|
|
370
425
|
/**
|
|
371
426
|
* @hostPublicApi
|
|
372
427
|
*/
|
|
@@ -392,8 +447,11 @@ class InternalHandlerChain {
|
|
|
392
447
|
const configs = this._handlersScopesByContextId.get(contextId) ?? [];
|
|
393
448
|
return configs.every(({ requestType, scope }) => this._handlersCache.get(requestType)?.delete(scope));
|
|
394
449
|
}
|
|
395
|
-
|
|
396
|
-
|
|
450
|
+
clear() {
|
|
451
|
+
this._handlers.splice(0);
|
|
452
|
+
this._requestListeners.clear();
|
|
453
|
+
this._handlersCache.clear();
|
|
454
|
+
this._handlersScopesByContextId.clear();
|
|
397
455
|
}
|
|
398
456
|
_getCacheHandler(request) {
|
|
399
457
|
const map = this._handlersCache.get(request.type);
|
|
@@ -441,21 +499,29 @@ class InternalHandlerChain {
|
|
|
441
499
|
throw new Error('Handler should implement "BaseRequestHandler"');
|
|
442
500
|
}
|
|
443
501
|
}
|
|
444
|
-
|
|
445
|
-
const
|
|
502
|
+
async _loadLazyHandlers(configs) {
|
|
503
|
+
const lazyModules = new Set();
|
|
504
|
+
configs.forEach((config) => {
|
|
505
|
+
if (config.lazy && !config.createHandler) {
|
|
506
|
+
lazyModules.add(config.lazyModuleRef);
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
await Promise.all(Array.from(lazyModules).map((m) => m.loadAndBootstrap()));
|
|
510
|
+
}
|
|
511
|
+
_getMatchedHandlers(request) {
|
|
512
|
+
return this._handlers.filter((h) => {
|
|
446
513
|
if (h.requestType !== request.type) {
|
|
447
514
|
return false;
|
|
448
515
|
}
|
|
449
|
-
|
|
450
|
-
return true;
|
|
451
|
-
}
|
|
452
|
-
return h.scopes.some((s) => request.scopes?.includes(s));
|
|
516
|
+
return matchScopes(h.scopes, request.scopes);
|
|
453
517
|
});
|
|
518
|
+
}
|
|
519
|
+
_buildHandlersChain(request, handlers) {
|
|
454
520
|
const comparer = new HandlersOrderComparer(request);
|
|
455
521
|
handlers.sort((a, b) => comparer.compare(a, b));
|
|
456
522
|
const handlerInstances = handlers.map((handlerConfig) => {
|
|
457
523
|
const injectionContext = this._getInjectionContext(request?.$context);
|
|
458
|
-
return handlerConfig.createHandler(injectionContext);
|
|
524
|
+
return handlerConfig.createHandler.call(handlerConfig, injectionContext);
|
|
459
525
|
});
|
|
460
526
|
handlerInstances.forEach((handler) => this._checkHandlerInstanceOf(handler));
|
|
461
527
|
this._joinHandlersInChain(handlerInstances);
|
|
@@ -516,6 +582,12 @@ class HandlerChainService {
|
|
|
516
582
|
register(handlerConfig) {
|
|
517
583
|
return this._chain.handlerChain$.register(handlerConfig);
|
|
518
584
|
}
|
|
585
|
+
/**
|
|
586
|
+
* @internal
|
|
587
|
+
*/
|
|
588
|
+
update(handlerConfig) {
|
|
589
|
+
return this._chain.handlerChain$.update(handlerConfig);
|
|
590
|
+
}
|
|
519
591
|
/**
|
|
520
592
|
* @description Method to process passed request
|
|
521
593
|
* @param request - {@link ɵBaseRequest}
|
|
@@ -536,6 +608,12 @@ class HandlerChainService {
|
|
|
536
608
|
subscribe(callback, context) {
|
|
537
609
|
return this._chain.handlerChain$.subscribe(callback, context);
|
|
538
610
|
}
|
|
611
|
+
/**
|
|
612
|
+
* @internal
|
|
613
|
+
*/
|
|
614
|
+
clear() {
|
|
615
|
+
this._chain.clear();
|
|
616
|
+
}
|
|
539
617
|
}
|
|
540
618
|
|
|
541
619
|
/**
|
|
@@ -666,10 +744,18 @@ class InternalRequestHandlerRegistryType {
|
|
|
666
744
|
* @publicHostApi
|
|
667
745
|
*/
|
|
668
746
|
static addRequestHandler(handlerType, config) {
|
|
669
|
-
|
|
670
|
-
|
|
747
|
+
const existingHandler = this._requestHandlersMap.get(handlerType);
|
|
748
|
+
if (!existingHandler || (existingHandler.instanceConfig?.lazy && !existingHandler.instanceType)) {
|
|
749
|
+
const mergedConfig = {
|
|
750
|
+
instanceType: config.instanceType,
|
|
751
|
+
instanceConfig: {
|
|
752
|
+
...(existingHandler?.instanceConfig ?? {}),
|
|
753
|
+
...config.instanceConfig,
|
|
754
|
+
},
|
|
755
|
+
};
|
|
756
|
+
this._requestHandlersMap.set(handlerType, mergedConfig);
|
|
671
757
|
for (const listener of this._addItemListeners) {
|
|
672
|
-
listener(handlerType,
|
|
758
|
+
listener(handlerType, mergedConfig);
|
|
673
759
|
}
|
|
674
760
|
}
|
|
675
761
|
}
|
|
@@ -685,6 +771,11 @@ class InternalRequestHandlerRegistryType {
|
|
|
685
771
|
}
|
|
686
772
|
}
|
|
687
773
|
}
|
|
774
|
+
static clear() {
|
|
775
|
+
for (const type of this._requestHandlersMap.keys()) {
|
|
776
|
+
this.removeRequestHandler(type);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
688
779
|
}
|
|
689
780
|
InternalRequestHandlerRegistryType._addItemListeners = [];
|
|
690
781
|
InternalRequestHandlerRegistryType._removeItemListeners = [];
|
|
@@ -701,7 +792,7 @@ if (!global$1.creatio.requestHandlerRegistry) {
|
|
|
701
792
|
* @internal
|
|
702
793
|
*/
|
|
703
794
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
704
|
-
const InternalRequestHandlerRegistry =
|
|
795
|
+
const InternalRequestHandlerRegistry = global$1.creatio.requestHandlerRegistry;
|
|
705
796
|
/**
|
|
706
797
|
* @internal
|
|
707
798
|
*/
|
|
@@ -763,6 +854,9 @@ RequestRegistryService._requestsRegistrationInfos = new Map();
|
|
|
763
854
|
* @hostPublicApi available through window.creatio.registry.ConverterRegistry
|
|
764
855
|
*/
|
|
765
856
|
class ConverterRegistry extends ɵBaseRegistry {
|
|
857
|
+
static has(type) {
|
|
858
|
+
return this.store.typeInfos.has(type);
|
|
859
|
+
}
|
|
766
860
|
static get(type) {
|
|
767
861
|
if (!this.store.typeInfos.has(type)) {
|
|
768
862
|
throw new Error(`'${type}' converter doesn't exist`);
|
|
@@ -773,7 +867,11 @@ class ConverterRegistry extends ɵBaseRegistry {
|
|
|
773
867
|
checkTypeNameFormat(item.type, 'ConverterTypeName');
|
|
774
868
|
checkCrtTypeNamePascalCase(item.type);
|
|
775
869
|
// TODO RND-21723
|
|
776
|
-
this.store.typeInfos.
|
|
870
|
+
const existingItem = this.store.typeInfos.get(item.type);
|
|
871
|
+
this.store.typeInfos.set(item.type, {
|
|
872
|
+
...(existingItem ?? {}),
|
|
873
|
+
...item,
|
|
874
|
+
});
|
|
777
875
|
}
|
|
778
876
|
static clear() {
|
|
779
877
|
this.store.typeInfos.clear();
|
|
@@ -792,18 +890,50 @@ const viewElementRegistryKey = 'ViewElementRegistry';
|
|
|
792
890
|
class ViewElementRegistry extends ɵBaseRegistry {
|
|
793
891
|
static validate(config) {
|
|
794
892
|
checkTypeNameFormat(config.type, 'ViewElementTypeName');
|
|
893
|
+
const existingItem = ViewElementRegistry.viewElements.get(config.type);
|
|
894
|
+
if (existingItem?.lazy && !('selector' in existingItem) && !existingItem.typeRef) {
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
795
897
|
checkOnlyOneRegistration(config.type, config, ViewElementRegistry.viewElements);
|
|
796
898
|
}
|
|
797
899
|
static get viewElements() {
|
|
798
900
|
return this.store.typeInfos;
|
|
799
901
|
}
|
|
800
902
|
static register(config) {
|
|
801
|
-
this.viewElements.
|
|
903
|
+
const existingConfig = this.viewElements.get(config.type);
|
|
904
|
+
this.viewElements.set(config.type, {
|
|
905
|
+
...(existingConfig ?? {}),
|
|
906
|
+
...config,
|
|
907
|
+
});
|
|
802
908
|
}
|
|
803
909
|
static getFormControlRelatesAttribute(type) {
|
|
804
910
|
const config = this.store.typeInfos.get(type);
|
|
805
911
|
return (config && 'formControlConfig' in config && config.formControlConfig?.relatesTo) || null;
|
|
806
912
|
}
|
|
913
|
+
static getViewElementInputs(type) {
|
|
914
|
+
const config = this.store.typeInfos.get(type);
|
|
915
|
+
return config?.inputs ?? {};
|
|
916
|
+
}
|
|
917
|
+
static getViewElementOutputs(type) {
|
|
918
|
+
const config = this.store.typeInfos.get(type);
|
|
919
|
+
return config?.outputs ?? {};
|
|
920
|
+
}
|
|
921
|
+
static getViewElementPropertiesDefaultValues(type) {
|
|
922
|
+
const config = this.store.typeInfos.get(type);
|
|
923
|
+
const propertiesDefaultValues = Object.entries(config?.inputs ?? {})
|
|
924
|
+
.filter(([_, inputConfig]) => Object.prototype.hasOwnProperty.call(inputConfig, 'defaultValue'))
|
|
925
|
+
.map(([propertyName, propertyConfig]) => ({
|
|
926
|
+
name: propertyName,
|
|
927
|
+
defaultValue: propertyConfig.defaultValue,
|
|
928
|
+
}));
|
|
929
|
+
return [
|
|
930
|
+
...propertiesDefaultValues,
|
|
931
|
+
{
|
|
932
|
+
name: 'visible',
|
|
933
|
+
defaultValue: true,
|
|
934
|
+
},
|
|
935
|
+
];
|
|
936
|
+
}
|
|
807
937
|
}
|
|
808
938
|
ViewElementRegistry.registryKey = viewElementRegistryKey;
|
|
809
939
|
|
|
@@ -930,11 +1060,15 @@ const validatorRegistryKey = 'ValidatorRegistry';
|
|
|
930
1060
|
*/
|
|
931
1061
|
class ValidatorRegistry extends ɵBaseRegistry {
|
|
932
1062
|
static _has(configType, type) {
|
|
1063
|
+
const config = ValidatorRegistry.items.get(configType);
|
|
1064
|
+
if (config?.lazy && !config?.typeRef) {
|
|
1065
|
+
return false;
|
|
1066
|
+
}
|
|
933
1067
|
return ValidatorRegistry.items.has(configType) && ValidatorRegistry.items.get(configType)?.typeRef !== type;
|
|
934
1068
|
}
|
|
935
1069
|
static validate(config) {
|
|
936
1070
|
checkTypeNameFormat(config.type, 'ValidatorTypeName');
|
|
937
|
-
if (ValidatorRegistry._has(config.type, config.typeRef)) {
|
|
1071
|
+
if (config.typeRef && ValidatorRegistry._has(config.type, config.typeRef)) {
|
|
938
1072
|
throw new Error(`Error when register ${config.type}. Element with this type has already exist`);
|
|
939
1073
|
}
|
|
940
1074
|
}
|
|
@@ -942,7 +1076,11 @@ class ValidatorRegistry extends ɵBaseRegistry {
|
|
|
942
1076
|
return this.store.typeInfos;
|
|
943
1077
|
}
|
|
944
1078
|
static register(config) {
|
|
945
|
-
this.items.
|
|
1079
|
+
const existingConfig = this.items.get(config.type);
|
|
1080
|
+
this.items.set(config.type, {
|
|
1081
|
+
...(existingConfig ?? {}),
|
|
1082
|
+
...config,
|
|
1083
|
+
});
|
|
946
1084
|
}
|
|
947
1085
|
}
|
|
948
1086
|
ValidatorRegistry.registryKey = validatorRegistryKey;
|
|
@@ -1242,6 +1380,22 @@ var ViewElementReuseStrategy;
|
|
|
1242
1380
|
ViewElementReuseStrategy[ViewElementReuseStrategy["Rerender"] = 1] = "Rerender";
|
|
1243
1381
|
})(ViewElementReuseStrategy || (ViewElementReuseStrategy = {}));
|
|
1244
1382
|
|
|
1383
|
+
/**
|
|
1384
|
+
* @internal
|
|
1385
|
+
* @description Visibility strategy for view element.
|
|
1386
|
+
*/
|
|
1387
|
+
var ViewElementVisibilityStrategy;
|
|
1388
|
+
(function (ViewElementVisibilityStrategy) {
|
|
1389
|
+
/**
|
|
1390
|
+
* @description Default visibility strategy.
|
|
1391
|
+
*/
|
|
1392
|
+
ViewElementVisibilityStrategy["Default"] = "default";
|
|
1393
|
+
/**
|
|
1394
|
+
* @description On demand visibility strategy.
|
|
1395
|
+
*/
|
|
1396
|
+
ViewElementVisibilityStrategy["OnDemand"] = "on-demand";
|
|
1397
|
+
})(ViewElementVisibilityStrategy || (ViewElementVisibilityStrategy = {}));
|
|
1398
|
+
|
|
1245
1399
|
/**
|
|
1246
1400
|
* @public
|
|
1247
1401
|
* @description Abstract Base Validator class for designing custom validators.
|
|
@@ -1376,6 +1530,29 @@ var RemoteEntryType;
|
|
|
1376
1530
|
RemoteEntryType["Module"] = "module";
|
|
1377
1531
|
})(RemoteEntryType || (RemoteEntryType = {}));
|
|
1378
1532
|
|
|
1533
|
+
/**
|
|
1534
|
+
* @internal
|
|
1535
|
+
*/
|
|
1536
|
+
class LazyModuleRef {
|
|
1537
|
+
get typeRef() {
|
|
1538
|
+
return this._typeRef;
|
|
1539
|
+
}
|
|
1540
|
+
constructor(_metadata, _bootstrapFn) {
|
|
1541
|
+
this._metadata = _metadata;
|
|
1542
|
+
this._bootstrapFn = _bootstrapFn;
|
|
1543
|
+
}
|
|
1544
|
+
loadAndBootstrap() {
|
|
1545
|
+
if (!this._modulePromise) {
|
|
1546
|
+
this._modulePromise = this._metadata.load().then((type) => {
|
|
1547
|
+
this._typeRef = type;
|
|
1548
|
+
this._bootstrapFn(type);
|
|
1549
|
+
return type;
|
|
1550
|
+
});
|
|
1551
|
+
}
|
|
1552
|
+
return this._modulePromise;
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1379
1556
|
/**
|
|
1380
1557
|
* @public
|
|
1381
1558
|
* @description Creatio platform interacts with input's of user-defined component through CrtInput decorator.
|
|
@@ -1460,28 +1637,16 @@ function CrtViewElement(config) {
|
|
|
1460
1637
|
const registrationConfig = 'selector' in config
|
|
1461
1638
|
? { ...baseRegistrationConfig, selector: config.selector }
|
|
1462
1639
|
: { ...baseRegistrationConfig, typeRef: type };
|
|
1640
|
+
registrationConfig.reuseStrategy = config?.reuseStrategy ?? ViewElementReuseStrategy.Rerender;
|
|
1641
|
+
registrationConfig.defaultSize = config.defaultSize ?? {
|
|
1642
|
+
height: VIEW_ELEMENT_DEFAULT_HEIGHT,
|
|
1643
|
+
};
|
|
1463
1644
|
setViewElementMetadata(registrationConfig, type);
|
|
1464
1645
|
};
|
|
1465
1646
|
}
|
|
1466
1647
|
|
|
1467
1648
|
/**
|
|
1468
|
-
* @
|
|
1469
|
-
* @description CrtModule decorator is a 'container' where user actually setup elements.
|
|
1470
|
-
* In could contain viewElements, definitions of other CrtModules.
|
|
1471
|
-
* @param moduleDefinition - {@link ModuleDefinition}
|
|
1472
|
-
*
|
|
1473
|
-
* @example
|
|
1474
|
-
* @CrtModule({
|
|
1475
|
-
* viewElements: [AppComponent],
|
|
1476
|
-
* requestHandlers: [SomeRequestHandler],
|
|
1477
|
-
* validators: [SomeValidator],
|
|
1478
|
-
* })
|
|
1479
|
-
* @NgModule({
|
|
1480
|
-
* declarations: [AppComponent],
|
|
1481
|
-
* imports: [BrowserModule],
|
|
1482
|
-
* providers: [],
|
|
1483
|
-
* })
|
|
1484
|
-
* export class AppModule {}
|
|
1649
|
+
* @internal
|
|
1485
1650
|
*/
|
|
1486
1651
|
function CrtModule(moduleDefinition) {
|
|
1487
1652
|
return (type) => setModuleMetadata(moduleDefinition, type);
|
|
@@ -1595,6 +1760,15 @@ var DataSourceLoadType;
|
|
|
1595
1760
|
DataSourceLoadType["Reload"] = "reload";
|
|
1596
1761
|
})(DataSourceLoadType || (DataSourceLoadType = {}));
|
|
1597
1762
|
|
|
1763
|
+
/**
|
|
1764
|
+
* @internal
|
|
1765
|
+
*/
|
|
1766
|
+
var ViewElementProperty;
|
|
1767
|
+
(function (ViewElementProperty) {
|
|
1768
|
+
ViewElementProperty["Readonly"] = "READONLY_PROPERTY";
|
|
1769
|
+
ViewElementProperty["Disabled"] = "DISABLED_PROPERTY";
|
|
1770
|
+
})(ViewElementProperty || (ViewElementProperty = {}));
|
|
1771
|
+
|
|
1598
1772
|
/**
|
|
1599
1773
|
* @public
|
|
1600
1774
|
* @description Function allows to register user-defined component as view element in Creatio platform.
|
|
@@ -1655,6 +1829,16 @@ function registerViewElements(types) {
|
|
|
1655
1829
|
ViewElementRegistry.register(registrationConfig);
|
|
1656
1830
|
});
|
|
1657
1831
|
}
|
|
1832
|
+
/**
|
|
1833
|
+
* @internal
|
|
1834
|
+
*/
|
|
1835
|
+
function registerLazyViewElements(configs, lazyModuleRef) {
|
|
1836
|
+
resistantForEach(configs, (config) => {
|
|
1837
|
+
const registryItem = { ...config, lazy: true, lazyModuleRef };
|
|
1838
|
+
ViewElementRegistry.validate(registryItem);
|
|
1839
|
+
ViewElementRegistry.register(registryItem);
|
|
1840
|
+
});
|
|
1841
|
+
}
|
|
1658
1842
|
/**
|
|
1659
1843
|
* @internal
|
|
1660
1844
|
*/
|
|
@@ -1700,6 +1884,16 @@ function registerValidators(types, options) {
|
|
|
1700
1884
|
ValidatorRegistry.register(registrationConfig);
|
|
1701
1885
|
});
|
|
1702
1886
|
}
|
|
1887
|
+
/**
|
|
1888
|
+
* @internal
|
|
1889
|
+
*/
|
|
1890
|
+
function registerLazyValidators(configs, lazyModuleRef) {
|
|
1891
|
+
resistantForEach(configs, (config) => {
|
|
1892
|
+
const registryItem = { ...config, lazy: true, lazyModuleRef };
|
|
1893
|
+
ValidatorRegistry.validate(registryItem);
|
|
1894
|
+
ValidatorRegistry.register(registryItem);
|
|
1895
|
+
});
|
|
1896
|
+
}
|
|
1703
1897
|
/**
|
|
1704
1898
|
* @internal
|
|
1705
1899
|
*/
|
|
@@ -1718,6 +1912,15 @@ function registerConverters(types, options) {
|
|
|
1718
1912
|
ConverterRegistry.register(registrationConfig);
|
|
1719
1913
|
});
|
|
1720
1914
|
}
|
|
1915
|
+
/**
|
|
1916
|
+
* @internal
|
|
1917
|
+
*/
|
|
1918
|
+
function registerLazyConverters(descriptors, lazyModuleRef) {
|
|
1919
|
+
resistantForEach(descriptors, (descriptor) => {
|
|
1920
|
+
const registryItem = { ...descriptor, lazy: true, lazyModuleRef };
|
|
1921
|
+
ConverterRegistry.register(registryItem);
|
|
1922
|
+
});
|
|
1923
|
+
}
|
|
1721
1924
|
/**
|
|
1722
1925
|
* @internal
|
|
1723
1926
|
*/
|
|
@@ -1756,6 +1959,57 @@ function registerRequestHandlers(types, options, remoteName) {
|
|
|
1756
1959
|
RequestHandlerRegistryService.register(registrationConfig, type);
|
|
1757
1960
|
});
|
|
1758
1961
|
}
|
|
1962
|
+
/**
|
|
1963
|
+
* @internal
|
|
1964
|
+
*/
|
|
1965
|
+
function registerLazyRequestHandlers(descriptors, options, remoteName, lazyModuleRef) {
|
|
1966
|
+
resistantForEach(descriptors, (descriptor) => {
|
|
1967
|
+
const registrationConfig = {
|
|
1968
|
+
...descriptor,
|
|
1969
|
+
lazy: true,
|
|
1970
|
+
lazyModuleRef,
|
|
1971
|
+
};
|
|
1972
|
+
if (options.moduleType === 'host') {
|
|
1973
|
+
registrationConfig.source = { type: HandlerSourceType.Host };
|
|
1974
|
+
}
|
|
1975
|
+
else {
|
|
1976
|
+
const remote = RemoteEntriesRegistry.items.get(remoteName);
|
|
1977
|
+
registrationConfig.source = {
|
|
1978
|
+
type: HandlerSourceType.Remote,
|
|
1979
|
+
packageName: remote.packageName,
|
|
1980
|
+
};
|
|
1981
|
+
}
|
|
1982
|
+
RequestHandlerRegistryService.register(registrationConfig);
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
/**
|
|
1986
|
+
* @internal
|
|
1987
|
+
*/
|
|
1988
|
+
function bootstrapLazyCrtModule(name, descriptor, options, lazyModuleRef) {
|
|
1989
|
+
try {
|
|
1990
|
+
if (descriptor.viewElements) {
|
|
1991
|
+
registerLazyViewElements(descriptor.viewElements, lazyModuleRef);
|
|
1992
|
+
}
|
|
1993
|
+
if (descriptor.requestHandlers) {
|
|
1994
|
+
registerLazyRequestHandlers(descriptor.requestHandlers, options, name, lazyModuleRef);
|
|
1995
|
+
}
|
|
1996
|
+
if (descriptor.validators) {
|
|
1997
|
+
registerLazyValidators(descriptor.validators, lazyModuleRef);
|
|
1998
|
+
}
|
|
1999
|
+
if (descriptor.converters) {
|
|
2000
|
+
registerLazyConverters(descriptor.converters, lazyModuleRef);
|
|
2001
|
+
}
|
|
2002
|
+
descriptor.includes?.forEach((m) => {
|
|
2003
|
+
bootstrapLazyCrtModule(name, m, options, lazyModuleRef);
|
|
2004
|
+
});
|
|
2005
|
+
}
|
|
2006
|
+
catch (error) {
|
|
2007
|
+
console.error(error);
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
/**
|
|
2011
|
+
* @internal
|
|
2012
|
+
*/
|
|
1759
2013
|
function bootstrapDefaultCrtModule(name, type, options) {
|
|
1760
2014
|
try {
|
|
1761
2015
|
const moduleDefinition = getModuleMetadata(type);
|
|
@@ -1776,8 +2030,15 @@ function bootstrapDefaultCrtModule(name, type, options) {
|
|
|
1776
2030
|
registerConverters(moduleDefinition.converters, options);
|
|
1777
2031
|
}
|
|
1778
2032
|
moduleDefinition.includes?.forEach((t) => {
|
|
1779
|
-
|
|
1780
|
-
|
|
2033
|
+
if (typeof t === 'function') {
|
|
2034
|
+
bootstrapDefaultCrtModule(name, t, options);
|
|
2035
|
+
bootstrapPredefinedModules(name, t, options);
|
|
2036
|
+
}
|
|
2037
|
+
else if (typeof t === 'object') {
|
|
2038
|
+
const ref = new LazyModuleRef(t, (x) => bootstrapDefaultCrtModule(name, x, options));
|
|
2039
|
+
bootstrapLazyCrtModule(name, t, options, ref);
|
|
2040
|
+
LazyModulesManager.instance.add(ref);
|
|
2041
|
+
}
|
|
1781
2042
|
});
|
|
1782
2043
|
}
|
|
1783
2044
|
catch (error) {
|
|
@@ -1871,7 +2132,11 @@ function _bootstrapCrtModuleHandlerChainServices(type) {
|
|
|
1871
2132
|
if (moduleDefinition.handlerChainServices) {
|
|
1872
2133
|
registerHandlerChainServices(moduleDefinition.handlerChainServices);
|
|
1873
2134
|
}
|
|
1874
|
-
moduleDefinition.includes?.forEach((t) =>
|
|
2135
|
+
moduleDefinition.includes?.forEach((t) => {
|
|
2136
|
+
if (typeof t === 'function') {
|
|
2137
|
+
_bootstrapCrtModuleHandlerChainServices(t);
|
|
2138
|
+
}
|
|
2139
|
+
});
|
|
1875
2140
|
}
|
|
1876
2141
|
/**
|
|
1877
2142
|
* @internal
|
|
@@ -1880,6 +2145,32 @@ function bootstrapCrtModuleHandlerChainServices(type) {
|
|
|
1880
2145
|
_bootstrapCrtModuleHandlerChainServices(type);
|
|
1881
2146
|
}
|
|
1882
2147
|
|
|
2148
|
+
/**
|
|
2149
|
+
* @internal
|
|
2150
|
+
* Clears global registries, resets state of global services.
|
|
2151
|
+
* Can be used in unit tests to clear global registries after bootstrapping module.
|
|
2152
|
+
* @example
|
|
2153
|
+
* beforeEach(() => {
|
|
2154
|
+
* bootstrapCrtModule('test', TestModule);
|
|
2155
|
+
* });
|
|
2156
|
+
*
|
|
2157
|
+
* afterEach(() => {
|
|
2158
|
+
* resetGlobals();
|
|
2159
|
+
* });
|
|
2160
|
+
*/
|
|
2161
|
+
function resetGlobals() {
|
|
2162
|
+
ViewElementRegistry.viewElements.clear();
|
|
2163
|
+
InternalRequestHandlerRegistry.clear();
|
|
2164
|
+
HandlerChainService.instance.clear();
|
|
2165
|
+
ValidatorRegistry.items.clear();
|
|
2166
|
+
ConverterRegistry.clear();
|
|
2167
|
+
RemoteEntriesRegistry.items.clear();
|
|
2168
|
+
PkgTopology.items.clear();
|
|
2169
|
+
LazyModulesManager.instance.clear();
|
|
2170
|
+
LazyModulesManager.instance.lazyLoadingDisabled = false;
|
|
2171
|
+
DesignTimeViewElementRegistry.infos.clear();
|
|
2172
|
+
}
|
|
2173
|
+
|
|
1883
2174
|
/**
|
|
1884
2175
|
* @public
|
|
1885
2176
|
* @abstract
|
|
@@ -2122,25 +2413,23 @@ __decorate([
|
|
|
2122
2413
|
], HttpClientService.prototype, "patch", null);
|
|
2123
2414
|
|
|
2124
2415
|
/**
|
|
2125
|
-
* @
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
(function (SchemaViewMaskRequestAction) {
|
|
2129
|
-
SchemaViewMaskRequestAction["AddTask"] = "addTask";
|
|
2130
|
-
SchemaViewMaskRequestAction["RemoveTask"] = "removeTask";
|
|
2131
|
-
})(SchemaViewMaskRequestAction || (SchemaViewMaskRequestAction = {}));
|
|
2132
|
-
/**
|
|
2133
|
-
* @internal
|
|
2416
|
+
* @public
|
|
2417
|
+
* @classdesc Represents a service to working with license restrictions.
|
|
2418
|
+
* @extends {BaseHandlerChainService}
|
|
2134
2419
|
*/
|
|
2135
|
-
class
|
|
2136
|
-
constructor(
|
|
2137
|
-
super();
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
this.
|
|
2420
|
+
class LicenseService extends BaseHandlerChainService {
|
|
2421
|
+
constructor() {
|
|
2422
|
+
super(...arguments);
|
|
2423
|
+
/**
|
|
2424
|
+
* @internal
|
|
2425
|
+
*/
|
|
2426
|
+
this.requestType = 'crt.LicenseService';
|
|
2142
2427
|
}
|
|
2143
2428
|
}
|
|
2429
|
+
__decorate([
|
|
2430
|
+
ImplementUsingHandlerChain(),
|
|
2431
|
+
__metadata("design:type", Function)
|
|
2432
|
+
], LicenseService.prototype, "loadLicenseOperationStatuses", void 0);
|
|
2144
2433
|
|
|
2145
2434
|
/**
|
|
2146
2435
|
* @public
|
|
@@ -2161,7 +2450,7 @@ class MaskService extends BaseHandlerChainService {
|
|
|
2161
2450
|
* @param context
|
|
2162
2451
|
*/
|
|
2163
2452
|
async showMask(taskName, context) {
|
|
2164
|
-
const request = new
|
|
2453
|
+
const request = new ɵSchemaViewMaskRequest(ɵSchemaViewMaskRequestAction.AddTask, taskName, context);
|
|
2165
2454
|
await HandlerChainService.instance.process(request);
|
|
2166
2455
|
}
|
|
2167
2456
|
/**
|
|
@@ -2170,7 +2459,7 @@ class MaskService extends BaseHandlerChainService {
|
|
|
2170
2459
|
* @param context
|
|
2171
2460
|
*/
|
|
2172
2461
|
async hideMask(taskName, context) {
|
|
2173
|
-
const request = new
|
|
2462
|
+
const request = new ɵSchemaViewMaskRequest(ɵSchemaViewMaskRequestAction.RemoveTask, taskName, context);
|
|
2174
2463
|
await HandlerChainService.instance.process(request);
|
|
2175
2464
|
}
|
|
2176
2465
|
}
|
|
@@ -2231,6 +2520,9 @@ class Model extends BaseHandlerChainService {
|
|
|
2231
2520
|
return this._crtModel._getAsyncResult(this._crtModel.getSchema());
|
|
2232
2521
|
}
|
|
2233
2522
|
load(config) {
|
|
2523
|
+
if (config?.loadOptions && !config?.options) {
|
|
2524
|
+
config.options = config.loadOptions;
|
|
2525
|
+
}
|
|
2234
2526
|
return this._crtModel._getAsyncResult(this._crtModel.load(config));
|
|
2235
2527
|
}
|
|
2236
2528
|
insert(dto) {
|
|
@@ -2285,5 +2577,5 @@ __decorate([
|
|
|
2285
2577
|
* Generated bundle index. Do not edit.
|
|
2286
2578
|
*/
|
|
2287
2579
|
|
|
2288
|
-
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, LocalizableValue, MaskService, MethodInvokeRequest, Model,
|
|
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 };
|
|
2289
2581
|
//# sourceMappingURL=creatio-devkit-common.mjs.map
|