@creatio/base 0.811.0 → 0.812.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 (30) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/esm2020/lib/public/enums/index.mjs +2 -1
  3. package/esm2020/lib/public/enums/model-in-page-action.enum.mjs +20 -0
  4. package/esm2020/lib/public/esq/data-model/expressions/base-expression.mjs +2 -2
  5. package/esm2020/lib/public/esq/data-model/expressions/functions/macros-function-expression.mjs +7 -4
  6. package/esm2020/lib/public/esq/data-model/filters/base-filter.mjs +2 -2
  7. package/esm2020/lib/public/esq/data-model/filters/between-filter.mjs +5 -2
  8. package/esm2020/lib/public/esq/data-model/filters/compare-filter.mjs +5 -2
  9. package/esm2020/lib/public/esq/data-model/filters/exists-filter.mjs +5 -2
  10. package/esm2020/lib/public/esq/data-model/filters/filter-group.mjs +26 -7
  11. package/esm2020/lib/public/esq/data-model/filters/filter-parser/filter-parser.mjs +7 -2
  12. package/esm2020/lib/public/esq/data-model/filters/in-filter.mjs +5 -2
  13. package/esm2020/lib/public/esq/data-model/filters/isnull-filter.mjs +5 -2
  14. package/esm2020/lib/public/models/index.mjs +2 -1
  15. package/esm2020/lib/public/models/model-init-config.mjs +2 -0
  16. package/esm2020/lib/public/services/dialog/dialog.service.mjs +2 -0
  17. package/esm2020/lib/public/services/dialog/index.mjs +3 -0
  18. package/esm2020/lib/public/services/dialog/models/base-dialog-button-config.mjs +2 -0
  19. package/esm2020/lib/public/services/dialog/models/dialog-action.mjs +2 -0
  20. package/esm2020/lib/public/services/dialog/models/dialog-config.mjs +2 -0
  21. package/esm2020/lib/public/services/dialog/models/index.mjs +4 -0
  22. package/esm2020/lib/public/services/index.mjs +2 -1
  23. package/esm2020/lib/public/types/button-color.type.mjs +2 -0
  24. package/esm2020/lib/public/types/index.mjs +2 -1
  25. package/fesm2015/creatio-base.mjs +78 -18
  26. package/fesm2015/creatio-base.mjs.map +1 -1
  27. package/fesm2020/creatio-base.mjs +78 -18
  28. package/fesm2020/creatio-base.mjs.map +1 -1
  29. package/index.d.ts +158 -4
  30. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -164,6 +164,57 @@ export declare interface ɵBaseDataSourceParameter {
164
164
  relationsConfigs?: ɵDataSourceParameterRelationConfig[];
165
165
  }
166
166
 
167
+ /**
168
+ * @public
169
+ * @description Config for button in dialog.
170
+ * @property {string} caption - Text witch will be displayed in button
171
+ * @property {ɵButtonColor} color - Color of button
172
+ */
173
+ export declare interface ɵBaseDialogButtonConfig {
174
+ /**
175
+ * @description Text witch will be displayed in button
176
+ */
177
+ caption: string;
178
+ /**
179
+ * @description Color of button
180
+ */
181
+ color: ɵButtonColor;
182
+ }
183
+
184
+ /**
185
+ * @public
186
+ * @description Dialog configuration object
187
+ * @property {string} title - Header of dialog
188
+ * @property {string} message - Message witch will be displayed in dialog
189
+ * @property {ɵDialogAction[]} actions - List of actions in dialog
190
+ */
191
+ export declare interface ɵBaseDialogConfig<TActionConfig extends ɵBaseDialogButtonConfig = ɵBaseDialogButtonConfig> {
192
+ /**
193
+ * @description Header text in dialog
194
+ */
195
+ title?: string;
196
+ /**
197
+ * @description Message witch will be displayed in dialog
198
+ */
199
+ message: string;
200
+ /**
201
+ * @description List of actions in dialog
202
+ */
203
+ actions: Array<ɵDialogAction<TActionConfig>>;
204
+ }
205
+
206
+ /**
207
+ * @public
208
+ * @description Service to working with dialog windows.
209
+ */
210
+ export declare interface ɵBaseDialogService<TConfig extends ɵBaseDialogConfig = ɵBaseDialogConfig> {
211
+ /**
212
+ * Opens dialog.
213
+ * @param {ɵBaseDialogConfig} config Dialog configuration object
214
+ */
215
+ open(config: TConfig): Promise<string>;
216
+ }
217
+
167
218
  export declare abstract class ɵBaseExpression implements ɵSerializable {
168
219
  /* Excluded from this release type: _instanceOfKey */
169
220
  /* Excluded from this release type: _instanceOfKeys */
@@ -178,7 +229,11 @@ export declare abstract class ɵBaseExpression implements ɵSerializable {
178
229
  static fromJson<TFilterParser extends typeof ɵBaseFilterParser, TExpressionParser extends typeof ɵBaseExpressionParser>(dto: ɵJsonObject, filterParser: TFilterParser, expressionParser?: TExpressionParser): ɵBaseExpression;
179
230
  protected serializeItem(item: ɵSerializable): ɵJsonObject;
180
231
  abstract clone(): ɵBaseExpression;
181
- /* Excluded from this release type: toJson */
232
+ /**
233
+ * Converts instance to json object.
234
+ * @public
235
+ */
236
+ toJson(): ɵJsonObject;
182
237
  }
183
238
 
184
239
  /**
@@ -204,7 +259,11 @@ export declare abstract class ɵBaseFilter implements ɵSerializable {
204
259
  static fromJson<TFilterParser extends typeof ɵBaseFilterParser, TExpressionParser extends typeof ɵBaseExpressionParser>(dto: ɵJsonObject, filterParser: TFilterParser, expressionParser: TExpressionParser): ɵBaseFilter;
205
260
  protected serializeItem(item: ɵSerializable): ɵJsonObject;
206
261
  abstract clone(): ɵBaseFilter;
207
- /* Excluded from this release type: toJson */
262
+ /**
263
+ * Converts instance to json object.
264
+ * @public
265
+ */
266
+ toJson(): ɵJsonObject;
208
267
  }
