@easyquery/core 7.2.4-rc04 → 7.2.4

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.
@@ -130,7 +130,7 @@ var GoogleDataConverter = /** @class */ (function () {
130
130
  };
131
131
  GoogleDataConverter.prototype.convertValue = function (value, colIndex) {
132
132
  var colType = this.googleDataTypeToDataType(this.getColumnType(colIndex));
133
- if ([_easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType.Date */ .g.Date, _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType.DateTime */ .g.DateTime, _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType.Time */ .g.Time].includes(colType)) {
133
+ if ([_easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType */ .g.Date, _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType */ .g.DateTime, _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType */ .g.Time].includes(colType)) {
134
134
  return eval("new ".concat(value));
135
135
  }
136
136
  return value;
@@ -174,19 +174,19 @@ var GoogleDataConverter = /** @class */ (function () {
174
174
  GoogleDataConverter.prototype.googleDataTypeToDataType = function (googleDataType) {
175
175
  switch (googleDataType) {
176
176
  case 'string':
177
- return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType.String */ .g.String;
177
+ return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType */ .g.String;
178
178
  case 'number':
179
- return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType.Float */ .g.Float;
179
+ return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType */ .g.Float;
180
180
  case 'boolean':
181
- return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType.Bool */ .g.Bool;
181
+ return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType */ .g.Bool;
182
182
  case 'date':
183
- return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType.Date */ .g.Date;
183
+ return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType */ .g.Date;
184
184
  case 'datetime':
185
- return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType.DateTime */ .g.DateTime;
185
+ return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType */ .g.DateTime;
186
186
  case 'timeofday':
187
- return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType.Time */ .g.Time;
187
+ return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType */ .g.Time;
188
188
  default:
189
- return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType.String */ .g.String;
189
+ return _easydata_core__WEBPACK_IMPORTED_MODULE_0__/* .DataType */ .g.String;
190
190
  }
191
191
  };
192
192
  return GoogleDataConverter;
@@ -3355,9 +3355,9 @@ var equtils;
3355
3355
  * @param operator
3356
3356
  */
3357
3357
  function parseOperatorFormat(operator) {
3358
- var format = public_api/* i18n.getText */.ag.getText('Operators', operator.id, 'format');
3358
+ var format = public_api/* i18n */.ag.getText('Operators', operator.id, 'format');
3359
3359
  if (!format) {
3360
- format = public_api/* i18n.getText */.ag.getText('Operators', operator.id, 'displayFormat');
3360
+ format = public_api/* i18n */.ag.getText('Operators', operator.id, 'displayFormat');
3361
3361
  }
3362
3362
  if (!format) {
3363
3363
  format = operator.displayFormat;
@@ -3375,12 +3375,12 @@ var equtils;
3375
3375
  */
3376
3376
  function convertValue(value, fromDataType, toDataType) {
3377
3377
  switch (toDataType) {
3378
- case public_api/* DataType.String */.g.String:
3378
+ case public_api/* DataType */.g.String:
3379
3379
  return value;
3380
- case (public_api/* DataType.Autoinc */.g.Autoinc, public_api/* DataType.Byte */.g.Byte, public_api/* DataType.Int32 */.g.Int32, public_api/* DataType.Int64 */.g.Int64, public_api/* DataType.Word */.g.Word):
3380
+ case (public_api/* DataType */.g.Autoinc, public_api/* DataType */.g.Byte, public_api/* DataType */.g.Int32, public_api/* DataType */.g.Int64, public_api/* DataType */.g.Word):
3381
3381
  var resInt = parseInt(value);
3382
3382
  return isNaN(resInt) ? '' : resInt.toString();
3383
- case (public_api/* DataType.Currency */.g.Currency, public_api/* DataType.Float */.g.Float):
3383
+ case (public_api/* DataType */.g.Currency, public_api/* DataType */.g.Float):
3384
3384
  var resFloat = parseFloat(value);
3385
3385
  return isNaN(resFloat) ? '' : resFloat.toString();
3386
3386
  default:
@@ -3481,14 +3481,14 @@ var AggrFunction = /** @class */ (function () {
3481
3481
  if (this.appliedTypes.length > 0)
3482
3482
  return this.appliedTypes;
3483
3483
  if (this.id === 'SUM' || this.id === 'AVG') {
3484
- return [public_api/* DataType.Autoinc */.g.Autoinc, public_api/* DataType.Byte */.g.Byte, public_api/* DataType.Currency */.g.Currency, public_api/* DataType.Float */.g.Float, public_api/* DataType.Int32 */.g.Int32,
3485
- public_api/* DataType.Int64 */.g.Int64, public_api/* DataType.Word */.g.Word];
3484
+ return [public_api/* DataType */.g.Autoinc, public_api/* DataType */.g.Byte, public_api/* DataType */.g.Currency, public_api/* DataType */.g.Float, public_api/* DataType */.g.Int32,
3485
+ public_api/* DataType */.g.Int64, public_api/* DataType */.g.Word];
3486
3486
  }
3487
3487
  else if (this.id === 'MIN' || this.id === 'MAX') {
3488
- return [public_api/* DataType.Autoinc */.g.Autoinc, public_api/* DataType.BCD */.g.BCD, public_api/* DataType.Byte */.g.Byte, public_api/* DataType.Currency */.g.Currency, public_api/* DataType.Date */.g.Date, public_api/* DataType.DateTime */.g.DateTime, public_api/* DataType.Time */.g.Time,
3489
- public_api/* DataType.Float */.g.Float, public_api/* DataType.Int32 */.g.Int32, public_api/* DataType.Int64 */.g.Int64, public_api/* DataType.Word */.g.Word];
3488
+ return [public_api/* DataType */.g.Autoinc, public_api/* DataType */.g.BCD, public_api/* DataType */.g.Byte, public_api/* DataType */.g.Currency, public_api/* DataType */.g.Date, public_api/* DataType */.g.DateTime, public_api/* DataType */.g.Time,
3489
+ public_api/* DataType */.g.Float, public_api/* DataType */.g.Int32, public_api/* DataType */.g.Int64, public_api/* DataType */.g.Word];
3490
3490
  }
3491
- return public_api/* utils.getAllDataTypes */.P6.getAllDataTypes();
3491
+ return public_api/* utils */.P6.getAllDataTypes();
3492
3492
  };
3493
3493
  return AggrFunction;
3494
3494
  }());
@@ -3622,7 +3622,7 @@ var Operand = /** @class */ (function () {
3622
3622
  /** The default constructor. */
3623
3623
  function Operand() {
3624
3624
  this.kind = DataKind.Scalar;
3625
- this.dataType = public_api/* DataType.Unknown */.g.Unknown;
3625
+ this.dataType = public_api/* DataType */.g.Unknown;
3626
3626
  this.editor = new EqValueEditor();
3627
3627
  this.defValue = "";
3628
3628
  }
@@ -3646,7 +3646,7 @@ var Operand = /** @class */ (function () {
3646
3646
  * @param scr The operand.
3647
3647
  */
3648
3648
  Operand.prototype.copyFrom = function (src) {
3649
- public_api/* utils.assign */.P6.assign(this, src);
3649
+ public_api/* utils */.P6.assign(this, src);
3650
3650
  };
3651
3651
  return Operand;
3652
3652
  }());
@@ -4073,11 +4073,11 @@ var DataModel = /** @class */ (function (_super) {
4073
4073
  for (var entIdx = 0; entIdx < subEntityCount; entIdx++) {
4074
4074
  ent = entity.subEntities[entIdx];
4075
4075
  if (!filterFunc || filterFunc(ent, null)) {
4076
- caption = public_api/* i18n.getText */.ag.getText('Entities', ent.name);
4076
+ caption = public_api/* i18n */.ag.getText('Entities', ent.name);
4077
4077
  if (!caption) {
4078
4078
  caption = ent.caption;
4079
4079
  }
4080
- var newEnt = public_api/* utils.assign */.P6.assign(new Entity(), { id: ent.name, text: caption, items: [], isEntity: true });
4080
+ var newEnt = public_api/* utils */.P6.assign(new Entity(), { id: ent.name, text: caption, items: [], isEntity: true });
4081
4081
  newEnt.items = this._listByEntityWithFilter(ent, filterFunc);
4082
4082
  if (newEnt.items.length > 0)
4083
4083
  result.push(newEnt);
@@ -4090,10 +4090,10 @@ var DataModel = /** @class */ (function (_super) {
4090
4090
  for (var attrIdx = 0; attrIdx < attrCount; attrIdx++) {
4091
4091
  attr = entity.attributes[attrIdx];
4092
4092
  if (!filterFunc || filterFunc(entity, attr)) {
4093
- caption = public_api/* i18n.getText */.ag.getText('Attributes', attr.id);
4093
+ caption = public_api/* i18n */.ag.getText('Attributes', attr.id);
4094
4094
  if (!caption)
4095
4095
  caption = attr.caption;
4096
- var newEnt = public_api/* utils.assign */.P6.assign(new Entity(), { id: attr.id, text: caption, dataType: attr.dataType });
4096
+ var newEnt = public_api/* utils */.P6.assign(new Entity(), { id: attr.id, text: caption, dataType: attr.dataType });
4097
4097
  result.push(newEnt);
4098
4098
  }
4099
4099
  }
@@ -4114,15 +4114,15 @@ var DataModel = /** @class */ (function (_super) {
4114
4114
  if (opts.addUIC !== false && ent.useInConditions !== false ||
4115
4115
  opts.addUIR !== false && ent.useInResult !== false ||
4116
4116
  opts.addUIS !== false && ent.useInSorting !== false) {
4117
- caption = public_api/* i18n.getText */.ag.getText('Entities', ent.name) || ent.caption;
4118
- var newEnt = public_api/* utils.assign */.P6.assign(new Entity(), {
4117
+ caption = public_api/* i18n */.ag.getText('Entities', ent.name) || ent.caption;
4118
+ var newEnt = public_api/* utils */.P6.assign(new Entity(), {
4119
4119
  id: ent.name,
4120
4120
  text: caption,
4121
4121
  items: [],
4122
4122
  isEntity: true,
4123
4123
  description: ent.description
4124
4124
  });
4125
- var newOpts = public_api/* utils.assign */.P6.assign({}, opts);
4125
+ var newOpts = public_api/* utils */.P6.assign({}, opts);
4126
4126
  newOpts.includeRootData = false;
4127
4127
  newEnt.items = this._listByEntity(ent, newOpts, filterFunc);
4128
4128
  if (newEnt.items.length > 0) {
@@ -4141,8 +4141,8 @@ var DataModel = /** @class */ (function (_super) {
4141
4141
  if (opts.addUIC !== false && attr.useInConditions !== false ||
4142
4142
  opts.addUIR !== false && attr.useInResult !== false ||
4143
4143
  opts.addUIS !== false && attr.useInSorting !== false) {
4144
- caption = public_api/* i18n.getText */.ag.getText('Attributes', attr.id) || attr.caption;
4145
- resultAttributes.push(public_api/* utils.assign */.P6.assign(new EntityAttr(entity), { id: attr.id, text: caption, dataType: attr.dataType, lookupAttr: attr.lookupAttr, description: attr.description }));
4144
+ caption = public_api/* i18n */.ag.getText('Attributes', attr.id) || attr.caption;
4145
+ resultAttributes.push(public_api/* utils */.P6.assign(new EntityAttr(entity), { id: attr.id, text: caption, dataType: attr.dataType, lookupAttr: attr.lookupAttr, description: attr.description }));
4146
4146
  }
4147
4147
  }
4148
4148
  }
@@ -4171,7 +4171,7 @@ var DataModel = /** @class */ (function (_super) {
4171
4171
  result.sort(sortCheck);
4172
4172
  }
4173
4173
  if (opts.includeRootData) {
4174
- caption = public_api/* i18n.getText */.ag.getText('Entities', entity.name);
4174
+ caption = public_api/* i18n */.ag.getText('Entities', entity.name);
4175
4175
  if (!caption)
4176
4176
  caption = entity.caption;
4177
4177
  return { id: entity.name, text: caption, items: result };
@@ -4194,7 +4194,7 @@ var DataModel = /** @class */ (function (_super) {
4194
4194
  * @returns The operator.
4195
4195
  */
4196
4196
  DataModel.prototype.addOrUpdateOperator = function (desc) {
4197
- var op = public_api/* utils.findItemById */.P6.findItemById(this.operators, desc.id);
4197
+ var op = public_api/* utils */.P6.findItemById(this.operators, desc.id);
4198
4198
  if (!op) {
4199
4199
  op = new Operator();
4200
4200
  op.id = desc.id;
@@ -4225,12 +4225,12 @@ var DataModel = /** @class */ (function (_super) {
4225
4225
  */
4226
4226
  DataModel.prototype.removeOperator = function (id, soft) {
4227
4227
  if (soft === void 0) { soft = false; }
4228
- var op = public_api/* utils.findItemById */.P6.findItemById(this.operators, id);
4228
+ var op = public_api/* utils */.P6.findItemById(this.operators, id);
4229
4229
  if (op) {
4230
4230
  if (!soft)
4231
- public_api/* utils.removeArrayItem */.P6.removeArrayItem(this.operators, op);
4231
+ public_api/* utils */.P6.removeArrayItem(this.operators, op);
4232
4232
  this.runThroughEntities(function (attr, opts) {
4233
- public_api/* utils.removeArrayItem */.P6.removeArrayItem(attr.operators, op.id);
4233
+ public_api/* utils */.P6.removeArrayItem(attr.operators, op.id);
4234
4234
  });
4235
4235
  }
4236
4236
  };
@@ -4241,27 +4241,27 @@ var DataModel = /** @class */ (function (_super) {
4241
4241
  */
4242
4242
  DataModel.prototype.getOperatorIdsByDataType = function (type) {
4243
4243
  switch (type) {
4244
- case public_api/* DataType.String */.g.String:
4245
- case public_api/* DataType.Memo */.g.Memo:
4244
+ case public_api/* DataType */.g.String:
4245
+ case public_api/* DataType */.g.Memo:
4246
4246
  return 'StartsWith,EndsWith,Contains,Equal,InList,NotStartsWith,NotEndsWith,NotContains,NotEqual,NotInList,IsNull,IsNotNull'.split(',');
4247
- case public_api/* DataType.Guid */.g.Guid:
4247
+ case public_api/* DataType */.g.Guid:
4248
4248
  return 'Equal,NotEqual'.split(',');
4249
- case public_api/* DataType.Date */.g.Date:
4250
- case public_api/* DataType.DateTime */.g.DateTime:
4249
+ case public_api/* DataType */.g.Date:
4250
+ case public_api/* DataType */.g.DateTime:
4251
4251
  return 'DateWithinToday,DateWithinThisWeek,DateWithinPrevWeek,DateWithinThisMonth,DateWithinPrevMonth,DateWithinThisYear,DateWithinPrevYear,DateBeforePrecise,DateAfterPrecise,DatePeriodPrecise,IsNull,IsNotNull'.split(',');
4252
- case public_api/* DataType.Time */.g.Time:
4252
+ case public_api/* DataType */.g.Time:
4253
4253
  return 'TimeBeforePrecise,TimeAfterPrecise,TimePeriodPrecise,IsNull,IsNotNull'.split(',');
4254
- case public_api/* DataType.Byte */.g.Byte:
4255
- case public_api/* DataType.Word */.g.Word:
4256
- case public_api/* DataType.Int32 */.g.Int32:
4257
- case public_api/* DataType.Int64 */.g.Int64:
4258
- case public_api/* DataType.Float */.g.Float:
4259
- case public_api/* DataType.Currency */.g.Currency:
4260
- case public_api/* DataType.BCD */.g.BCD:
4261
- case public_api/* DataType.Autoinc */.g.Autoinc:
4262
- case public_api/* DataType.Unknown */.g.Unknown:
4254
+ case public_api/* DataType */.g.Byte:
4255
+ case public_api/* DataType */.g.Word:
4256
+ case public_api/* DataType */.g.Int32:
4257
+ case public_api/* DataType */.g.Int64:
4258
+ case public_api/* DataType */.g.Float:
4259
+ case public_api/* DataType */.g.Currency:
4260
+ case public_api/* DataType */.g.BCD:
4261
+ case public_api/* DataType */.g.Autoinc:
4262
+ case public_api/* DataType */.g.Unknown:
4263
4263
  return 'Equal,Between,LessThan,LessOrEqual,GreaterThan,GreaterOrEqual,InList,NotEqual,NotBetween,NotInList,IsNull,IsNotNull'.split(',');
4264
- case public_api/* DataType.Bool */.g.Bool:
4264
+ case public_api/* DataType */.g.Bool:
4265
4265
  return 'IsTrue,NotTrue'.split(',');
4266
4266
  default:
4267
4267
  var result = [];
@@ -4345,7 +4345,7 @@ var DataModel = /** @class */ (function (_super) {
4345
4345
  if (attrId) {
4346
4346
  var attr = this.getAttributeById(attrId);
4347
4347
  if (attr) {
4348
- if (attr.entity && public_api/* utils.indexOfArrayItem */.P6.indexOfArrayItem(entities, attr.entity) < 0) {
4348
+ if (attr.entity && public_api/* utils */.P6.indexOfArrayItem(entities, attr.entity) < 0) {
4349
4349
  entities.push(attr.entity);
4350
4350
  }
4351
4351
  }
@@ -4531,12 +4531,12 @@ var DataModel = /** @class */ (function (_super) {
4531
4531
  * @returns The caption.
4532
4532
  */
4533
4533
  DataModel.prototype.getAggrFunctionCaption = function (funcId) {
4534
- var funcTexts = public_api/* i18n.getText */.ag.getText('AggregateFunctions', funcId);
4535
- var funcCaption = funcTexts ? funcTexts.caption : public_api/* i18n.getText */.ag.getText('Aggr' + funcId.replace(' ', '') + '_Caption');
4534
+ var funcTexts = public_api/* i18n */.ag.getText('AggregateFunctions', funcId);
4535
+ var funcCaption = funcTexts ? funcTexts.caption : public_api/* i18n */.ag.getText('Aggr' + funcId.replace(' ', '') + '_Caption');
4536
4536
  if (funcCaption) {
4537
4537
  return funcCaption;
4538
4538
  }
4539
- var func = public_api/* utils.findItemById */.P6.findItemById(this.aggrFunctions, funcId);
4539
+ var func = public_api/* utils */.P6.findItemById(this.aggrFunctions, funcId);
4540
4540
  if (!func || !func.caption)
4541
4541
  return funcId;
4542
4542
  return func.caption;
@@ -4547,12 +4547,12 @@ var DataModel = /** @class */ (function (_super) {
4547
4547
  * @returns The caption.
4548
4548
  */
4549
4549
  DataModel.prototype.getAggrFunctionFormat = function (funcId) {
4550
- var funcTexts = public_api/* i18n.getText */.ag.getText('AggregateFunctions', funcId);
4551
- var funcFormat = funcTexts ? funcTexts.displayFormat : public_api/* i18n.getText */.ag.getText('Aggr' + funcId.replace(' ', '') + '_Format');
4550
+ var funcTexts = public_api/* i18n */.ag.getText('AggregateFunctions', funcId);
4551
+ var funcFormat = funcTexts ? funcTexts.displayFormat : public_api/* i18n */.ag.getText('Aggr' + funcId.replace(' ', '') + '_Format');
4552
4552
  if (funcFormat) {
4553
4553
  return funcFormat;
4554
4554
  }
4555
- var func = public_api/* utils.findItemById */.P6.findItemById(this.aggrFunctions, funcId);
4555
+ var func = public_api/* utils */.P6.findItemById(this.aggrFunctions, funcId);
4556
4556
  if (!func || !func.displayFormat)
4557
4557
  return '';
4558
4558
  return func.displayFormat;
@@ -4592,12 +4592,12 @@ var DataModel = /** @class */ (function (_super) {
4592
4592
  defOperand.editor = null;
4593
4593
  }
4594
4594
  var result = defOperand;
4595
- if (result.dataType === public_api/* DataType.Unknown */.g.Unknown && attr) {
4595
+ if (result.dataType === public_api/* DataType */.g.Unknown && attr) {
4596
4596
  result.dataType = attr.dataType;
4597
4597
  }
4598
4598
  if (operator && (index >= 0)) {
4599
4599
  if (operator.operands && operator.operands[index - 1]) {
4600
- result = public_api/* utils.assign */.P6.assign(result, operator.operands[index - 1]);
4600
+ result = public_api/* utils */.P6.assign(result, operator.operands[index - 1]);
4601
4601
  }
4602
4602
  }
4603
4603
  ;
@@ -4611,8 +4611,8 @@ var DataModel = /** @class */ (function (_super) {
4611
4611
  else if (attr && attr.defaultEditor) {
4612
4612
  result.editor = attr.defaultEditor;
4613
4613
  }
4614
- else if (result.dataType === public_api/* DataType.Date */.g.Date || result.dataType === public_api/* DataType.DateTime */.g.DateTime
4615
- || result.dataType === public_api/* DataType.Time */.g.Time) {
4614
+ else if (result.dataType === public_api/* DataType */.g.Date || result.dataType === public_api/* DataType */.g.DateTime
4615
+ || result.dataType === public_api/* DataType */.g.Time) {
4616
4616
  result.editor.tag = EqEditorTag.DateTime;
4617
4617
  }
4618
4618
  else {
@@ -4637,7 +4637,7 @@ var DataModel = /** @class */ (function (_super) {
4637
4637
  var match = macroExpr.match(/\${{?(.*?)}?}/);
4638
4638
  if (match != null) {
4639
4639
  var macroId = match[1];
4640
- if (public_api/* utils.indexOfArrayItem */.P6.indexOfArrayItem(this.dateMacros, macroId) >= 0) {
4640
+ if (public_api/* utils */.P6.indexOfArrayItem(this.dateMacros, macroId) >= 0) {
4641
4641
  if (macroProcessor) {
4642
4642
  macroProcessor(macroId);
4643
4643
  }
@@ -4655,7 +4655,7 @@ var DataModel = /** @class */ (function (_super) {
4655
4655
  var match = macroExpr.match(/\${{?(.*?)}?}/);
4656
4656
  if (match != null) {
4657
4657
  var macroId = match[1];
4658
- if (public_api/* utils.indexOfArrayItem */.P6.indexOfArrayItem(this.timeMacros, macroId) >= 0) {
4658
+ if (public_api/* utils */.P6.indexOfArrayItem(this.timeMacros, macroId) >= 0) {
4659
4659
  if (macroProcessor) {
4660
4660
  macroProcessor(macroId);
4661
4661
  }
@@ -4801,7 +4801,7 @@ var Expression = /** @class */ (function () {
4801
4801
  /** The data kind. */
4802
4802
  this.kind = DataKind.Scalar;
4803
4803
  /** The data type. */
4804
- this.dataType = public_api/* DataType.Unknown */.g.Unknown;
4804
+ this.dataType = public_api/* DataType */.g.Unknown;
4805
4805
  /** The value. */
4806
4806
  this._value = ''; //DO NOT forget remove any
4807
4807
  /**
@@ -5037,7 +5037,7 @@ var QueryColumn = /** @class */ (function () {
5037
5037
  this.params = [];
5038
5038
  this._isHidden = false;
5039
5039
  this.query = query;
5040
- this._id = public_api/* utils.generateId */.P6.generateId('col');
5040
+ this._id = public_api/* utils */.P6.generateId('col');
5041
5041
  this.caption = '';
5042
5042
  this._sorting = SortDirection.None;
5043
5043
  this._sortIndex = -1;
@@ -5122,11 +5122,11 @@ var QueryColumn = /** @class */ (function () {
5122
5122
  this._isHidden = value;
5123
5123
  };
5124
5124
  QueryColumn.prototype.getDataType = function () {
5125
- if (this.expr.dataType === public_api/* DataType.Unknown */.g.Unknown) {
5125
+ if (this.expr.dataType === public_api/* DataType */.g.Unknown) {
5126
5126
  var attrId = null;
5127
5127
  if (this.expr.func) {
5128
5128
  if (this.expr.func == "COUNT" || this.expr.func == "CNTDST")
5129
- return public_api/* DataType.Int64 */.g.Int64;
5129
+ return public_api/* DataType */.g.Int64;
5130
5130
  attrId = this.expr.args[0].value;
5131
5131
  }
5132
5132
  else {
@@ -5264,7 +5264,7 @@ var Condition = /** @class */ (function () {
5264
5264
  */
5265
5265
  this.linkType = LinkType.All; //only for predicates
5266
5266
  this.parent = null;
5267
- this._id = public_api/* utils.generateId */.P6.generateId('cond');
5267
+ this._id = public_api/* utils */.P6.generateId('cond');
5268
5268
  this.justAdded = false;
5269
5269
  this.tag = tag || CondTag.Unknown;
5270
5270
  this.enabled = true;
@@ -5465,12 +5465,12 @@ var Condition = /** @class */ (function () {
5465
5465
  while (i < operator.paramCount) {
5466
5466
  var oldOperand = model.getOperand(attr, oldOperator, i);
5467
5467
  var operand = model.getOperand(attr, operator, i);
5468
- if (operand.dataType == public_api/* DataType.Unknown */.g.Unknown) {
5468
+ if (operand.dataType == public_api/* DataType */.g.Unknown) {
5469
5469
  operand.dataType = attr.dataType;
5470
5470
  }
5471
- var editor = operand.editor && operand.editor.tag !== public_api/* EditorTag.Unknown */.mb.Unknown
5471
+ var editor = operand.editor && operand.editor.tag !== public_api/* EditorTag */.mb.Unknown
5472
5472
  ? operand.editor
5473
- : (attr.defaultEditor && attr.defaultEditor.tag !== public_api/* EditorTag.Unknown */.mb.Unknown
5473
+ : (attr.defaultEditor && attr.defaultEditor.tag !== public_api/* EditorTag */.mb.Unknown
5474
5474
  ? attr.defaultEditor
5475
5475
  : new EqValueEditor());
5476
5476
  if (i >= exprCount) {
@@ -5497,7 +5497,7 @@ var Condition = /** @class */ (function () {
5497
5497
  this.expressions.splice(1, this.expressions.length - 1);
5498
5498
  for (var i = 1; i < operator.paramCount; i++) {
5499
5499
  var operand = model.getOperand(attr, operator, i);
5500
- if (operand.dataType == public_api/* DataType.Unknown */.g.Unknown) {
5500
+ if (operand.dataType == public_api/* DataType */.g.Unknown) {
5501
5501
  operand.dataType = attr.dataType;
5502
5502
  }
5503
5503
  var valExpr = this.createValueExpr(operand);
@@ -5507,7 +5507,7 @@ var Condition = /** @class */ (function () {
5507
5507
  };
5508
5508
  Condition.prototype.areCompitableEditors = function (oldEditor, newEditor) {
5509
5509
  if (newEditor.tag == EqEditorTag.CustomList || newEditor.tag == EqEditorTag.List
5510
- || newEditor.tag == EqEditorTag.SqlList || newEditor.tag == public_api/* EditorTag.Unknown */.mb.Unknown) {
5510
+ || newEditor.tag == EqEditorTag.SqlList || newEditor.tag == public_api/* EditorTag */.mb.Unknown) {
5511
5511
  return false;
5512
5512
  }
5513
5513
  return true;
@@ -5792,10 +5792,10 @@ var Query = /** @class */ (function () {
5792
5792
  // query does not has any aggr columns
5793
5793
  var colToAggr = _this.getColumns()
5794
5794
  .filter(function (c) { return c.enabled && c.expr.tag == ExprTag.EntityAttribute
5795
- && _this.model.getAttributeById(c.expr.value).dataType === public_api/* DataType.Currency */.g.Currency; })[0];
5795
+ && _this.model.getAttributeById(c.expr.value).dataType === public_api/* DataType */.g.Currency; })[0];
5796
5796
  var colToGroup = _this.getColumns()
5797
5797
  .filter(function (c) { return c.enabled && c.expr.tag == ExprTag.EntityAttribute
5798
- && _this.model.getAttributeById(c.expr.value).dataType === public_api/* DataType.String */.g.String; })[0];
5798
+ && _this.model.getAttributeById(c.expr.value).dataType === public_api/* DataType */.g.String; })[0];
5799
5799
  if ((!colToAggr && !settings.hasAggregates()) || !colToGroup)
5800
5800
  return;
5801
5801
  settings.addGrandTotals()
@@ -5898,7 +5898,7 @@ var Query = /** @class */ (function () {
5898
5898
  && col.expr.tag === ExprTag.AggregateFunction; }).length > 0;
5899
5899
  };
5900
5900
  Query.prototype.setDefaultName = function () {
5901
- this.setName(public_api/* i18n.getText */.ag.getText('NewQueryName'));
5901
+ this.setName(public_api/* i18n */.ag.getText('NewQueryName'));
5902
5902
  return this.getName();
5903
5903
  };
5904
5904
  /**
@@ -5983,7 +5983,7 @@ var Query = /** @class */ (function () {
5983
5983
  if (expr.tag !== ExprTag.Constant)
5984
5984
  continue;
5985
5985
  //validate number exprs
5986
- if (public_api/* utils.isNumericType */.P6.isNumericType(expr.dataType)) {
5986
+ if (public_api/* utils */.P6.isNumericType(expr.dataType)) {
5987
5987
  if (!expr.value)
5988
5988
  continue;
5989
5989
  var values = [];
@@ -5999,7 +5999,7 @@ var Query = /** @class */ (function () {
5999
5999
  if (isNaN(parsedVal)) {
6000
6000
  throw new InvalidQueryError("Expression constant is NaN in condition:" + curCond.id);
6001
6001
  }
6002
- if (public_api/* utils.isIntType */.P6.isIntType(expr.dataType) && parsedVal != parseInt(value, 10)) {
6002
+ if (public_api/* utils */.P6.isIntType(expr.dataType) && parsedVal != parseInt(value, 10)) {
6003
6003
  throw new InvalidQueryError("Expression constant is wrong interger in condition: " + curCond.id);
6004
6004
  }
6005
6005
  }
@@ -6040,7 +6040,7 @@ var Query = /** @class */ (function () {
6040
6040
  */
6041
6041
  Query.prototype.loadFromData = function (data, options) {
6042
6042
  var _this = this;
6043
- options = public_api/* utils.assign */.P6.assign({
6043
+ options = public_api/* utils */.P6.assign({
6044
6044
  changeStatus: true,
6045
6045
  validate: true
6046
6046
  }, options || {});
@@ -6231,7 +6231,7 @@ var Query = /** @class */ (function () {
6231
6231
  }
6232
6232
  }
6233
6233
  obj.timezoneOffset = this.timezoneOffset;
6234
- obj.locale = public_api/* i18n.getCurrentLocale */.ag.getCurrentLocale();
6234
+ obj.locale = public_api/* i18n */.ag.getCurrentLocale();
6235
6235
  return obj;
6236
6236
  };
6237
6237
  /**
@@ -6314,7 +6314,7 @@ var Query = /** @class */ (function () {
6314
6314
  * @param id New Query ID.
6315
6315
  */
6316
6316
  Query.prototype.regenerateId = function () {
6317
- this.id = public_api/* utils.generateId */.P6.generateId("quer");
6317
+ this.id = public_api/* utils */.P6.generateId("quer");
6318
6318
  };
6319
6319
  /**
6320
6320
  * Gets name of the query.
@@ -6410,9 +6410,8 @@ var Query = /** @class */ (function () {
6410
6410
  this.addColumnToSorted(col);
6411
6411
  colIdx = this.sortedColumns.length - 1;
6412
6412
  }
6413
- public_api/* utils.moveArrayItem */.P6.moveArrayItem(this.sortedColumns, colIdx, index);
6413
+ public_api/* utils */.P6.moveArrayItem(this.sortedColumns, colIdx, index);
6414
6414
  this.fixupSortingIndices();
6415
- this.fireColumnsChangedEvent(QueryChangeAction.All);
6416
6415
  };
6417
6416
  Query.prototype.getColumnSorting = function (col) {
6418
6417
  var idx = this.getColumnSortIndex(col);
@@ -6428,7 +6427,7 @@ var Query = /** @class */ (function () {
6428
6427
  col._sorting = direction;
6429
6428
  if (idx >= 0) {
6430
6429
  if (direction == SortDirection.None) {
6431
- public_api/* utils.removeArrayItem */.P6.removeArrayItem(this.sortedColumns, col);
6430
+ public_api/* utils */.P6.removeArrayItem(this.sortedColumns, col);
6432
6431
  this.fixupSortingIndices();
6433
6432
  }
6434
6433
  }
@@ -6439,7 +6438,6 @@ var Query = /** @class */ (function () {
6439
6438
  }
6440
6439
  }
6441
6440
  this.adjustColumnsSorting();
6442
- this.fireColumnsChangedEvent(QueryChangeAction.Modify, col, col.isJustSorted());
6443
6441
  };
6444
6442
  Query.prototype.fixupSortingIndices = function () {
6445
6443
  this.sortedColumns.forEach(function (col, index) {
@@ -6459,7 +6457,7 @@ var Query = /** @class */ (function () {
6459
6457
  if (col.sorting != SortDirection.None) {
6460
6458
  var colIdx = _this.getColumnSortIndex(col);
6461
6459
  if (colIdx >= 0) {
6462
- public_api/* utils.moveArrayItem */.P6.moveArrayItem(_this.sortedColumns, colIdx, idx);
6460
+ public_api/* utils */.P6.moveArrayItem(_this.sortedColumns, colIdx, idx);
6463
6461
  idx++;
6464
6462
  }
6465
6463
  }
@@ -6471,7 +6469,7 @@ var Query = /** @class */ (function () {
6471
6469
  return new QueryColumn(this, justsorted);
6472
6470
  };
6473
6471
  Query.prototype.getColumnById = function (id) {
6474
- return public_api/* utils.findItemById */.P6.findItemById(this.columns, id);
6472
+ return public_api/* utils */.P6.findItemById(this.columns, id);
6475
6473
  };
6476
6474
  /**
6477
6475
  * Adds a new column with specified parameters
@@ -6488,10 +6486,8 @@ var Query = /** @class */ (function () {
6488
6486
  * sortIndex: SortDirection.Ascending
6489
6487
  * }});
6490
6488
  */
6491
- Query.prototype.addColumn = function (descriptor, author) {
6492
- // let columns = (descriptor.justsorted)
6493
- // ? this.justsorted
6494
- // : this.columns;
6489
+ Query.prototype.addColumn = function (descriptor, silent) {
6490
+ if (silent === void 0) { silent = false; }
6495
6491
  var newColumn;
6496
6492
  if (descriptor.column) {
6497
6493
  newColumn = descriptor.column;
@@ -6508,10 +6504,10 @@ var Query = /** @class */ (function () {
6508
6504
  throw new Error("Incorrect attribute id (".concat(descriptor.attributeId, "): addColumn"));
6509
6505
  }
6510
6506
  }
6511
- else {
6512
- throw new Error('Not enought data for addColumn operation. Need attribute or attributeId');
6507
+ else if (typeof descriptor.constValue === 'undefined' && !descriptor.customSql) {
6508
+ throw new Error('Not enought data for addColumn operation. One of the following options must be defined: attribute, attributeId, constValue or customSlq');
6513
6509
  }
6514
- if (!attr.useInResult) {
6510
+ if (attr && !attr.useInResult) {
6515
6511
  if (attr.lookupAttr) {
6516
6512
  attr = this.model.getAttributeById(attr.lookupAttr);
6517
6513
  }
@@ -6519,22 +6515,29 @@ var Query = /** @class */ (function () {
6519
6515
  throw new Error("Can't use this attribute for a column");
6520
6516
  }
6521
6517
  }
6522
- if (descriptor.aggrFuncId && descriptor.cusomtSql) {
6518
+ if (descriptor.aggrFuncId && descriptor.customSql) {
6523
6519
  console.warn("Column cannot be created using aggrFuncId and customSql at the same time. " +
6524
6520
  "cusomSql will be used.");
6525
6521
  }
6526
- if (descriptor.cusomtSql) {
6522
+ if (typeof descriptor.constValue !== 'undefined') {
6523
+ newColumn.expr.tag = ExprTag.Constant;
6524
+ newColumn.expr.setValue(descriptor.constValue);
6525
+ newColumn.expr.kind = DataKind.Scalar;
6526
+ newColumn.expr.dataType = descriptor.constType || public_api/* DataType */.g.String;
6527
+ }
6528
+ else if (descriptor.customSql) {
6527
6529
  newColumn.caption = 'Custom SQL Column';
6528
6530
  newColumn.expr.tag = ExprTag.CustomSql;
6529
- newColumn.expr.baseAttrId = attr.id;
6530
- newColumn.expr.sql = descriptor.cusomtSql;
6531
+ newColumn.expr.sql = descriptor.customSql;
6531
6532
  newColumn.expr.kind = DataKind.Query;
6532
- newColumn.expr.dataType = public_api/* DataType.Unknown */.g.Unknown;
6533
+ newColumn.expr.dataType = public_api/* DataType */.g.Unknown;
6534
+ newColumn.expr.baseAttrId = descriptor.attributeId;
6535
+ if (!this.context.options.allowCustomExpressions) {
6536
+ newColumn.enabled = false;
6537
+ }
6533
6538
  }
6534
6539
  else if (descriptor.aggrFuncId) {
6535
6540
  var funcId = descriptor.aggrFuncId;
6536
- newColumn.caption = attr.caption + ' '
6537
- + this.model.getAggrFunctionCaption(descriptor.aggrFuncId);
6538
6541
  newColumn.expr.tag = ExprTag.AggregateFunction;
6539
6542
  newColumn.expr.func = descriptor.aggrFuncId;
6540
6543
  newColumn.expr.kind = DataKind.Scalar;
@@ -6543,20 +6546,22 @@ var Query = /** @class */ (function () {
6543
6546
  var arg = new Expression(newColumn);
6544
6547
  arg.setValue(attr.id, true);
6545
6548
  arg.tag = ExprTag.EntityAttribute;
6549
+ arg.kind = DataKind.Attribute;
6546
6550
  arg.dataType = attr.dataType;
6547
6551
  newColumn.expr.args.push(arg);
6548
6552
  }
6549
6553
  else {
6550
- newColumn.caption = attr.caption;
6551
6554
  newColumn.expr.setValue(attr.id, true);
6552
6555
  newColumn.expr.tag = ExprTag.EntityAttribute;
6556
+ newColumn.expr.kind = DataKind.Attribute;
6553
6557
  newColumn.expr.dataType = attr.dataType;
6558
+ newColumn.params.concat(attr.params);
6554
6559
  }
6555
- newColumn.caption = descriptor.caption || newColumn.caption;
6560
+ newColumn.caption = descriptor.caption || this.context.getDefaultColumnCaption(newColumn);
6556
6561
  newColumn._sorting = descriptor.sorting || SortDirection.None;
6557
6562
  newColumn._sortIndex = descriptor.sortIndex || -1;
6558
- newColumn.enabled = public_api/* utils.getIfDefined */.P6.getIfDefined(descriptor.enabled, true);
6559
- newColumn.setReadOnly(public_api/* utils.getIfDefined */.P6.getIfDefined(descriptor.readonly, false));
6563
+ newColumn.enabled = public_api/* utils */.P6.getIfDefined(descriptor.enabled, true);
6564
+ newColumn.setReadOnly(public_api/* utils */.P6.getIfDefined(descriptor.readonly, false));
6560
6565
  }
6561
6566
  var justsorted = descriptor.justsorted || (descriptor.column && descriptor.column.isJustSorted());
6562
6567
  if (!justsorted) {
@@ -6568,7 +6573,9 @@ var Query = /** @class */ (function () {
6568
6573
  }
6569
6574
  }
6570
6575
  this.setColumnSorting(newColumn, newColumn._sorting);
6571
- this.fireColumnsChangedEvent(QueryChangeAction.Add, newColumn, justsorted);
6576
+ if (!silent) {
6577
+ this.fireColumnsChangedEvent(QueryChangeAction.Add, newColumn, justsorted);
6578
+ }
6572
6579
  return newColumn;
6573
6580
  };
6574
6581
  /**
@@ -6622,9 +6629,6 @@ var Query = /** @class */ (function () {
6622
6629
  if (column.isJustSorted())
6623
6630
  return;
6624
6631
  args = args || {};
6625
- column.caption = (typeof args.caption !== 'undefined')
6626
- ? args.caption
6627
- : '';
6628
6632
  if (tag === ExprTag.AggregateFunction) {
6629
6633
  if (!args.funcId)
6630
6634
  throw Error('"funcId" argument is not defined');
@@ -6652,7 +6656,7 @@ var Query = /** @class */ (function () {
6652
6656
  }
6653
6657
  var customSqlExpr = new Expression(column);
6654
6658
  customSqlExpr.tag = ExprTag.CustomSql;
6655
- customSqlExpr.dataType = public_api/* DataType.String */.g.String; //the default data type
6659
+ customSqlExpr.dataType = public_api/* DataType */.g.String; //the default data type
6656
6660
  customSqlExpr.sql = sqlText;
6657
6661
  customSqlExpr.baseAttrId = attrId;
6658
6662
  column.expr = customSqlExpr;
@@ -6662,39 +6666,37 @@ var Query = /** @class */ (function () {
6662
6666
  || column.expr.tag === ExprTag.ParentEntityAttribute) {
6663
6667
  return;
6664
6668
  }
6665
- var exprId = (column.expr.tag === ExprTag.CustomSql)
6666
- ? column.expr.baseAttrId
6667
- : column.expr.args[0].value;
6668
- var attr = this.model.getAttributeById(exprId);
6669
+ var attrId = (column.expr.tag == ExprTag.AggregateFunction)
6670
+ ? column.expr.args[0].value
6671
+ : column.expr.baseAttrId;
6672
+ var attr = attrId
6673
+ ? this.model.getAttributeById(attrId)
6674
+ : this.model.getFirstUICAttr();
6669
6675
  var expr = new Expression(column);
6670
6676
  expr.tag = ExprTag.EntityAttribute;
6671
- expr.dataType = attr != null ? attr.dataType : public_api/* DataType.Unknown */.g.Unknown;
6672
- expr.setValue(exprId, true);
6677
+ expr.dataType = attr.dataType;
6678
+ expr.setValue(attr.id, true);
6673
6679
  column.expr = expr;
6674
6680
  }
6681
+ column.caption = this.context.getDefaultColumnCaption(column);
6675
6682
  };
6676
6683
  /**
6677
6684
  * Moves the column with specified index to another position.
6678
6685
  * @param index1 The index of the column that should be moved.
6679
6686
  * @param index2 The index of the position the column should be moved to
6680
- * @param author The author
6681
6687
  */
6682
6688
  Query.prototype.moveColumn = function (index1, index2) {
6683
6689
  var columns = this.getColumns();
6684
- public_api/* utils.moveArrayItem */.P6.moveArrayItem(columns, index1, index2);
6690
+ public_api/* utils */.P6.moveArrayItem(columns, index1, index2);
6685
6691
  this.adjustColumnsSorting();
6686
6692
  };
6687
6693
  /**
6688
6694
  * Removes the column.
6689
6695
  * @param column The column to be removed.
6690
- * @param author The author
6691
6696
  */
6692
- Query.prototype.removeColumn = function (column, author) {
6693
- // const columns = (column.isJustSorted())
6694
- // ? this.getJustSortedColumns()
6695
- // : this.getColumns();
6696
- public_api/* utils.removeArrayItem */.P6.removeArrayItem(this.columns, column);
6697
- public_api/* utils.removeArrayItem */.P6.removeArrayItem(this.sortedColumns, column);
6697
+ Query.prototype.removeColumn = function (column) {
6698
+ public_api/* utils */.P6.removeArrayItem(this.columns, column);
6699
+ public_api/* utils */.P6.removeArrayItem(this.sortedColumns, column);
6698
6700
  };
6699
6701
  /**
6700
6702
  * Adds a condition group - a group of simple conditions (predicates) linked by AND or OR
@@ -6742,8 +6744,8 @@ var Query = /** @class */ (function () {
6742
6744
  }
6743
6745
  var cond = this.createSimpleConditionObject(descriptor.attribute, descriptor.operator, descriptor.value);
6744
6746
  parent.addCondition(cond);
6745
- cond.enabled = public_api/* utils.getIfDefined */.P6.getIfDefined(descriptor.enabled, true);
6746
- cond.setReadOnly(public_api/* utils.getIfDefined */.P6.getIfDefined(descriptor.readonly, false));
6747
+ cond.enabled = public_api/* utils */.P6.getIfDefined(descriptor.enabled, true);
6748
+ cond.setReadOnly(public_api/* utils */.P6.getIfDefined(descriptor.readonly, false));
6747
6749
  return cond;
6748
6750
  };
6749
6751
  Query.prototype.addSimpleExtraCondition = function (descriptor) {
@@ -6765,10 +6767,10 @@ var Query = /** @class */ (function () {
6765
6767
  cond.expressions.push(attrExpr);
6766
6768
  var model = this.getModel();
6767
6769
  var valCount = operator.paramCount;
6768
- var values = public_api/* utils.fillArray */.P6.fillArray(new Array(valCount - 1), null);
6770
+ var values = public_api/* utils */.P6.fillArray(new Array(valCount - 1), null);
6769
6771
  if (inputValues !== null && typeof inputValues !== "undefined") {
6770
6772
  if (Array.isArray(inputValues)) {
6771
- public_api/* utils.copyArrayTo */.P6.copyArrayTo(inputValues, values);
6773
+ public_api/* utils */.P6.copyArrayTo(inputValues, values);
6772
6774
  }
6773
6775
  else if (valCount > 0) {
6774
6776
  values[0] = inputValues;
@@ -6930,7 +6932,7 @@ var Query = /** @class */ (function () {
6930
6932
  if (!model)
6931
6933
  return '';
6932
6934
  var getConditionGroupText = function (group) {
6933
- var result = '', conjKey = "Conj" + equtils.linkTypeToStr(group.linkType), conjText = public_api/* i18n.getText */.ag.getText(conjKey), condText, i;
6935
+ var result = '', conjKey = "Conj" + equtils.linkTypeToStr(group.linkType), conjText = public_api/* i18n */.ag.getText(conjKey), condText, i;
6934
6936
  for (i = 0; i < group.getConditions().length; i++) {
6935
6937
  condText = "";
6936
6938
  var cond = group.getConditions()[i];
@@ -6961,7 +6963,7 @@ var Query = /** @class */ (function () {
6961
6963
  txt = expr.getText();
6962
6964
  if (_this.model.isDateMacro(txt) || _this.model.isTimeMacro(txt)) {
6963
6965
  var macroText = txt.substring(3, txt.length - 2);
6964
- var res = public_api/* i18n.getText */.ag.getText(macroText);
6966
+ var res = public_api/* i18n */.ag.getText(macroText);
6965
6967
  txt = res || txt;
6966
6968
  }
6967
6969
  }
@@ -7001,23 +7003,23 @@ var Query = /** @class */ (function () {
7001
7003
  else if (expr.kind == DataKind.List) {
7002
7004
  return "[".concat(expr.getText(), "]");
7003
7005
  }
7004
- else if (expr.dataType == public_api/* DataType.String */.g.String
7005
- || expr.dataType == public_api/* DataType.Memo */.g.Memo
7006
- || expr.dataType == public_api/* DataType.FixedChar */.g.FixedChar) {
7006
+ else if (expr.dataType == public_api/* DataType */.g.String
7007
+ || expr.dataType == public_api/* DataType */.g.Memo
7008
+ || expr.dataType == public_api/* DataType */.g.FixedChar) {
7007
7009
  return "&quot;".concat(expr.getText(), "&quot;");
7008
7010
  }
7009
7011
  else {
7010
7012
  var txt = expr.getText();
7011
7013
  if (_this.model.isDateMacro(txt) || _this.model.isTimeMacro(txt)) {
7012
7014
  var macroText = txt.substring(3, txt.length - 2);
7013
- var res = public_api/* i18n.getText */.ag.getText(macroText);
7015
+ var res = public_api/* i18n */.ag.getText(macroText);
7014
7016
  txt = res || txt;
7015
7017
  }
7016
7018
  return txt;
7017
7019
  }
7018
7020
  };
7019
7021
  var getConditionGroupText = function (group) {
7020
- var result = '', conjKey = "Conj" + equtils.linkTypeToStr(group.linkType), conjText = "<span class=\"eqjs-query-text-conj\">".concat(public_api/* i18n.getText */.ag.getText(conjKey), "</span>"), condText, i;
7022
+ var result = '', conjKey = "Conj" + equtils.linkTypeToStr(group.linkType), conjText = "<span class=\"eqjs-query-text-conj\">".concat(public_api/* i18n */.ag.getText(conjKey), "</span>"), condText, i;
7021
7023
  for (i = 0; i < group.getConditions().length; i++) {
7022
7024
  condText = "";
7023
7025
  var cond = group.getConditions()[i];
@@ -7164,7 +7166,7 @@ var BrowserQueryStorage = /** @class */ (function () {
7164
7166
  if (itemsString) {
7165
7167
  queryList = JSON.parse(itemsString);
7166
7168
  }
7167
- var item = public_api/* utils.findItemById */.P6.findItemById(queryList, query.getId());
7169
+ var item = public_api/* utils */.P6.findItemById(queryList, query.getId());
7168
7170
  if (!item) {
7169
7171
  item = { id: query.getId(), name: query.getName(), text: query.getDescription() };
7170
7172
  queryList.push(item);
@@ -7348,7 +7350,7 @@ var EqServerValueListResolver = /** @class */ (function () {
7348
7350
  }
7349
7351
  EqServerValueListResolver.prototype.loadValueList = function (options) {
7350
7352
  var modelId = options.modelId || this.context.getModel().getId();
7351
- var requestData = public_api/* utils.assign */.P6.assign({ modelId: modelId }, options.params);
7353
+ var requestData = public_api/* utils */.P6.assign({ modelId: modelId }, options.params);
7352
7354
  var editorId = requestData.editorId;
7353
7355
  var http = this.context.getServices().getHttpClient();
7354
7356
  var url = this.context.resolveEndpoint('GetValueList', { modelId: modelId, listId: editorId });
@@ -7793,7 +7795,7 @@ var InMemoryModelStorage = /** @class */ (function () {
7793
7795
  function InMemoryModelStorage(models) {
7794
7796
  this.models = [];
7795
7797
  if (models) {
7796
- public_api/* utils.assign */.P6.assign(this.models, [], models);
7798
+ public_api/* utils */.P6.assign(this.models, [], models);
7797
7799
  }
7798
7800
  }
7799
7801
  InMemoryModelStorage.prototype.getModels = function () {
@@ -7806,13 +7808,6 @@ var InMemoryModelStorage = /** @class */ (function () {
7806
7808
  }());
7807
7809
 
7808
7810
 
7809
- ;// CONCATENATED MODULE: ./src/main/action.ts
7810
- var EqActionResult;
7811
- (function (EqActionResult) {
7812
- EqActionResult[EqActionResult["Error"] = 0] = "Error";
7813
- EqActionResult[EqActionResult["Success"] = 1] = "Success";
7814
- })(EqActionResult || (EqActionResult = {}));
7815
-
7816
7811
  ;// CONCATENATED MODULE: ./src/eqs/eqs_exporter.ts
7817
7812
 
7818
7813
  var EqServerExporter = /** @class */ (function () {
@@ -7874,6 +7869,13 @@ var EqServerExporter = /** @class */ (function () {
7874
7869
  }());
7875
7870
 
7876
7871
 
7872
+ ;// CONCATENATED MODULE: ./src/main/action.ts
7873
+ var EqActionResult;
7874
+ (function (EqActionResult) {
7875
+ EqActionResult[EqActionResult["Error"] = 0] = "Error";
7876
+ EqActionResult[EqActionResult["Success"] = 1] = "Success";
7877
+ })(EqActionResult || (EqActionResult = {}));
7878
+
7877
7879
  ;// CONCATENATED MODULE: ./src/main/context.ts
7878
7880
  var context_assign = (undefined && undefined.__assign) || function () {
7879
7881
  context_assign = Object.assign || function(t) {
@@ -7911,7 +7913,9 @@ var EqContext = /** @class */ (function () {
7911
7913
  function EqContext() {
7912
7914
  var _this = this;
7913
7915
  this.options = {
7914
- syncSortOrderWithColumnsOrder: true
7916
+ syncSortOrderWithColumnsOrder: true,
7917
+ attributeFormat: '{entity} {attr}',
7918
+ columnTitleFormat: null //means it will be the same as attributeFormat
7915
7919
  };
7916
7920
  this.servicesInitialized = false;
7917
7921
  this.internalListCache = {};
@@ -7930,7 +7934,7 @@ var EqContext = /** @class */ (function () {
7930
7934
  '_DSDE': function (params, onResult) {
7931
7935
  var data = _this.getModel().getAllDateMacros()
7932
7936
  .map(function (macroId) {
7933
- return { id: '${{' + macroId + '}}', text: public_api/* i18n.getText */.ag.getText(macroId) };
7937
+ return { id: '${{' + macroId + '}}', text: public_api/* i18n */.ag.getText(macroId) };
7934
7938
  });
7935
7939
  onResult(data);
7936
7940
  return true;
@@ -7938,7 +7942,7 @@ var EqContext = /** @class */ (function () {
7938
7942
  '_DSTE': function (params, onResult) {
7939
7943
  var data = _this.getModel().getAllTimeMacros()
7940
7944
  .map(function (macroId) {
7941
- return { id: '${{' + macroId + '}}', text: public_api/* i18n.getText */.ag.getText(macroId) };
7945
+ return { id: '${{' + macroId + '}}', text: public_api/* i18n */.ag.getText(macroId) };
7942
7946
  });
7943
7947
  onResult(data);
7944
7948
  return true;
@@ -7948,7 +7952,7 @@ var EqContext = /** @class */ (function () {
7948
7952
  if (options == null || !options.listName)
7949
7953
  return;
7950
7954
  var query = _this.getQuery();
7951
- var params = public_api/* utils.assign */.P6.assign({ listName: options.listName }, options.editorParams);
7955
+ var params = public_api/* utils */.P6.assign({ listName: options.listName }, options.editorParams);
7952
7956
  var reqParams = {};
7953
7957
  var attrPattern = /@{{(.+?)}}/;
7954
7958
  for (var prop in params) {
@@ -8120,10 +8124,10 @@ var EqContext = /** @class */ (function () {
8120
8124
  this.setExternalListCache(options.listCache);
8121
8125
  }
8122
8126
  if (options.locale) {
8123
- public_api/* i18n.setCurrentLocale */.ag.setCurrentLocale(options.locale);
8127
+ public_api/* i18n */.ag.setCurrentLocale(options.locale);
8124
8128
  }
8125
8129
  if (options.localeSettings) {
8126
- public_api/* i18n.updateLocaleSettings */.ag.updateLocaleSettings(options.localeSettings);
8130
+ public_api/* i18n */.ag.updateLocaleSettings(options.localeSettings);
8127
8131
  }
8128
8132
  if (options.endpoint) {
8129
8133
  this.baseEndpoint = options.endpoint;
@@ -8228,7 +8232,7 @@ var EqContext = /** @class */ (function () {
8228
8232
  }
8229
8233
  };
8230
8234
  EqContext.prototype.setOptions = function (options) {
8231
- public_api/* utils.assignDeep */.P6.assignDeep(this.options, options);
8235
+ public_api/* utils */.P6.assignDeep(this.options, options);
8232
8236
  };
8233
8237
  Object.defineProperty(EqContext.prototype, "backendInfo", {
8234
8238
  get: function () {
@@ -8525,7 +8529,7 @@ var EqContext = /** @class */ (function () {
8525
8529
  * We expected an object with the struture of LocaleInfo interface here.
8526
8530
  */
8527
8531
  EqContext.prototype.addLocale = function (locale, localeInfo) {
8528
- public_api/* i18n.addLocale */.ag.addLocale(locale, localeInfo);
8532
+ public_api/* i18n */.ag.addLocale(locale, localeInfo);
8529
8533
  };
8530
8534
  EqContext.prototype.addEventListener = function (eventType, handler) {
8531
8535
  var _this = this;
@@ -9287,7 +9291,7 @@ var EqContext = /** @class */ (function () {
9287
9291
  action: EqAction.ExportResult,
9288
9292
  text: 'Exporting result for query: ' + queryId_1
9289
9293
  }, WidgetGroup.Result);
9290
- var localeSettings = public_api/* i18n.getLocaleSettings */.ag.getLocaleSettings();
9294
+ var localeSettings = public_api/* i18n */.ag.getLocaleSettings();
9291
9295
  options.settings = localeSettings;
9292
9296
  var aggrSettings = this.query.getAggregationSettings();
9293
9297
  if (aggrSettings.hasAggregates()
@@ -9330,6 +9334,37 @@ var EqContext = /** @class */ (function () {
9330
9334
  });
9331
9335
  }
9332
9336
  };
9337
+ EqContext.prototype.getAttributeTitle = function (attr) {
9338
+ var format = this.options.attributeFormat;
9339
+ return this.getModel().getAttributeText(attr, format);
9340
+ };
9341
+ EqContext.prototype.getColumnTitle = function (attr) {
9342
+ var format = this.options.columnTitleFormat || this.options.attributeFormat;
9343
+ return this.getModel().getAttributeText(attr, format);
9344
+ };
9345
+ EqContext.prototype.getDefaultColumnCaption = function (column) {
9346
+ var attr;
9347
+ var model = this.getModel();
9348
+ switch (column.expr.tag) {
9349
+ case ExprTag.Constant:
9350
+ return "Contant Column";
9351
+ case ExprTag.CustomSql:
9352
+ return "SQL Column";
9353
+ case ExprTag.ParentColumn:
9354
+ return "Parent Column";
9355
+ case ExprTag.Query:
9356
+ return "Query Column";
9357
+ case ExprTag.EntityAttribute:
9358
+ case ExprTag.ParentEntityAttribute:
9359
+ attr = model.getAttributeById(column.expr.value);
9360
+ return this.getColumnTitle(attr);
9361
+ case ExprTag.AggregateFunction:
9362
+ attr = model.getAttributeById(column.expr.args[0].value);
9363
+ return this.getColumnTitle(attr) + ' ' + model.getAggrFunctionCaption(column.expr.func);
9364
+ default:
9365
+ return 'Column';
9366
+ }
9367
+ };
9333
9368
  return EqContext;
9334
9369
  }());
9335
9370
 
@@ -9348,7 +9383,7 @@ var Widget = /** @class */ (function () {
9348
9383
  */
9349
9384
  function Widget(slot) {
9350
9385
  this.slot = slot;
9351
- this._id = public_api/* utils.generateId */.P6.generateId(this.getWidgetType());
9386
+ this._id = public_api/* utils */.P6.generateId(this.getWidgetType());
9352
9387
  }
9353
9388
  Object.defineProperty(Widget.prototype, "id", {
9354
9389
  get: function () {
@@ -9454,7 +9489,7 @@ var versionInfo = new EqVersionInfo(6, 2, 0);
9454
9489
  ;// CONCATENATED MODULE: ./src/i18n/text_resources.ts
9455
9490
 
9456
9491
  function addEasyQueryCoreTexts() {
9457
- public_api/* i18n.updateDefaultTexts */.ag.updateDefaultTexts({
9492
+ public_api/* i18n */.ag.updateDefaultTexts({
9458
9493
  NewQueryName: '[New query]',
9459
9494
  //DateTime macroses
9460
9495
  Today: 'Today',