209
268
 
210
269
  /**
@@ -338,6 +397,12 @@ export declare class ɵBetweenFilter extends ɵSingleFilter {
338
397
  toJson(): ɵJsonObject;
339
398
  }
340
399
 
400
+ /**
401
+ * @public
402
+ * @description button color theme name
403
+ */
404
+ export declare type ɵButtonColor = 'primary' | 'accent' | 'warn' | 'default';
405
+
341
406
  export declare class ɵColumnExpression extends ɵBaseExpression {
342
407
  /* Excluded from this release type: _instanceOfKey */
343
408
  /* Excluded from this release type: _instanceOfKeys */
@@ -855,6 +920,23 @@ export declare class ɵDeleteQuery extends ɵBaseFilterableQuery {
855
920
  constructor(rootSchemaName: string);
856
921
  }
857
922
 
923
+ /**
924
+ * @public
925
+ * @description Config for action in dialog.
926
+ * @property {string} key - Result witch will be returned after choose action
927
+ * @property {ɵBaseDialogButtonConfig} config - Config for button in dialog
928
+ */
929
+ export declare interface ɵDialogAction<T extends ɵBaseDialogButtonConfig = ɵBaseDialogButtonConfig> {
930
+ /**
931
+ * @description Result witch will be returned after choose action
932
+ */
933
+ key: string;
934
+ /**
935
+ * @description Config for button in dialog
936
+ */
937
+ config: T;
938
+ }
939
+
858
940
  /**
859
941
  * Empty Guid constant.
860
942
  * @public
@@ -1059,12 +1141,14 @@ export declare class ɵFilterGroup extends ɵBaseFilter {
1059
1141
  [key: string]: ɵBaseFilter;
1060
1142
  };
1061
1143
  logicalOperation: ɵLogicalOperatorType;
1062
- constructor(logicalOperation?: ɵLogicalOperatorType);
1144
+ rootSchemaName?: string;
1145
+ constructor(logicalOperation?: ɵLogicalOperatorType, rootSchemaName?: string);
1063
1146
  /**
1064
1147
  * Parses filter group from json.
1065
1148
  * @public
1066
1149
  */
1067
1150
  static fromJson<T extends typeof ɵBaseFilterParser>(dto: ɵJsonObject, filterParser: T): ɵFilterGroup;
1151
+ private _createParameterValueExpressions;
1068
1152
  /**
1069
1153
  * Returns filter item by index.
1070
1154
  * @param index Item index.
@@ -1087,6 +1171,12 @@ export declare class ɵFilterGroup extends ɵBaseFilter {
1087
1171
  * @param filterKey Filter key.
1088
1172
  */
1089
1173
  addSchemaColumnInFilterWithParameters(comparisonType: ɵComparisonType, columnPath: string, parameterValues: ɵEntityColumnValue[], filterKey?: string): void;
1174
+ /**
1175
+ * Creates and adds in filter for primary column.
1176
+ * @param primaryColumnValues Primary column values.
1177
+ * @param filterKey Filter key.
1178
+ */
1179
+ addPrimarySchemaColumnInFilter(primaryColumnValues: ɵEntityColumnValue[], filterKey?: string): void;
1090
1180
  addSchemaColumnIsNullFilter(columnPath: string, filterKey?: string): void;
1091
1181
  /**
1092
1182
  * Creates and adds not null filter.
@@ -1361,12 +1451,13 @@ export declare class ɵMacrosFunctionExpression extends ɵFunctionExpression {
1361
1451
  /* Excluded from this release type: _instanceOfKeys */
1362
1452
  readonly functionType: ɵFunctionType;
1363
1453
  readonly macrosType: ɵQueryMacrosType;
1454
+ readonly functionArgument?: ɵBaseExpression;
1364
1455
  constructor(config: ɵMacrosFunctionExpressionConfig);
1365
1456
  /**
1366
1457
  * Parses expression from json.
1367
1458
  * @public
1368
1459
  */
1369
- static fromJson(dto: ɵJsonObject): ɵMacrosFunctionExpression;
1460
+ static fromJson<TFilterParser extends typeof ɵBaseFilterParser, TExpressionParser extends typeof ɵBaseExpressionParser>(dto: ɵJsonObject, filterParser?: TFilterParser, expressionParser?: TExpressionParser): ɵMacrosFunctionExpression;
1370
1461
  clone(): ɵMacrosFunctionExpression;
1371
1462
  }
1372
1463
 
@@ -1379,6 +1470,69 @@ export declare interface ɵMetadataProvider<T> {
1379
1470
  getMetadata(): T;
1380
1471
  }
1381
1472
 
1473
+ /**
1474
+ * @public
1475
+ * @description Default value of the model.
1476
+ * @property {string} attributeName - Name of the attribute of the model.
1477
+ * @property {unknown} value - Value of the attribute of the model.
1478
+ */
1479
+ export declare interface ɵModelDefaultValue {
1480
+ /**
1481
+ * @description Name of the attribute of the model
1482
+ */
1483
+ attributeName: string;
1484
+ /**
1485
+ * @description Value of the attribute of the model
1486
+ */
1487
+ value: unknown;
1488
+ }
1489
+
1490
+ /**
1491
+ * @public
1492
+ * @description Initial config of the model.
1493
+ * @property {string} name - Name of the model.
1494
+ * @property {string} recordId - Primary value of the record.
1495
+ * @property {ɵModelInPageAction} action - Type of the action. {@link ɵModelInPageAction}
1496
+ * @property {Array<ɵModelDefaultValue>} defaultValues - Default values of the model. {@link ɵModelDefaultValue}
1497
+ */
1498
+ export declare interface ɵModelInitConfig {
1499
+ /**
1500
+ * @description Name of the model in modelConfig that should be initialized.
1501
+ */
1502
+ name?: string;
1503
+ /**
1504
+ * @description Primary value of the record.
1505
+ */
1506
+ recordId?: string;
1507
+ /**
1508
+ * @description Type of the action. {@link ɵModelInPageAction}
1509
+ */
1510
+ action: ɵModelInPageAction;
1511
+ /**
1512
+ * @description Default values of the model. {@link ɵModelDefaultValue}
1513
+ */
1514
+ defaultValues?: Array<ɵModelDefaultValue>;
1515
+ }
1516
+
1517
+ /**
1518
+ * @public
1519
+ * @description Type of the action of the model.
1520
+ */
1521
+ export declare enum ɵModelInPageAction {
1522
+ /**
1523
+ * @description Action for editing existed record.
1524
+ */
1525
+ Edit = "edit",
1526
+ /**
1527
+ * @description Action for adding new record.
1528
+ */
1529
+ Add = "add",
1530
+ /**
1531
+ * @description Action for copying the record.
1532
+ */
1533
+ Copy = "copy"
1534
+ }
1535
+
1382
1536
  /**
1383
1537
  * @public
1384
1538
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creatio/base",
3
- "version": "0.811.0",
3
+ "version": "0.812.0",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "description": "Internal API to create customizations and integrations for Creatio platform.",
6
6
  "keywords": [
@@ -9,7 +9,7 @@
9
9
  "base"
10
10
  ],
11
11
  "peerDependencies": {
12
- "class-transformer": "^0.4.0"
12
+ "class-transformer": "0.5.1"
13
13
  },
14
14
  "dependencies": {
15
15
  "tslib": "^2.3.0"