@easyquery/ui 7.2.4-rc03 → 7.2.4-rc05

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 (65) hide show
  1. package/dist/browser/eq.community.js +500 -536
  2. package/dist/browser/eq.community.js.map +1 -1
  3. package/dist/browser/eq.community.min.js +1 -1
  4. package/dist/browser/eq.community.min.js.map +1 -1
  5. package/dist/browser/eq.core.css +1 -1
  6. package/dist/browser/eq.view.css +1 -1
  7. package/dist/bundles/easyquery.ui.js +389 -491
  8. package/dist/bundles/easyquery.ui.js.map +1 -1
  9. package/dist/bundles/easyquery.ui.min.js +1 -1
  10. package/dist/bundles/easyquery.ui.min.js.map +1 -1
  11. package/dist/lib/public_api.d.ts +5 -5
  12. package/dist/lib/public_api.js +5 -5
  13. package/dist/lib/public_api.js.map +1 -1
  14. package/dist/lib/views/view.js +1 -6
  15. package/dist/lib/views/view.js.map +1 -1
  16. package/dist/lib/widgets/columns_bar.d.ts +2 -4
  17. package/dist/lib/widgets/columns_bar.js +35 -76
  18. package/dist/lib/widgets/columns_bar.js.map +1 -1
  19. package/dist/lib/widgets/columns_panel.d.ts +2 -4
  20. package/dist/lib/widgets/columns_panel.js +47 -67
  21. package/dist/lib/widgets/columns_panel.js.map +1 -1
  22. package/dist/lib/widgets/easy_grid_widget.d.ts +0 -3
  23. package/dist/lib/widgets/easy_grid_widget.js +4 -65
  24. package/dist/lib/widgets/easy_grid_widget.js.map +1 -1
  25. package/dist/lib/widgets/entities_panel.js +4 -9
  26. package/dist/lib/widgets/entities_panel.js.map +1 -1
  27. package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer_cb.d.ts +9 -0
  28. package/dist/lib/widgets/renderers/columnsbar/{aggrfunc_column_renderer.js → aggrfunc_column_renderer_cb.js} +6 -19
  29. package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer_cb.js.map +1 -0
  30. package/dist/lib/widgets/renderers/columnsbar/{simple_column_renderer.d.ts → attr_column_renderer_cb.d.ts} +4 -2
  31. package/dist/lib/widgets/renderers/columnsbar/{simple_column_renderer.js → attr_column_renderer_cb.js} +22 -16
  32. package/dist/lib/widgets/renderers/columnsbar/attr_column_renderer_cb.js.map +1 -0
  33. package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.d.ts +1 -5
  34. package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js +3 -22
  35. package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js.map +1 -1
  36. package/dist/lib/widgets/renderers/columnsbar/editable_column_renderer_cb.d.ts +22 -0
  37. package/dist/lib/widgets/renderers/columnsbar/editable_column_renderer_cb.js +102 -0
  38. package/dist/lib/widgets/renderers/columnsbar/editable_column_renderer_cb.js.map +1 -0
  39. package/dist/lib/widgets/renderers/columnspanel/{aggrfunc_column_renderer.d.ts → aggrfunc_column_renderer_cp.d.ts} +3 -4
  40. package/dist/lib/widgets/renderers/columnspanel/{aggrfunc_column_renderer.js → aggrfunc_column_renderer_cp.js} +7 -15
  41. package/dist/lib/widgets/renderers/columnspanel/aggrfunc_column_renderer_cp.js.map +1 -0
  42. package/dist/lib/widgets/renderers/columnspanel/{simple_column_renderer.d.ts → attr_column_renderer_cp.d.ts} +4 -1
  43. package/dist/lib/widgets/renderers/columnspanel/{simple_column_renderer.js → attr_column_renderer_cp.js} +31 -19
  44. package/dist/lib/widgets/renderers/columnspanel/attr_column_renderer_cp.js.map +1 -0
  45. package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.d.ts +1 -6
  46. package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js +1 -20
  47. package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js.map +1 -1
  48. package/dist/lib/widgets/renderers/columnspanel/{customsql_column_renderer.d.ts → editable_column_renderer_cp.d.ts} +19 -7
  49. package/dist/lib/widgets/renderers/columnspanel/{customsql_column_renderer.js → editable_column_renderer_cp.js} +88 -50
  50. package/dist/lib/widgets/renderers/columnspanel/editable_column_renderer_cp.js.map +1 -0
  51. package/dist/lib/widgets/renderers/querypanel/condition_renderer.js.map +1 -1
  52. package/dist/lib/widgets/renderers/sortingbar/{column_renderer_sp.d.ts → column_renderer_sb.d.ts} +0 -3
  53. package/dist/lib/widgets/renderers/sortingbar/{column_renderer_sp.js → column_renderer_sb.js} +2 -14
  54. package/dist/lib/widgets/renderers/sortingbar/column_renderer_sb.js.map +1 -0
  55. package/dist/lib/widgets/sorting_bar.d.ts +0 -1
  56. package/dist/lib/widgets/sorting_bar.js +19 -43
  57. package/dist/lib/widgets/sorting_bar.js.map +1 -1
  58. package/package.json +4 -4
  59. package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer.d.ts +0 -11
  60. package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer.js.map +0 -1
  61. package/dist/lib/widgets/renderers/columnsbar/simple_column_renderer.js.map +0 -1
  62. package/dist/lib/widgets/renderers/columnspanel/aggrfunc_column_renderer.js.map +0 -1
  63. package/dist/lib/widgets/renderers/columnspanel/customsql_column_renderer.js.map +0 -1
  64. package/dist/lib/widgets/renderers/columnspanel/simple_column_renderer.js.map +0 -1
  65. package/dist/lib/widgets/renderers/sortingbar/column_renderer_sp.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * EasyQuery.JS Community 7.2.4-rc03 (https://korzh.com/easyquery/javascript)
2
+ * EasyQuery.JS Community 7.2.4-rc05 (https://korzh.com/easyquery/javascript)
3
3
  * Copyright 2023 Korzh.com. All rights reserved.
4
4
  *
5
5
  * EasyQuery.JS commercial licenses may be obtained at
@@ -1589,39 +1589,6 @@ var HttpRequest = /** @class */ (function () {
1589
1589
  }());
1590
1590
 
1591
1591
  //# sourceMappingURL=http_request.js.map
1592
- ;// CONCATENATED MODULE: ../../easydata/easydata.js/packs/core/dist/lib/utils/string_utils.js
1593
- function repeatString(str, times) {
1594
- var result = "";
1595
- for (var i = 0; i < times; i++) {
1596
- result += str;
1597
- }
1598
- return result;
1599
- }
1600
- function reverseString(str) {
1601
- return str.split("").reverse().join("");
1602
- }
1603
- function strEndsWith(str, symbol) {
1604
- return str && str.lastIndexOf(symbol) == (str.length - symbol.length);
1605
- }
1606
- /**
1607
- * Adds two paths and returns the result
1608
- * Correctly processes leading and trailing slashes
1609
- * @param path1
1610
- * @param path2
1611
- */
1612
- function combinePath(path1, path2) {
1613
- var result = path1;
1614
- if (result != null && result.length > 0) {
1615
- if (result.charAt(result.length - 1) != '/')
1616
- result += "/";
1617
- result += path2;
1618
- }
1619
- else {
1620
- result = path2;
1621
- }
1622
- return result;
1623
- }
1624
- //# sourceMappingURL=string_utils.js.map
1625
1592
  ;// CONCATENATED MODULE: ../../easydata/easydata.js/packs/core/dist/lib/i18n/i18n.js
1626
1593
 
1627
1594
 
@@ -2095,7 +2062,6 @@ var i18n;
2095
2062
  ;// CONCATENATED MODULE: ../../easydata/easydata.js/packs/core/dist/lib/utils/utils.js
2096
2063
 
2097
2064
 
2098
-
2099
2065
  var utils;
2100
2066
  (function (utils) {
2101
2067
  function getAllDataTypes() {
@@ -2418,27 +2384,26 @@ var utils;
2418
2384
  if (prfx && prfx.length > 0) {
2419
2385
  prfx += "-";
2420
2386
  }
2421
- //adding 2 random symbols
2422
- var randValue = repeatString("", 2);
2423
- ;
2424
- var maxSymbolIndex = symbols.length - 1;
2425
- randValue = replaceAtString(randValue, 0, symbols[getRandomInt(0, maxSymbolIndex)]);
2426
- randValue = replaceAtString(randValue, 1, symbols[getRandomInt(0, maxSymbolIndex)]);
2427
- //generating main ID part (64-base representation of the current value of the time ticks)
2428
- var ticksNum64 = intToNum36(getNowTicks() - magicTicks);
2429
- return prfx + randValue + ticksNum64;
2387
+ //adding 3 random symbols
2388
+ var randCharPart = symbols[getRandomInt(0, symbols.length)] +
2389
+ symbols[getRandomInt(0, symbols.length)] +
2390
+ symbols[getRandomInt(0, symbols.length)];
2391
+ var randInt = getRandomInt(0, 10000);
2392
+ //generating main ID part
2393
+ //it's a 36-base representation of some random number based on current value of ticks
2394
+ var ticksNum36 = intToNumBase(getNowTicks() - magicTicks - randInt);
2395
+ return prfx + randCharPart + ticksNum36;
2430
2396
  }
2431
2397
  utils.generateId = generateId;
2432
- function intToNum36(value) {
2433
- var targetBase = 36;
2434
- var i = 14;
2435
- var buffer = repeatString("", i);
2398
+ function intToNumBase(value, targetBase) {
2399
+ if (targetBase === void 0) { targetBase = 36; }
2400
+ var buffer = '';
2436
2401
  var rest = value;
2437
2402
  do {
2438
- buffer = replaceAtString(buffer, i--, symbols[rest % targetBase]);
2403
+ buffer = symbols[rest % targetBase] + buffer;
2439
2404
  rest = Math.floor(rest /= targetBase);
2440
2405
  } while (rest > 0);
2441
- return reverseString(buffer.trim());
2406
+ return buffer;
2442
2407
  }
2443
2408
  function squeezeMoniker(str, maxlen) {
2444
2409
  var parts = str.split('-');
@@ -2475,8 +2440,8 @@ var utils;
2475
2440
  return str;
2476
2441
  }
2477
2442
  }
2478
- function replaceAtString(str, index, value) {
2479
- return str.substr(0, index) + value + str.substr(index + value.length);
2443
+ function replaceAtString(str, index, replacement) {
2444
+ return str.substring(0, index) + replacement + str.substring(index + replacement.length);
2480
2445
  }
2481
2446
  function getRandomInt(min, max) {
2482
2447
  return Math.floor(Math.random() * (max - min)) + min;
@@ -4255,6 +4220,35 @@ var EventEmitter = /** @class */ (function () {
4255
4220
  }());
4256
4221
 
4257
4222
  //# sourceMappingURL=event_emitter.js.map
4223
+ ;// CONCATENATED MODULE: ../../easydata/easydata.js/packs/core/dist/lib/utils/string_utils.js
4224
+ function repeatString(str, times) {
4225
+ return str.repeat(times);
4226
+ }
4227
+ function reverseString(str) {
4228
+ return str.split("").reverse().join("");
4229
+ }
4230
+ function strEndsWith(str, symbol) {
4231
+ return str && str.lastIndexOf(symbol) == (str.length - symbol.length);
4232
+ }
4233
+ /**
4234
+ * Adds two paths and returns the result
4235
+ * Correctly processes leading and trailing slashes
4236
+ * @param path1
4237
+ * @param path2
4238
+ */
4239
+ function combinePath(path1, path2) {
4240
+ var result = path1;
4241
+ if (result != null && result.length > 0) {
4242
+ if (result.charAt(result.length - 1) != '/')
4243
+ result += "/";
4244
+ result += path2;
4245
+ }
4246
+ else {
4247
+ result = path2;
4248
+ }
4249
+ return result;
4250
+ }
4251
+ //# sourceMappingURL=string_utils.js.map
4258
4252
  ;// CONCATENATED MODULE: ../../easydata/easydata.js/packs/core/dist/lib/utils/liquid.js
4259
4253
  var liquid;
4260
4254
  (function (liquid) {
@@ -12064,6 +12058,8 @@ __webpack_require__.d(lib_public_api_namespaceObject, {
12064
12058
  AggrSettingsDialog: function() { return AggrSettingsDialog; },
12065
12059
  AggrSettingsRenderer: function() { return AggrSettingsRenderer; },
12066
12060
  AggregationBar: function() { return AggregationBar; },
12061
+ AttrColumnRendererCB: function() { return AttrColumnRendererCB; },
12062
+ AttrColumnRendererCP: function() { return AttrColumnRendererCP; },
12067
12063
  AttributeExpressionRenderer: function() { return AttributeExpressionRenderer; },
12068
12064
  BaseElementRenderer: function() { return BaseElementRenderer; },
12069
12065
  ChartFacet: function() { return ChartFacet; },
@@ -12079,6 +12075,7 @@ __webpack_require__.d(lib_public_api_namespaceObject, {
12079
12075
  ConditionGroupRenderer: function() { return ConditionGroupRenderer; },
12080
12076
  ConditionGroupRowRenderer: function() { return ConditionGroupRowRenderer; },
12081
12077
  ConditionRenderer: function() { return ConditionRenderer; },
12078
+ ConstColumnRendererCP: function() { return ConstColumnRendererCP; },
12082
12079
  CustomListExpressionRenderer: function() { return CustomListExpressionRenderer; },
12083
12080
  CustomSqlColumnRendererCP: function() { return CustomSqlColumnRendererCP; },
12084
12081
  DataFilterView: function() { return DataFilterView; },
@@ -12110,8 +12107,6 @@ __webpack_require__.d(lib_public_api_namespaceObject, {
12110
12107
  ReportView: function() { return ReportView; },
12111
12108
  ResultFacet: function() { return ResultFacet; },
12112
12109
  ResultFacetsPanel: function() { return ResultFacetsPanel; },
12113
- SimpleColumnRendererCB: function() { return SimpleColumnRendererCB; },
12114
- SimpleColumnRendererCP: function() { return SimpleColumnRendererCP; },
12115
12110
  SimpleConditionRenderer: function() { return SimpleConditionRenderer; },
12116
12111
  SortingBar: function() { return SortingBar; },
12117
12112
  SqlListExpressionRenderer: function() { return SqlListExpressionRenderer; },
@@ -14877,7 +14872,7 @@ var Query = /** @class */ (function () {
14877
14872
  throw new InvalidQueryError(entityAttrNotExistError + column.expr.args[0].value);
14878
14873
  }
14879
14874
  }
14880
- else if (column.expr.tag !== ExprTag.CustomSql) {
14875
+ else if (column.expr.tag === ExprTag.Unknown) {
14881
14876
  throw new InvalidQueryError(wrongExprTag + column.expr.tag);
14882
14877
  }
14883
14878
  }
@@ -15360,7 +15355,6 @@ var Query = /** @class */ (function () {
15360
15355
  }
15361
15356
  public_api.utils.moveArrayItem(this.sortedColumns, colIdx, index);
15362
15357
  this.fixupSortingIndices();
15363
- this.fireColumnsChangedEvent(QueryChangeAction.All);
15364
15358
  };
15365
15359
  Query.prototype.getColumnSorting = function (col) {
15366
15360
  var idx = this.getColumnSortIndex(col);
@@ -15387,7 +15381,6 @@ var Query = /** @class */ (function () {
15387
15381
  }
15388
15382
  }
15389
15383
  this.adjustColumnsSorting();
15390
- this.fireColumnsChangedEvent(QueryChangeAction.Modify, col, col.isJustSorted());
15391
15384
  };
15392
15385
  Query.prototype.fixupSortingIndices = function () {
15393
15386
  this.sortedColumns.forEach(function (col, index) {
@@ -15436,10 +15429,8 @@ var Query = /** @class */ (function () {
15436
15429
  * sortIndex: SortDirection.Ascending
15437
15430
  * }});
15438
15431
  */
15439
- Query.prototype.addColumn = function (descriptor, author) {
15440
- // let columns = (descriptor.justsorted)
15441
- // ? this.justsorted
15442
- // : this.columns;
15432
+ Query.prototype.addColumn = function (descriptor, silent) {
15433
+ if (silent === void 0) { silent = false; }
15443
15434
  var newColumn;
15444
15435
  if (descriptor.column) {
15445
15436
  newColumn = descriptor.column;
@@ -15456,10 +15447,10 @@ var Query = /** @class */ (function () {
15456
15447
  throw new Error("Incorrect attribute id (".concat(descriptor.attributeId, "): addColumn"));
15457
15448
  }
15458
15449
  }
15459
- else {
15460
- throw new Error('Not enought data for addColumn operation. Need attribute or attributeId');
15450
+ else if (typeof descriptor.constValue === 'undefined' && !descriptor.customSql) {
15451
+ throw new Error('Not enought data for addColumn operation. One of the following options must be defined: attribute, attributeId, constValue or customSlq');
15461
15452
  }
15462
- if (!attr.useInResult) {
15453
+ if (attr && !attr.useInResult) {
15463
15454
  if (attr.lookupAttr) {
15464
15455
  attr = this.model.getAttributeById(attr.lookupAttr);
15465
15456
  }
@@ -15467,22 +15458,29 @@ var Query = /** @class */ (function () {
15467
15458
  throw new Error("Can't use this attribute for a column");
15468
15459
  }
15469
15460
  }
15470
- if (descriptor.aggrFuncId && descriptor.cusomtSql) {
15461
+ if (descriptor.aggrFuncId && descriptor.customSql) {
15471
15462
  console.warn("Column cannot be created using aggrFuncId and customSql at the same time. " +
15472
15463
  "cusomSql will be used.");
15473
15464
  }
15474
- if (descriptor.cusomtSql) {
15465
+ if (typeof descriptor.constValue !== 'undefined') {
15466
+ newColumn.expr.tag = ExprTag.Constant;
15467
+ newColumn.expr.setValue(descriptor.constValue);
15468
+ newColumn.expr.kind = DataKind.Scalar;
15469
+ newColumn.expr.dataType = descriptor.constType || public_api.DataType.String;
15470
+ }
15471
+ else if (descriptor.customSql) {
15475
15472
  newColumn.caption = 'Custom SQL Column';
15476
15473
  newColumn.expr.tag = ExprTag.CustomSql;
15477
- newColumn.expr.baseAttrId = attr.id;
15478
- newColumn.expr.sql = descriptor.cusomtSql;
15474
+ newColumn.expr.sql = descriptor.customSql;
15479
15475
  newColumn.expr.kind = DataKind.Query;
15480
15476
  newColumn.expr.dataType = public_api.DataType.Unknown;
15477
+ newColumn.expr.baseAttrId = descriptor.attributeId;
15478
+ if (!this.context.options.allowCustomExpressions) {
15479
+ newColumn.enabled = false;
15480
+ }
15481
15481
  }
15482
15482
  else if (descriptor.aggrFuncId) {
15483
15483
  var funcId = descriptor.aggrFuncId;
15484
- newColumn.caption = attr.caption + ' '
15485
- + this.model.getAggrFunctionCaption(descriptor.aggrFuncId);
15486
15484
  newColumn.expr.tag = ExprTag.AggregateFunction;
15487
15485
  newColumn.expr.func = descriptor.aggrFuncId;
15488
15486
  newColumn.expr.kind = DataKind.Scalar;
@@ -15491,16 +15489,18 @@ var Query = /** @class */ (function () {
15491
15489
  var arg = new Expression(newColumn);
15492
15490
  arg.setValue(attr.id, true);
15493
15491
  arg.tag = ExprTag.EntityAttribute;
15492
+ arg.kind = DataKind.Attribute;
15494
15493
  arg.dataType = attr.dataType;
15495
15494
  newColumn.expr.args.push(arg);
15496
15495
  }
15497
15496
  else {
15498
- newColumn.caption = attr.caption;
15499
15497
  newColumn.expr.setValue(attr.id, true);
15500
15498
  newColumn.expr.tag = ExprTag.EntityAttribute;
15499
+ newColumn.expr.kind = DataKind.Attribute;
15501
15500
  newColumn.expr.dataType = attr.dataType;
15501
+ newColumn.params.concat(attr.params);
15502
15502
  }
15503
- newColumn.caption = descriptor.caption || newColumn.caption;
15503
+ newColumn.caption = descriptor.caption || this.context.getDefaultColumnCaption(newColumn);
15504
15504
  newColumn._sorting = descriptor.sorting || SortDirection.None;
15505
15505
  newColumn._sortIndex = descriptor.sortIndex || -1;
15506
15506
  newColumn.enabled = public_api.utils.getIfDefined(descriptor.enabled, true);
@@ -15516,7 +15516,9 @@ var Query = /** @class */ (function () {
15516
15516
  }
15517
15517
  }
15518
15518
  this.setColumnSorting(newColumn, newColumn._sorting);
15519
- this.fireColumnsChangedEvent(QueryChangeAction.Add, newColumn, justsorted);
15519
+ if (!silent) {
15520
+ this.fireColumnsChangedEvent(QueryChangeAction.Add, newColumn, justsorted);
15521
+ }
15520
15522
  return newColumn;
15521
15523
  };
15522
15524
  /**
@@ -15570,9 +15572,6 @@ var Query = /** @class */ (function () {
15570
15572
  if (column.isJustSorted())
15571
15573
  return;
15572
15574
  args = args || {};
15573
- column.caption = (typeof args.caption !== 'undefined')
15574
- ? args.caption
15575
- : '';
15576
15575
  if (tag === ExprTag.AggregateFunction) {
15577
15576
  if (!args.funcId)
15578
15577
  throw Error('"funcId" argument is not defined');
@@ -15610,22 +15609,24 @@ var Query = /** @class */ (function () {
15610
15609
  || column.expr.tag === ExprTag.ParentEntityAttribute) {
15611
15610
  return;
15612
15611
  }
15613
- var exprId = (column.expr.tag === ExprTag.CustomSql)
15614
- ? column.expr.baseAttrId
15615
- : column.expr.args[0].value;
15616
- var attr = this.model.getAttributeById(exprId);
15612
+ var attrId = (column.expr.tag == ExprTag.AggregateFunction)
15613
+ ? column.expr.args[0].value
15614
+ : column.expr.baseAttrId;
15615
+ var attr = attrId
15616
+ ? this.model.getAttributeById(attrId)
15617
+ : this.model.getFirstUICAttr();
15617
15618
  var expr = new Expression(column);
15618
15619
  expr.tag = ExprTag.EntityAttribute;
15619
- expr.dataType = attr != null ? attr.dataType : public_api.DataType.Unknown;
15620
- expr.setValue(exprId, true);
15620
+ expr.dataType = attr.dataType;
15621
+ expr.setValue(attr.id, true);
15621
15622
  column.expr = expr;
15622
15623
  }
15624
+ column.caption = this.context.getDefaultColumnCaption(column);
15623
15625
  };
15624
15626
  /**
15625
15627
  * Moves the column with specified index to another position.
15626
15628
  * @param index1 The index of the column that should be moved.
15627
15629
  * @param index2 The index of the position the column should be moved to
15628
- * @param author The author
15629
15630
  */
15630
15631
  Query.prototype.moveColumn = function (index1, index2) {
15631
15632
  var columns = this.getColumns();
@@ -15635,12 +15636,8 @@ var Query = /** @class */ (function () {
15635
15636
  /**
15636
15637
  * Removes the column.
15637
15638
  * @param column The column to be removed.
15638
- * @param author The author
15639
15639
  */
15640
- Query.prototype.removeColumn = function (column, author) {
15641
- // const columns = (column.isJustSorted())
15642
- // ? this.getJustSortedColumns()
15643
- // : this.getColumns();
15640
+ Query.prototype.removeColumn = function (column) {
15644
15641
  public_api.utils.removeArrayItem(this.columns, column);
15645
15642
  public_api.utils.removeArrayItem(this.sortedColumns, column);
15646
15643
  };
@@ -15901,7 +15898,9 @@ var Query = /** @class */ (function () {
15901
15898
  var expr = cond.expressions[part.index];
15902
15899
  if (expr.kind == DataKind.Attribute || expr.tag == ExprTag.EntityAttribute) {
15903
15900
  var attr = model.getAttributeById(expr.value);
15904
- txt = model.getAttributeText(attr, "{entity} {attr}");
15901
+ if (attr != null) {
15902
+ txt = model.getAttributeText(attr, "{entity} {attr}");
15903
+ }
15905
15904
  }
15906
15905
  else {
15907
15906
  txt = expr.getText();
@@ -16757,13 +16756,6 @@ var InMemoryModelStorage = /** @class */ (function () {
16757
16756
  }());
16758
16757
 
16759
16758
  //# sourceMappingURL=model_storage.js.map
16760
- ;// CONCATENATED MODULE: ../core/dist/lib/main/action.js
16761
- var EqActionResult;
16762
- (function (EqActionResult) {
16763
- EqActionResult[EqActionResult["Error"] = 0] = "Error";
16764
- EqActionResult[EqActionResult["Success"] = 1] = "Success";
16765
- })(EqActionResult || (EqActionResult = {}));
16766
- //# sourceMappingURL=action.js.map
16767
16759
  ;// CONCATENATED MODULE: ../core/dist/lib/eqs/eqs_exporter.js
16768
16760
 
16769
16761
  var EqServerExporter = /** @class */ (function () {
@@ -16825,6 +16817,13 @@ var EqServerExporter = /** @class */ (function () {
16825
16817
  }());
16826
16818
 
16827
16819
  //# sourceMappingURL=eqs_exporter.js.map
16820
+ ;// CONCATENATED MODULE: ../core/dist/lib/main/action.js
16821
+ var EqActionResult;
16822
+ (function (EqActionResult) {
16823
+ EqActionResult[EqActionResult["Error"] = 0] = "Error";
16824
+ EqActionResult[EqActionResult["Success"] = 1] = "Success";
16825
+ })(EqActionResult || (EqActionResult = {}));
16826
+ //# sourceMappingURL=action.js.map
16828
16827
  ;// CONCATENATED MODULE: ../core/dist/lib/main/context.js
16829
16828
  var context_assign = (undefined && undefined.__assign) || function () {
16830
16829
  context_assign = Object.assign || function(t) {
@@ -16862,7 +16861,9 @@ var EqContext = /** @class */ (function () {
16862
16861
  function EqContext() {
16863
16862
  var _this = this;
16864
16863
  this.options = {
16865
- syncSortOrderWithColumnsOrder: true
16864
+ syncSortOrderWithColumnsOrder: true,
16865
+ attributeFormat: '{entity} {attr}',
16866
+ columnTitleFormat: null //means it will be the same as attributeFormat
16866
16867
  };
16867
16868
  this.servicesInitialized = false;
16868
16869
  this.internalListCache = {};
@@ -18281,6 +18282,37 @@ var EqContext = /** @class */ (function () {
18281
18282
  });
18282
18283
  }
18283
18284
  };
18285
+ EqContext.prototype.getAttributeTitle = function (attr) {
18286
+ var format = this.options.attributeFormat;
18287
+ return this.getModel().getAttributeText(attr, format);
18288
+ };
18289
+ EqContext.prototype.getColumnTitle = function (attr) {
18290
+ var format = this.options.columnTitleFormat || this.options.attributeFormat;
18291
+ return this.getModel().getAttributeText(attr, format);
18292
+ };
18293
+ EqContext.prototype.getDefaultColumnCaption = function (column) {
18294
+ var attr;
18295
+ var model = this.getModel();
18296
+ switch (column.expr.tag) {
18297
+ case ExprTag.Constant:
18298
+ return "Contant Column";
18299
+ case ExprTag.CustomSql:
18300
+ return "SQL Column";
18301
+ case ExprTag.ParentColumn:
18302
+ return "Parent Column";
18303
+ case ExprTag.Query:
18304
+ return "Query Column";
18305
+ case ExprTag.EntityAttribute:
18306
+ case ExprTag.ParentEntityAttribute:
18307
+ attr = model.getAttributeById(column.expr.value);
18308
+ return this.getColumnTitle(attr);
18309
+ case ExprTag.AggregateFunction:
18310
+ attr = model.getAttributeById(column.expr.args[0].value);
18311
+ return this.getColumnTitle(attr) + ' ' + model.getAggrFunctionCaption(column.expr.func);
18312
+ default:
18313
+ return 'Column';
18314
+ }
18315
+ };
18284
18316
  return EqContext;
18285
18317
  }());
18286
18318
 
@@ -18600,7 +18632,6 @@ var EntitiesPanel = /** @class */ (function (_super) {
18600
18632
  autoClearSelection: true,
18601
18633
  entityRenderedCallback: null,
18602
18634
  attributeRenderedCallback: null,
18603
- columnTitleFormat: '{attr}'
18604
18635
  };
18605
18636
  if (options) {
18606
18637
  public_api.utils.assignDeep(this.options, options);
@@ -18729,10 +18760,8 @@ var EntitiesPanel = /** @class */ (function (_super) {
18729
18760
  if (model.checkAttrProperty(attrId, "useInResult")) {
18730
18761
  if (checkbox.checked) {
18731
18762
  var attr = model.getAttributeById(attrId);
18732
- var caption = model.getAttributeText(attr, _this.options.columnTitleFormat);
18733
18763
  var column = query.addColumn({
18734
- attribute: attr,
18735
- caption: caption
18764
+ attribute: attr
18736
18765
  });
18737
18766
  query.fireColumnsChangedEvent(QueryChangeAction.Add, column);
18738
18767
  }
@@ -18741,7 +18770,7 @@ var EntitiesPanel = /** @class */ (function (_super) {
18741
18770
  .filter(function (col) { return col.expr.tag === ExprTag.EntityAttribute
18742
18771
  && col.expr.value === attrId; });
18743
18772
  if (columns.length > 0) {
18744
- query.removeColumn(columns[0], null);
18773
+ query.removeColumn(columns[0]);
18745
18774
  query.fireColumnsChangedEvent(QueryChangeAction.Delete, columns[0]);
18746
18775
  }
18747
18776
  }
@@ -18955,11 +18984,9 @@ var EntitiesPanel = /** @class */ (function (_super) {
18955
18984
  for (var _i = 0, attrList_3 = attrList; _i < attrList_3.length; _i++) {
18956
18985
  var attrId_1 = attrList_3[_i];
18957
18986
  var attr = model.getAttributeById(attrId_1);
18958
- var caption = model.getAttributeText(attr, _this.options.columnTitleFormat);
18959
18987
  query.addColumn({
18960
- attribute: attr,
18961
- caption: caption
18962
- });
18988
+ attribute: attr
18989
+ }, true);
18963
18990
  }
18964
18991
  query.fireChangedEvent();
18965
18992
  if (_this.options.autoClearSelection) {
@@ -20512,7 +20539,6 @@ var ColumnRendererCP = /** @class */ (function () {
20512
20539
  });
20513
20540
  ColumnRendererCP.prototype.render = function () {
20514
20541
  var _this = this;
20515
- this.baseAttr = this.getAttribute();
20516
20542
  if (this.getButtonsToShow().indexOf("sorting") >= 0 && this.columnEnabled) {
20517
20543
  this.sortingButton = this.renderSoringButton(this.column.sorting);
20518
20544
  if (this.column.sorting !== SortDirection.None) {
@@ -20635,15 +20661,8 @@ var ColumnRendererCP = /** @class */ (function () {
20635
20661
  ColumnRendererCP.prototype.refresh = function () {
20636
20662
  this.render();
20637
20663
  };
20638
- ColumnRendererCP.prototype.getAttribute = function () {
20639
- var model = this.panel.getContext().getModel();
20640
- return model.getAttributeByIdSafe(this.column.expr.value);
20641
- };
20642
20664
  ColumnRendererCP.prototype.renderCaptionBlock = function () {
20643
20665
  var _this = this;
20644
- if (!this.column.caption || this.column.caption == '') {
20645
- this.column.caption = this.getDefaultColumnCaption();
20646
- }
20647
20666
  var builder = (0,lib_public_api.domel)('div')
20648
20667
  .addClass("".concat(this.cssPrefix, "-colelement"), "".concat(this.cssPrefix, "-captionelement"))
20649
20668
  .addClass(browser_utils/* browserUtils.getMobileCssClass */.z.getMobileCssClass());
@@ -20846,17 +20865,6 @@ var ColumnRendererCP = /** @class */ (function () {
20846
20865
  } }); })
20847
20866
  .toDOM();
20848
20867
  };
20849
- ColumnRendererCP.prototype.getDefaultColumnCaption = function () {
20850
- return this.getDefaultTitleText(this.baseAttr);
20851
- };
20852
- ColumnRendererCP.prototype.getDefaultTitleText = function (attr) {
20853
- return this.getAttributeCaption(attr, this.panel.options.titleElementFormat);
20854
- };
20855
- ColumnRendererCP.prototype.getAttributeCaption = function (attr, format) {
20856
- format = format || this.panel.options.attrElementFormat;
20857
- var model = this.panel.getContext().getModel();
20858
- return model.getAttributeText(attr, format);
20859
- };
20860
20868
  ColumnRendererCP.prototype.getClassesToAdd = function () {
20861
20869
  var result = "";
20862
20870
  result += this.columnEnabled ? '' : " ".concat(this.cssPrefix, "-disabled");
@@ -21087,7 +21095,7 @@ var ColumnRendererCP = /** @class */ (function () {
21087
21095
  switch (action) {
21088
21096
  case ColumnAction.Delete:
21089
21097
  var curQuery = this.column.getQuery();
21090
- curQuery.removeColumn(this.column, this.panel);
21098
+ curQuery.removeColumn(this.column);
21091
21099
  curQuery.fireColumnsChangedEvent(QueryChangeAction.Delete, this.column);
21092
21100
  break;
21093
21101
  case ColumnAction.Enable:
@@ -21281,8 +21289,8 @@ var ColumnRendererCP = /** @class */ (function () {
21281
21289
  }());
21282
21290
 
21283
21291
  //# sourceMappingURL=column_renderer_cp.js.map
21284
- ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/columnspanel/simple_column_renderer.js
21285
- var simple_column_renderer_extends = (undefined && undefined.__extends) || (function () {
21292
+ ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/columnspanel/attr_column_renderer_cp.js
21293
+ var attr_column_renderer_cp_extends = (undefined && undefined.__extends) || (function () {
21286
21294
  var extendStatics = function (d, b) {
21287
21295
  extendStatics = Object.setPrototypeOf ||
21288
21296
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -21302,15 +21310,15 @@ var simple_column_renderer_extends = (undefined && undefined.__extends) || (func
21302
21310
 
21303
21311
 
21304
21312
 
21305
- var SimpleColumnRendererCP = /** @class */ (function (_super) {
21306
- simple_column_renderer_extends(SimpleColumnRendererCP, _super);
21307
- function SimpleColumnRendererCP() {
21313
+ var AttrColumnRendererCP = /** @class */ (function (_super) {
21314
+ attr_column_renderer_cp_extends(AttrColumnRendererCP, _super);
21315
+ function AttrColumnRendererCP() {
21308
21316
  return _super !== null && _super.apply(this, arguments) || this;
21309
21317
  }
21310
- SimpleColumnRendererCP.prototype.getClassesToAdd = function () {
21318
+ AttrColumnRendererCP.prototype.getClassesToAdd = function () {
21311
21319
  return "".concat(_super.prototype.getClassesToAdd.call(this), " ").concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-entattr");
21312
21320
  };
21313
- SimpleColumnRendererCP.prototype.renderExpressionBlock = function () {
21321
+ AttrColumnRendererCP.prototype.renderExpressionBlock = function () {
21314
21322
  var _this = this;
21315
21323
  return (0,lib_public_api.domel)("div")
21316
21324
  .addClass("".concat(this.cssPrefix, "-expr-block"))
@@ -21321,9 +21329,14 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
21321
21329
  .addChildElement(_this.renderBaseExpression()); })
21322
21330
  .toDOM();
21323
21331
  };
21324
- SimpleColumnRendererCP.prototype.renderBaseExpression = function () {
21332
+ AttrColumnRendererCP.prototype.getAttribute = function () {
21333
+ var model = this.panel.getContext().getModel();
21334
+ return model.getAttributeByIdSafe(this.column.expr.value);
21335
+ };
21336
+ AttrColumnRendererCP.prototype.renderBaseExpression = function () {
21325
21337
  var _this = this;
21326
- var attrCaption = this.getAttributeCaption(this.baseAttr);
21338
+ var baseAttr = this.getAttribute();
21339
+ var attrCaption = this.panel.getContext().getAttributeTitle(baseAttr);
21327
21340
  if (this.isEditable()) {
21328
21341
  return (0,lib_public_api.domel)('a')
21329
21342
  .attr('href', 'javascript:void(0)')
@@ -21346,14 +21359,21 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
21346
21359
  .title(attrCaption)
21347
21360
  .toDOM();
21348
21361
  };
21349
- SimpleColumnRendererCP.prototype.baseExpressionItemSelectedCallback = function (data, item) {
21362
+ AttrColumnRendererCP.prototype.baseExpressionItemSelectedCallback = function (data, item) {
21350
21363
  var attrid = data.id;
21351
- this.column.expr.setValue(attrid, true);
21352
- this.column.caption = '';
21364
+ var context = this.panel.getContext();
21365
+ var attr = context.getModel().getAttributeById(attrid);
21366
+ this.updateBaseAttr(attr);
21367
+ this.column.caption = context.getDefaultColumnCaption(this.column);
21353
21368
  this.fireColumnChanged();
21354
21369
  return false;
21355
21370
  };
21356
- SimpleColumnRendererCP.prototype.getUIS = function () {
21371
+ AttrColumnRendererCP.prototype.updateBaseAttr = function (attr) {
21372
+ this.column.expr.setValue(attr.id, true);
21373
+ this.column.expr.baseAttrId = attr.id;
21374
+ this.column.expr.dataType = attr.dataType;
21375
+ };
21376
+ AttrColumnRendererCP.prototype.getUIS = function () {
21357
21377
  var arg = this.column.expr.args[0];
21358
21378
  if (arg) {
21359
21379
  var model = this.panel.getContext().getModel();
@@ -21363,7 +21383,7 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
21363
21383
  return true;
21364
21384
  }
21365
21385
  };
21366
- SimpleColumnRendererCP.prototype.changeTypeHandler = function (ev) {
21386
+ AttrColumnRendererCP.prototype.changeTypeHandler = function (ev) {
21367
21387
  var _this = this;
21368
21388
  this.keepShowingButtons = true;
21369
21389
  this.functionMenu.showMenu({
@@ -21381,7 +21401,7 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
21381
21401
  }
21382
21402
  });
21383
21403
  };
21384
- SimpleColumnRendererCP.prototype.changeTypeToCustomSql = function () {
21404
+ AttrColumnRendererCP.prototype.changeTypeToCustomSql = function () {
21385
21405
  var _this = this;
21386
21406
  var query = this.column.getQuery();
21387
21407
  query.changeColumnType(this.column, ExprTag.CustomSql);
@@ -21394,12 +21414,12 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
21394
21414
  }, 500);
21395
21415
  this.fireColumnChanged();
21396
21416
  };
21397
- SimpleColumnRendererCP.prototype.changeTypeToAggr = function (funcId) {
21417
+ AttrColumnRendererCP.prototype.changeTypeToAggr = function (funcId) {
21398
21418
  var query = this.column.getQuery();
21399
21419
  query.changeColumnType(this.column, ExprTag.AggregateFunction, { funcId: funcId });
21400
21420
  this.fireColumnChanged();
21401
21421
  };
21402
- SimpleColumnRendererCP.prototype.processExtraButtonMenuItems = function (action, evt) {
21422
+ AttrColumnRendererCP.prototype.processExtraButtonMenuItems = function (action, evt) {
21403
21423
  if (action === "CUSTOMSQL") {
21404
21424
  this.changeTypeToCustomSql();
21405
21425
  }
@@ -21408,7 +21428,7 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
21408
21428
  }
21409
21429
  return true;
21410
21430
  };
21411
- SimpleColumnRendererCP.prototype.getExtraButtonMenuItems = function () {
21431
+ AttrColumnRendererCP.prototype.getExtraButtonMenuItems = function () {
21412
21432
  var items = [];
21413
21433
  var funcs = this.panel.getContext().getModel().getAggrFunctions();
21414
21434
  var toInclude = true;
@@ -21459,12 +21479,12 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
21459
21479
  items: items
21460
21480
  }];
21461
21481
  };
21462
- return SimpleColumnRendererCP;
21482
+ return AttrColumnRendererCP;
21463
21483
  }(ColumnRendererCP));
21464
21484
 
21465
- //# sourceMappingURL=simple_column_renderer.js.map
21466
- ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/columnspanel/aggrfunc_column_renderer.js
21467
- var aggrfunc_column_renderer_extends = (undefined && undefined.__extends) || (function () {
21485
+ //# sourceMappingURL=attr_column_renderer_cp.js.map
21486
+ ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/columnspanel/aggrfunc_column_renderer_cp.js
21487
+ var aggrfunc_column_renderer_cp_extends = (undefined && undefined.__extends) || (function () {
21468
21488
  var extendStatics = function (d, b) {
21469
21489
  extendStatics = Object.setPrototypeOf ||
21470
21490
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -21487,7 +21507,7 @@ var aggrfunc_column_renderer_extends = (undefined && undefined.__extends) || (fu
21487
21507
 
21488
21508
 
21489
21509
  var AggrFuncColumnRendererCP = /** @class */ (function (_super) {
21490
- aggrfunc_column_renderer_extends(AggrFuncColumnRendererCP, _super);
21510
+ aggrfunc_column_renderer_cp_extends(AggrFuncColumnRendererCP, _super);
21491
21511
  function AggrFuncColumnRendererCP() {
21492
21512
  var _this = _super !== null && _super.apply(this, arguments) || this;
21493
21513
  _this.displayFormatParser = new DisplayFormatParser();
@@ -21502,10 +21522,6 @@ var AggrFuncColumnRendererCP = /** @class */ (function (_super) {
21502
21522
  .getModel()
21503
21523
  .getAttributeByIdSafe(this.column.expr.args[0].value);
21504
21524
  };
21505
- AggrFuncColumnRendererCP.prototype.getDefaultColumnCaption = function () {
21506
- return this.getDefaultTitleText(this.baseAttr) + ' '
21507
- + this.panel.getContext().getModel().getAggrFunctionCaption(this.column.expr.func);
21508
- };
21509
21525
  AggrFuncColumnRendererCP.prototype.renderExpressionBlock = function () {
21510
21526
  var _this = this;
21511
21527
  var model = this.panel.getContext().getModel();
@@ -21590,14 +21606,6 @@ var AggrFuncColumnRendererCP = /** @class */ (function (_super) {
21590
21606
  }
21591
21607
  return button;
21592
21608
  };
21593
- AggrFuncColumnRendererCP.prototype.baseExpressionItemSelectedCallback = function (data, item) {
21594
- var attrid = data.id;
21595
- //this.column.expr.args[0].id = attrid;
21596
- this.column.expr.args[0].setValue(attrid, true);
21597
- this.column.caption = '';
21598
- this.fireColumnChanged();
21599
- return false;
21600
- };
21601
21609
  AggrFuncColumnRendererCP.prototype.changeTypeToSimple = function () {
21602
21610
  var query = this.column.getQuery();
21603
21611
  query.changeColumnType(this.column, ExprTag.EntityAttribute);
@@ -21624,6 +21632,10 @@ var AggrFuncColumnRendererCP = /** @class */ (function (_super) {
21624
21632
  }
21625
21633
  return result;
21626
21634
  };
21635
+ AggrFuncColumnRendererCP.prototype.updateBaseAttr = function (attr) {
21636
+ this.column.expr.args[0].setValue(attr.id, true);
21637
+ this.column.expr.baseAttrId = attr.id;
21638
+ };
21627
21639
  AggrFuncColumnRendererCP.prototype.changeTypeHandler = function (ev) {
21628
21640
  this.changeTypeToSimple();
21629
21641
  };
@@ -21642,11 +21654,11 @@ var AggrFuncColumnRendererCP = /** @class */ (function (_super) {
21642
21654
  }];
21643
21655
  };
21644
21656
  return AggrFuncColumnRendererCP;
21645
- }(SimpleColumnRendererCP));
21657
+ }(AttrColumnRendererCP));
21646
21658
 
21647
- //# sourceMappingURL=aggrfunc_column_renderer.js.map
21648
- ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/columnspanel/customsql_column_renderer.js
21649
- var customsql_column_renderer_extends = (undefined && undefined.__extends) || (function () {
21659
+ //# sourceMappingURL=aggrfunc_column_renderer_cp.js.map
21660
+ ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/columnspanel/editable_column_renderer_cp.js
21661
+ var editable_column_renderer_cp_extends = (undefined && undefined.__extends) || (function () {
21650
21662
  var extendStatics = function (d, b) {
21651
21663
  extendStatics = Object.setPrototypeOf ||
21652
21664
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -21667,51 +21679,25 @@ var customsql_column_renderer_extends = (undefined && undefined.__extends) || (f
21667
21679
 
21668
21680
 
21669
21681
 
21670
- var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
21671
- customsql_column_renderer_extends(CustomSqlColumnRendererCP, _super);
21672
- function CustomSqlColumnRendererCP() {
21682
+ var EditableColumnRendererCP = /** @class */ (function (_super) {
21683
+ editable_column_renderer_cp_extends(EditableColumnRendererCP, _super);
21684
+ function EditableColumnRendererCP() {
21673
21685
  var _this = _super !== null && _super.apply(this, arguments) || this;
21674
21686
  _this.dataTypeMenu = null;
21675
21687
  return _this;
21676
21688
  }
21677
- CustomSqlColumnRendererCP.prototype.renderEnabledButton = function () {
21689
+ EditableColumnRendererCP.prototype.renderEnabledButton = function () {
21678
21690
  var elem = _super.prototype.renderEnabledButton.call(this);
21679
21691
  var child = elem.children[0];
21680
21692
  child.title = public_api.i18n.getText('CmdToggleEnableCustom');
21681
21693
  return elem;
21682
21694
  };
21683
21695
  ;
21684
- CustomSqlColumnRendererCP.prototype.getClassesToAdd = function () {
21696
+ EditableColumnRendererCP.prototype.getClassesToAdd = function () {
21685
21697
  return "".concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-entattr") + _super.prototype.getClassesToAdd.call(this);
21686
21698
  };
21687
- Object.defineProperty(CustomSqlColumnRendererCP.prototype, "columnEnabled", {
21688
- get: function () {
21689
- return this.panel.areCustomExpressionsAllowed() ? this.column.enabled : false;
21690
- },
21691
- set: function (value) {
21692
- if (this.panel.areCustomExpressionsAllowed()) {
21693
- this.column.enabled = value;
21694
- }
21695
- else {
21696
- this.column.enabled = false;
21697
- }
21698
- },
21699
- enumerable: false,
21700
- configurable: true
21701
- });
21702
- CustomSqlColumnRendererCP.prototype.renderColumnTypeButton = function () {
21703
- var button = _super.prototype.renderColumnTypeButton.call(this);
21704
- if (button) {
21705
- button.firstElementChild.classList.add('aggregated');
21706
- button.firstElementChild.setAttribute('title', public_api.i18n.getText('ButtonToSimple'));
21707
- }
21708
- return button;
21709
- };
21710
- CustomSqlColumnRendererCP.prototype.renderExpressionBlock = function () {
21699
+ EditableColumnRendererCP.prototype.renderExpressionBlock = function () {
21711
21700
  var _this = this;
21712
- if (!this.column.caption || this.column.caption == '') {
21713
- this.column.caption = this.getDefaultColumnCaption();
21714
- }
21715
21701
  var exprBlock = (0,lib_public_api.domel)("div")
21716
21702
  .addClass("".concat(this.cssPrefix, "-expr-block"))
21717
21703
  .addClass(browser_utils/* browserUtils.getMobileCssClass */.z.getMobileCssClass())
@@ -21741,7 +21727,7 @@ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
21741
21727
  )
21742
21728
  .addChild('input', function (b) { return b
21743
21729
  .hide()
21744
- .value(_this.column.expr.sql)
21730
+ .value(_this.getColumnValue())
21745
21731
  .on('blur keydown', function (ev) {
21746
21732
  var isEndEvent = false;
21747
21733
  var save = true;
@@ -21766,12 +21752,13 @@ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
21766
21752
  aEl.style.removeProperty('display');
21767
21753
  inputEl.style.display = 'none';
21768
21754
  }
21769
- if (save && _this.column.expr.sql !== inputEl.value) {
21770
- _this.column.expr.sql = inputEl.value;
21755
+ var colVal = _this.getColumnValue();
21756
+ if (save && colVal !== inputEl.value) {
21757
+ _this.setColumnValue(inputEl.value);
21771
21758
  _this.fireColumnChanged();
21772
21759
  }
21773
21760
  else {
21774
- inputEl.value = _this.column.expr.sql;
21761
+ inputEl.value = colVal;
21775
21762
  }
21776
21763
  _this.element.removeAttribute(lib_public_api.eqDragManager.DRAG_DISABLED_ATTR);
21777
21764
  }
@@ -21824,31 +21811,30 @@ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
21824
21811
  }
21825
21812
  return exprBlock;
21826
21813
  };
21827
- CustomSqlColumnRendererCP.prototype.changeTypeToSimple = function () {
21814
+ EditableColumnRendererCP.prototype.changeTypeToSimple = function () {
21828
21815
  var query = this.column.getQuery();
21829
21816
  query.changeColumnType(this.column, ExprTag.EntityAttribute);
21830
21817
  this.fireColumnChanged();
21831
21818
  };
21832
- CustomSqlColumnRendererCP.prototype.getDefaultColumnCaption = function () {
21833
- return "Custom SQL Column";
21819
+ EditableColumnRendererCP.prototype.getColumnValue = function () {
21820
+ return '';
21834
21821
  };
21835
- CustomSqlColumnRendererCP.prototype.getDefaultValue = function () {
21836
- return this.column.expr.sql;
21822
+ EditableColumnRendererCP.prototype.setColumnValue = function (value) {
21837
21823
  };
21838
- CustomSqlColumnRendererCP.prototype.getUIS = function () {
21824
+ EditableColumnRendererCP.prototype.getUIS = function () {
21839
21825
  return true;
21840
21826
  };
21841
- CustomSqlColumnRendererCP.prototype.changeTypeHandler = function (ev) {
21827
+ EditableColumnRendererCP.prototype.changeTypeHandler = function (ev) {
21842
21828
  this.changeTypeToSimple();
21843
21829
  };
21844
- CustomSqlColumnRendererCP.prototype.processExtraButtonMenuItems = function (action, evt) {
21830
+ EditableColumnRendererCP.prototype.processExtraButtonMenuItems = function (action, evt) {
21845
21831
  this.changeTypeToSimple();
21846
21832
  return true;
21847
21833
  };
21848
- CustomSqlColumnRendererCP.prototype.createFunctionMenu = function () {
21834
+ EditableColumnRendererCP.prototype.createFunctionMenu = function () {
21849
21835
  // Nothing TO DO
21850
21836
  };
21851
- CustomSqlColumnRendererCP.prototype.getExtraButtonMenuItems = function () {
21837
+ EditableColumnRendererCP.prototype.getExtraButtonMenuItems = function () {
21852
21838
  return [{
21853
21839
  id: '__group',
21854
21840
  text: public_api.i18n.getText('ColTypeGroup'),
@@ -21858,7 +21844,7 @@ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
21858
21844
  }]
21859
21845
  }];
21860
21846
  };
21861
- CustomSqlColumnRendererCP.prototype.createDataTypeMenu = function () {
21847
+ EditableColumnRendererCP.prototype.createDataTypeMenu = function () {
21862
21848
  var items = [];
21863
21849
  for (var typeItem in public_api.DataType) {
21864
21850
  if (!isNaN(Number(typeItem))) {
@@ -21881,10 +21867,74 @@ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
21881
21867
  };
21882
21868
  this.dataTypeMenu = new PopupMenu(menuOptions);
21883
21869
  };
21870
+ return EditableColumnRendererCP;
21871
+ }(AttrColumnRendererCP));
21872
+ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
21873
+ editable_column_renderer_cp_extends(CustomSqlColumnRendererCP, _super);
21874
+ function CustomSqlColumnRendererCP() {
21875
+ return _super !== null && _super.apply(this, arguments) || this;
21876
+ }
21877
+ Object.defineProperty(CustomSqlColumnRendererCP.prototype, "columnEnabled", {
21878
+ get: function () {
21879
+ return this.panel.areCustomExpressionsAllowed() ? this.column.enabled : false;
21880
+ },
21881
+ set: function (value) {
21882
+ if (this.panel.areCustomExpressionsAllowed()) {
21883
+ this.column.enabled = value;
21884
+ }
21885
+ else {
21886
+ this.column.enabled = false;
21887
+ }
21888
+ },
21889
+ enumerable: false,
21890
+ configurable: true
21891
+ });
21892
+ CustomSqlColumnRendererCP.prototype.renderColumnTypeButton = function () {
21893
+ var button = _super.prototype.renderColumnTypeButton.call(this);
21894
+ if (button) {
21895
+ button.firstElementChild.classList.add('aggregated');
21896
+ button.firstElementChild.setAttribute('title', public_api.i18n.getText('ButtonToSimple'));
21897
+ }
21898
+ return button;
21899
+ };
21900
+ CustomSqlColumnRendererCP.prototype.getColumnValue = function () {
21901
+ return this.column.expr.sql;
21902
+ };
21903
+ CustomSqlColumnRendererCP.prototype.setColumnValue = function (value) {
21904
+ this.column.expr.sql = value;
21905
+ };
21906
+ CustomSqlColumnRendererCP.prototype.getDefaultValue = function () {
21907
+ return this.column.expr.sql;
21908
+ };
21884
21909
  return CustomSqlColumnRendererCP;
21885
- }(SimpleColumnRendererCP));
21910
+ }(EditableColumnRendererCP));
21911
+
21912
+ var ConstColumnRendererCP = /** @class */ (function (_super) {
21913
+ editable_column_renderer_cp_extends(ConstColumnRendererCP, _super);
21914
+ function ConstColumnRendererCP() {
21915
+ return _super !== null && _super.apply(this, arguments) || this;
21916
+ }
21917
+ ConstColumnRendererCP.prototype.renderColumnTypeButton = function () {
21918
+ var button = _super.prototype.renderColumnTypeButton.call(this);
21919
+ if (button) {
21920
+ button.firstElementChild.classList.add('aggregated');
21921
+ button.firstElementChild.setAttribute('title', public_api.i18n.getText('ButtonToSimple'));
21922
+ }
21923
+ return button;
21924
+ };
21925
+ ConstColumnRendererCP.prototype.getColumnValue = function () {
21926
+ return this.column.expr.value;
21927
+ };
21928
+ ConstColumnRendererCP.prototype.setColumnValue = function (value) {
21929
+ this.column.expr.setValue(value);
21930
+ };
21931
+ ConstColumnRendererCP.prototype.getDefaultValue = function () {
21932
+ return this.column.expr.value;
21933
+ };
21934
+ return ConstColumnRendererCP;
21935
+ }(EditableColumnRendererCP));
21886
21936
 
21887
- //# sourceMappingURL=customsql_column_renderer.js.map
21937
+ //# sourceMappingURL=editable_column_renderer_cp.js.map
21888
21938
  ;// CONCATENATED MODULE: ./dist/lib/widgets/columns_panel.js
21889
21939
  var columns_panel_extends = (undefined && undefined.__extends) || (function () {
21890
21940
  var extendStatics = function (d, b) {
@@ -22131,7 +22181,15 @@ var ColumnsPanel = /** @class */ (function (_super) {
22131
22181
  var index = query.getColumns().indexOf(column);
22132
22182
  var newEl = _this.addColumnElement(column, index);
22133
22183
  if (isFocusInside) {
22134
- newEl.querySelector("a").focus();
22184
+ var focusElem = newEl.querySelector('a');
22185
+ if (focusElem) {
22186
+ try {
22187
+ focusElem.focus();
22188
+ }
22189
+ catch (_a) {
22190
+ //do nothing
22191
+ }
22192
+ }
22135
22193
  }
22136
22194
  };
22137
22195
  if (Array.isArray(columns)) {
@@ -22231,7 +22289,13 @@ var ColumnsPanel = /** @class */ (function (_super) {
22231
22289
  };
22232
22290
  ColumnsPanel.prototype.setOptions = function (options) {
22233
22291
  public_api.utils.assignDeep(this.options, options);
22234
- this.getContext().options.allowCustomExpressions = options.allowCustomExpressions;
22292
+ this.context.options.allowCustomExpressions = options.allowCustomExpressions;
22293
+ if (options.attrElementFormat) {
22294
+ this.context.options.attributeFormat = options.attrElementFormat;
22295
+ }
22296
+ if (options.titleElementFormat) {
22297
+ this.context.options.columnTitleFormat = options.titleElementFormat;
22298
+ }
22235
22299
  if (browser_utils/* browserUtils.isMobileMode */.z.isMobileMode()) {
22236
22300
  this.options.buttons = ["menu"];
22237
22301
  this.options.showHeader = false;
@@ -22320,66 +22384,36 @@ var ColumnsPanel = /** @class */ (function (_super) {
22320
22384
  .data("show-buttons", "");
22321
22385
  }
22322
22386
  };
22323
- ColumnsPanel.prototype.addNewColumn = function (attrId, index) {
22324
- var _this = this;
22387
+ ColumnsPanel.prototype.addNewColumn = function (attrs, index) {
22325
22388
  var model = this.getContext().getModel();
22326
22389
  var query = this.getQuery();
22327
- var getColumnByAttrId = function (attrid) {
22328
- var attribute = model.getAttributeById(attrid);
22329
- if (!attribute) {
22330
- return null;
22331
- }
22332
- if (!attribute.useInResult) {
22333
- if (attribute.lookupAttr) {
22334
- attrid = attribute.lookupAttr;
22335
- attribute = model.getAttributeById(attrid);
22336
- if (!attribute || !attribute.useInResult) {
22337
- return null;
22338
- }
22339
- }
22340
- else
22341
- return null;
22342
- }
22343
- var column = query.createColumn();
22344
- column.caption = _this.getDefaultColumnCaption(attribute);
22345
- column.sorting = SortDirection.None;
22346
- column.sortIndex = -1;
22347
- column.expr.tag = ExprTag.EntityAttribute;
22348
- column.expr.kind = DataKind.Attribute;
22349
- column.expr.dataType = attribute.dataType;
22350
- column.expr.setValue(attrid, true);
22351
- column.params.concat(attribute.params);
22352
- return column;
22353
- };
22354
- var colToAdd, col;
22355
- if (Array.isArray(attrId)) {
22356
- colToAdd = [];
22357
- for (var i = 0; i < attrId.length; i++) {
22358
- col = getColumnByAttrId(attrId[i]);
22390
+ if (Array.isArray(attrs)) {
22391
+ var col = null;
22392
+ var cols = [];
22393
+ for (var i = 0; i < attrs.length; i++) {
22394
+ col = query.addColumn({
22395
+ attributeId: attrs[i],
22396
+ index: index
22397
+ }, true);
22359
22398
  if (col) {
22360
- colToAdd.push(col);
22399
+ cols.push(col);
22361
22400
  }
22362
22401
  }
22402
+ query.fireChangedEvent({
22403
+ part: QueryChangePart.Columns,
22404
+ action: QueryChangeAction.Add,
22405
+ changee: cols,
22406
+ source: this
22407
+ });
22408
+ return cols;
22363
22409
  }
22364
- else
22365
- colToAdd = getColumnByAttrId(attrId);
22366
- this.addColumn(colToAdd, index);
22367
- return colToAdd;
22368
- };
22369
- ColumnsPanel.prototype.addColumn = function (column, index) {
22370
- var query = this.getQuery();
22371
- if (!query) {
22372
- return;
22373
- }
22374
- if (Array.isArray(column))
22375
- column = this.checkColumnsArray(column);
22376
- else
22377
- column = this.checkColumn(column);
22378
- if (!column || (Array.isArray(column) && column.length == 0)) {
22379
- return;
22410
+ else {
22411
+ var col = query.addColumn({
22412
+ attributeId: attrs,
22413
+ index: index
22414
+ });
22415
+ return col;
22380
22416
  }
22381
- query.addColumnObj(column, index, self);
22382
- query.fireColumnsChangedEvent(QueryChangeAction.Add, column);
22383
22417
  };
22384
22418
  //adds one column to the panel on the specified position
22385
22419
  ColumnsPanel.prototype.addColumnElement = function (column, index) {
@@ -22429,23 +22463,19 @@ var ColumnsPanel = /** @class */ (function (_super) {
22429
22463
  }
22430
22464
  return col;
22431
22465
  };
22432
- ColumnsPanel.prototype.getDefaultColumnCaption = function (attr) {
22433
- var format = this.options.titleElementFormat || this.options.attrElementFormat;
22434
- var model = this.getContext().getModel();
22435
- return model.getAttributeText(attr, format);
22436
- };
22437
22466
  ColumnsPanel.prototype.getColumnsBlock = function () {
22438
22467
  return this.columnsBlock;
22439
22468
  };
22440
22469
  ColumnsPanel.prototype.getColumnRenderer = function (column, slot) {
22441
22470
  switch (column.expr.tag) {
22471
+ case ExprTag.Constant:
22472
+ return new ConstColumnRendererCP(this, column, slot);
22442
22473
  case ExprTag.AggregateFunction:
22443
22474
  return new AggrFuncColumnRendererCP(this, column, slot);
22444
22475
  case ExprTag.CustomSql:
22445
22476
  return new CustomSqlColumnRendererCP(this, column, slot);
22446
- case ExprTag.EntityAttribute:
22447
- case ExprTag.ParentEntityAttribute:
22448
- return new SimpleColumnRendererCP(this, column, slot);
22477
+ default:
22478
+ return new AttrColumnRendererCP(this, column, slot);
22449
22479
  }
22450
22480
  return null;
22451
22481
  };
@@ -22654,7 +22684,6 @@ var ColumnRendererCB = /** @class */ (function () {
22654
22684
  });
22655
22685
  ColumnRendererCB.prototype.render = function () {
22656
22686
  var _this = this;
22657
- this.baseAttr = this.getAttribute();
22658
22687
  var builder = (0,lib_public_api.domel)('div');
22659
22688
  builder.data('id', this.column.id);
22660
22689
  if (this.element) {
@@ -22711,10 +22740,6 @@ var ColumnRendererCB = /** @class */ (function () {
22711
22740
  ColumnRendererCB.prototype.refresh = function () {
22712
22741
  this.render();
22713
22742
  };
22714
- ColumnRendererCB.prototype.getAttribute = function () {
22715
- var model = this.bar.getContext().getModel();
22716
- return model.getAttributeByIdSafe(this.column.expr.value);
22717
- };
22718
22743
  ColumnRendererCB.prototype.isEditable = function () {
22719
22744
  return this.column.enabled && !this.column.isReadOnly();
22720
22745
  };
@@ -22729,19 +22754,13 @@ var ColumnRendererCB = /** @class */ (function () {
22729
22754
  };
22730
22755
  ColumnRendererCB.prototype.renderCaptionBlock = function () {
22731
22756
  var _this = this;
22732
- if (!this.column.caption || this.column.caption == '') {
22733
- this.column.caption = this.getDefaultCaption();
22734
- }
22735
- var model = this.column.getModel();
22736
- var caption = this.baseAttr !== model.nullAttribute
22737
- ? this.column.caption
22738
- : model.getAttributeText(model.nullAttribute, '{attr}');
22757
+ var caption = this.column.caption;
22739
22758
  if (!this.isEditable()) {
22740
22759
  return (0,lib_public_api.domel)('div')
22741
22760
  .addClass("".concat(this.cssPrefix, "-colelement"), "".concat(this.cssPrefix, "-captionelement"))
22742
22761
  .addClass(browser_utils/* browserUtils.getMobileCssClass */.z.getMobileCssClass())
22743
22762
  .addChild('div', function (b) { return b
22744
- .title(_this.column.caption)
22763
+ .title(caption)
22745
22764
  .text(caption)
22746
22765
  .attr('tabIndex', '0'); })
22747
22766
  .toDOM();
@@ -22914,7 +22933,7 @@ var ColumnRendererCB = /** @class */ (function () {
22914
22933
  ColumnRendererCB.prototype.buttonDeleteClickHandler = function (ev) {
22915
22934
  ev.stopPropagation();
22916
22935
  var query = this.bar.getQuery();
22917
- query.removeColumn(this.column, this.bar);
22936
+ query.removeColumn(this.column);
22918
22937
  query.fireColumnsChangedEvent(QueryChangeAction.Delete, this.column);
22919
22938
  return false;
22920
22939
  };
@@ -22933,14 +22952,6 @@ var ColumnRendererCB = /** @class */ (function () {
22933
22952
  } })
22934
22953
  .toDOM();
22935
22954
  };
22936
- ColumnRendererCB.prototype.getDefaultCaption = function () {
22937
- return this.getDefaultTitleText(this.baseAttr);
22938
- };
22939
- ColumnRendererCB.prototype.getDefaultTitleText = function (attr) {
22940
- var format = this.bar.options.titleElementFormat || this.bar.options.attrElementFormat;
22941
- var model = this.bar.getContext().getModel();
22942
- return model.getAttributeText(attr, format);
22943
- };
22944
22955
  ColumnRendererCB.prototype.getClassesToAdd = function () {
22945
22956
  var result = "";
22946
22957
  result += this.column.enabled ? '' : " ".concat(this.cssPrefix, "-disabled");
@@ -23179,8 +23190,8 @@ var ColumnRendererCB = /** @class */ (function () {
23179
23190
  }());
23180
23191
 
23181
23192
  //# sourceMappingURL=column_renderer_cb.js.map
23182
- ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/columnsbar/simple_column_renderer.js
23183
- var columnsbar_simple_column_renderer_extends = (undefined && undefined.__extends) || (function () {
23193
+ ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/columnsbar/attr_column_renderer_cb.js
23194
+ var attr_column_renderer_cb_extends = (undefined && undefined.__extends) || (function () {
23184
23195
  var extendStatics = function (d, b) {
23185
23196
  extendStatics = Object.setPrototypeOf ||
23186
23197
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -23198,23 +23209,29 @@ var columnsbar_simple_column_renderer_extends = (undefined && undefined.__extend
23198
23209
 
23199
23210
 
23200
23211
 
23201
- var SimpleColumnRendererCB = /** @class */ (function (_super) {
23202
- columnsbar_simple_column_renderer_extends(SimpleColumnRendererCB, _super);
23203
- function SimpleColumnRendererCB() {
23212
+ var AttrColumnRendererCB = /** @class */ (function (_super) {
23213
+ attr_column_renderer_cb_extends(AttrColumnRendererCB, _super);
23214
+ function AttrColumnRendererCB() {
23204
23215
  return _super !== null && _super.apply(this, arguments) || this;
23205
23216
  }
23206
- SimpleColumnRendererCB.prototype.getClassesToAdd = function () {
23217
+ AttrColumnRendererCB.prototype.getClassesToAdd = function () {
23207
23218
  return "".concat(_super.prototype.getClassesToAdd.call(this), " ").concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-entattr");
23208
23219
  };
23209
- SimpleColumnRendererCB.prototype.baseExpressionItemSelectedCallback = function (data, item) {
23220
+ AttrColumnRendererCB.prototype.baseExpressionItemSelectedCallback = function (data, item) {
23210
23221
  var attrid = data.id;
23211
- //this.column.expr.id = attrid;
23212
- this.column.expr.setValue(attrid, true);
23213
- this.column.caption = '';
23214
- this.refresh();
23222
+ var context = this.bar.getContext();
23223
+ var attr = context.getModel().getAttributeById(attrid);
23224
+ this.updateBaseAttr(attr);
23225
+ this.column.caption = context.getDefaultColumnCaption(this.column);
23215
23226
  this.fireColumnChanged();
23227
+ return false;
23216
23228
  };
23217
- SimpleColumnRendererCB.prototype.getUIS = function () {
23229
+ AttrColumnRendererCB.prototype.updateBaseAttr = function (attr) {
23230
+ this.column.expr.setValue(attr.id, true);
23231
+ this.column.expr.baseAttrId = attr.id;
23232
+ this.column.expr.dataType = attr.dataType;
23233
+ };
23234
+ AttrColumnRendererCB.prototype.getUIS = function () {
23218
23235
  var arg = this.column.expr.args[0];
23219
23236
  if (arg) {
23220
23237
  var model = this.bar.getContext().getModel();
@@ -23224,17 +23241,17 @@ var SimpleColumnRendererCB = /** @class */ (function (_super) {
23224
23241
  return true;
23225
23242
  }
23226
23243
  };
23227
- SimpleColumnRendererCB.prototype.changeTypeToCustomSql = function () {
23244
+ AttrColumnRendererCB.prototype.changeTypeToCustomSql = function () {
23228
23245
  var query = this.column.getQuery();
23229
23246
  query.changeColumnType(this.column, ExprTag.CustomSql);
23230
23247
  this.fireColumnChanged();
23231
23248
  };
23232
- SimpleColumnRendererCB.prototype.changeTypeToAggr = function (funcId) {
23249
+ AttrColumnRendererCB.prototype.changeTypeToAggr = function (funcId) {
23233
23250
  var query = this.column.getQuery();
23234
23251
  query.changeColumnType(this.column, ExprTag.AggregateFunction, { funcId: funcId });
23235
23252
  this.fireColumnChanged();
23236
23253
  };
23237
- SimpleColumnRendererCB.prototype.changeColumnTypeHandler = function (ev) {
23254
+ AttrColumnRendererCB.prototype.changeColumnTypeHandler = function (ev) {
23238
23255
  var _this = this;
23239
23256
  this.functionMenu.showMenu({
23240
23257
  anchor: ev.target,
@@ -23256,12 +23273,12 @@ var SimpleColumnRendererCB = /** @class */ (function (_super) {
23256
23273
  }
23257
23274
  });
23258
23275
  };
23259
- return SimpleColumnRendererCB;
23276
+ return AttrColumnRendererCB;
23260
23277
  }(ColumnRendererCB));
23261
23278
 
23262
- //# sourceMappingURL=simple_column_renderer.js.map
23263
- ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer.js
23264
- var columnsbar_aggrfunc_column_renderer_extends = (undefined && undefined.__extends) || (function () {
23279
+ //# sourceMappingURL=attr_column_renderer_cb.js.map
23280
+ ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer_cb.js
23281
+ var aggrfunc_column_renderer_cb_extends = (undefined && undefined.__extends) || (function () {
23265
23282
  var extendStatics = function (d, b) {
23266
23283
  extendStatics = Object.setPrototypeOf ||
23267
23284
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -23280,23 +23297,13 @@ var columnsbar_aggrfunc_column_renderer_extends = (undefined && undefined.__exte
23280
23297
 
23281
23298
 
23282
23299
  var AggrFuncColumnRendererCB = /** @class */ (function (_super) {
23283
- columnsbar_aggrfunc_column_renderer_extends(AggrFuncColumnRendererCB, _super);
23300
+ aggrfunc_column_renderer_cb_extends(AggrFuncColumnRendererCB, _super);
23284
23301
  function AggrFuncColumnRendererCB() {
23285
23302
  return _super !== null && _super.apply(this, arguments) || this;
23286
23303
  }
23287
23304
  AggrFuncColumnRendererCB.prototype.getClassesToAdd = function () {
23288
23305
  return "".concat(_super.prototype.getClassesToAdd.call(this), " ").concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-aggr");
23289
23306
  };
23290
- AggrFuncColumnRendererCB.prototype.getAttribute = function () {
23291
- return this.bar
23292
- .getContext()
23293
- .getModel()
23294
- .getAttributeByIdSafe(this.column.expr.args[0].value);
23295
- };
23296
- AggrFuncColumnRendererCB.prototype.getDefaultCaption = function () {
23297
- return this.getDefaultTitleText(this.baseAttr) + ' '
23298
- + this.bar.getContext().getModel().getAggrFunctionCaption(this.column.expr.func);
23299
- };
23300
23307
  AggrFuncColumnRendererCB.prototype.renderColumnTypeButton = function () {
23301
23308
  var button = _super.prototype.renderColumnTypeButton.call(this);
23302
23309
  if (button) {
@@ -23305,12 +23312,9 @@ var AggrFuncColumnRendererCB = /** @class */ (function (_super) {
23305
23312
  }
23306
23313
  return button;
23307
23314
  };
23308
- AggrFuncColumnRendererCB.prototype.baseExpressionItemSelectedCallback = function (data, item) {
23309
- var attrid = data.id;
23310
- //this.column.expr.args[0].id = attrid;
23311
- this.column.expr.args[0].setValue(attrid, true);
23312
- this.column.caption = '';
23313
- this.fireColumnChanged();
23315
+ AggrFuncColumnRendererCB.prototype.updateBaseAttr = function (attr) {
23316
+ this.column.expr.args[0].setValue(attr.id, true);
23317
+ this.column.expr.baseAttrId = attr.id;
23314
23318
  };
23315
23319
  AggrFuncColumnRendererCB.prototype.changeTypeToSimple = function () {
23316
23320
  var query = this.column.getQuery();
@@ -23321,9 +23325,112 @@ var AggrFuncColumnRendererCB = /** @class */ (function (_super) {
23321
23325
  this.changeTypeToSimple();
23322
23326
  };
23323
23327
  return AggrFuncColumnRendererCB;
23324
- }(SimpleColumnRendererCB));
23328
+ }(AttrColumnRendererCB));
23329
+
23330
+ //# sourceMappingURL=aggrfunc_column_renderer_cb.js.map
23331
+ ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/columnsbar/editable_column_renderer_cb.js
23332
+ var editable_column_renderer_cb_extends = (undefined && undefined.__extends) || (function () {
23333
+ var extendStatics = function (d, b) {
23334
+ extendStatics = Object.setPrototypeOf ||
23335
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
23336
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
23337
+ return extendStatics(d, b);
23338
+ };
23339
+ return function (d, b) {
23340
+ if (typeof b !== "function" && b !== null)
23341
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
23342
+ extendStatics(d, b);
23343
+ function __() { this.constructor = d; }
23344
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
23345
+ };
23346
+ })();
23347
+
23348
+
23349
+ var EditableColumnRendererCB = /** @class */ (function (_super) {
23350
+ editable_column_renderer_cb_extends(EditableColumnRendererCB, _super);
23351
+ function EditableColumnRendererCB() {
23352
+ return _super !== null && _super.apply(this, arguments) || this;
23353
+ }
23354
+ EditableColumnRendererCB.prototype.getClassesToAdd = function () {
23355
+ return "".concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-entattr") + _super.prototype.getClassesToAdd.call(this);
23356
+ };
23357
+ EditableColumnRendererCB.prototype.renderColumnTypeButton = function () {
23358
+ var button = _super.prototype.renderColumnTypeButton.call(this);
23359
+ if (button) {
23360
+ button.classList.add('aggregated');
23361
+ button.title = public_api.i18n.getText('ButtonToSimple');
23362
+ }
23363
+ return button;
23364
+ };
23365
+ EditableColumnRendererCB.prototype.changeTypeToSimple = function () {
23366
+ var query = this.column.getQuery();
23367
+ query.changeColumnType(this.column, ExprTag.EntityAttribute);
23368
+ this.fireColumnChanged();
23369
+ };
23370
+ EditableColumnRendererCB.prototype.getColumnValue = function () {
23371
+ return '';
23372
+ };
23373
+ EditableColumnRendererCB.prototype.setColumnValue = function (value) {
23374
+ };
23375
+ EditableColumnRendererCB.prototype.getUIS = function () {
23376
+ return true;
23377
+ };
23378
+ EditableColumnRendererCB.prototype.changeColumnTypeHandler = function (ev) {
23379
+ this.changeTypeToSimple();
23380
+ };
23381
+ return EditableColumnRendererCB;
23382
+ }(ColumnRendererCB));
23383
+
23384
+ var CustomSqlColumnRendererCB = /** @class */ (function (_super) {
23385
+ editable_column_renderer_cb_extends(CustomSqlColumnRendererCB, _super);
23386
+ function CustomSqlColumnRendererCB() {
23387
+ return _super !== null && _super.apply(this, arguments) || this;
23388
+ }
23389
+ Object.defineProperty(CustomSqlColumnRendererCB.prototype, "columnEnabled", {
23390
+ get: function () {
23391
+ return this.bar.areCustomExpressionsAllowed() ? this.column.enabled : false;
23392
+ },
23393
+ set: function (value) {
23394
+ if (this.bar.areCustomExpressionsAllowed()) {
23395
+ this.column.enabled = value;
23396
+ }
23397
+ else {
23398
+ this.column.enabled = false;
23399
+ }
23400
+ },
23401
+ enumerable: false,
23402
+ configurable: true
23403
+ });
23404
+ CustomSqlColumnRendererCB.prototype.getColumnValue = function () {
23405
+ return this.column.expr.sql;
23406
+ };
23407
+ CustomSqlColumnRendererCB.prototype.setColumnValue = function (value) {
23408
+ this.column.expr.sql = value;
23409
+ };
23410
+ CustomSqlColumnRendererCB.prototype.getDefaultValue = function () {
23411
+ return this.column.expr.sql;
23412
+ };
23413
+ return CustomSqlColumnRendererCB;
23414
+ }(EditableColumnRendererCB));
23325
23415
 
23326
- //# sourceMappingURL=aggrfunc_column_renderer.js.map
23416
+ var ConstColumnRendererCB = /** @class */ (function (_super) {
23417
+ editable_column_renderer_cb_extends(ConstColumnRendererCB, _super);
23418
+ function ConstColumnRendererCB() {
23419
+ return _super !== null && _super.apply(this, arguments) || this;
23420
+ }
23421
+ ConstColumnRendererCB.prototype.getColumnValue = function () {
23422
+ return this.column.expr.value;
23423
+ };
23424
+ ConstColumnRendererCB.prototype.setColumnValue = function (value) {
23425
+ this.column.expr.setValue(value);
23426
+ };
23427
+ ConstColumnRendererCB.prototype.getDefaultValue = function () {
23428
+ return this.column.expr.value;
23429
+ };
23430
+ return ConstColumnRendererCB;
23431
+ }(EditableColumnRendererCB));
23432
+
23433
+ //# sourceMappingURL=editable_column_renderer_cb.js.map
23327
23434
  ;// CONCATENATED MODULE: ./dist/lib/widgets/columns_bar.js
23328
23435
  var columns_bar_extends = (undefined && undefined.__extends) || (function () {
23329
23436
  var extendStatics = function (d, b) {
@@ -23349,6 +23456,7 @@ var columns_bar_extends = (undefined && undefined.__extends) || (function () {
23349
23456
 
23350
23457
 
23351
23458
 
23459
+
23352
23460
  var ColumnsBar = /** @class */ (function (_super) {
23353
23461
  columns_bar_extends(ColumnsBar, _super);
23354
23462
  function ColumnsBar(slot, customQuery) {
@@ -23363,8 +23471,6 @@ var ColumnsBar = /** @class */ (function (_super) {
23363
23471
  allowDuplicates: true,
23364
23472
  allowCustomExpressions: false,
23365
23473
  allowSorting: true,
23366
- attrElementFormat: '{entity} {attr}',
23367
- titleElementFormat: null,
23368
23474
  alwaysShowButtons: false,
23369
23475
  accentActiveColumn: true,
23370
23476
  allowDragDrop: true,
@@ -23417,6 +23523,12 @@ var ColumnsBar = /** @class */ (function (_super) {
23417
23523
  var _this = this;
23418
23524
  _super.prototype.init.call(this, context, options);
23419
23525
  this.setOptions(options);
23526
+ if (options.attrElementFormat) {
23527
+ this.context.options.attributeFormat = options.attrElementFormat;
23528
+ }
23529
+ if (options.titleElementFormat) {
23530
+ this.context.options.columnTitleFormat = options.titleElementFormat;
23531
+ }
23420
23532
  this.detachQueryObserver();
23421
23533
  this.attachQueryObserver();
23422
23534
  lib_public_api.eqDragManager.removeDropContainer(this.slot);
@@ -23547,6 +23659,7 @@ var ColumnsBar = /** @class */ (function (_super) {
23547
23659
  };
23548
23660
  ColumnsBar.prototype.setOptions = function (options) {
23549
23661
  this.options = public_api.utils.assignDeep(this.options, options);
23662
+ this.getContext().options.allowCustomExpressions = options.allowCustomExpressions;
23550
23663
  };
23551
23664
  ColumnsBar.prototype.showLandingSlot = function (pageX, pageY) {
23552
23665
  var elements = this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix, "-row]"));
@@ -23798,64 +23911,41 @@ var ColumnsBar = /** @class */ (function (_super) {
23798
23911
  };
23799
23912
  ColumnsBar.prototype.getColumnRenderer = function (column, slot) {
23800
23913
  switch (column.expr.tag) {
23914
+ case ExprTag.Constant:
23915
+ return new ConstColumnRendererCB(this, column, slot);
23801
23916
  case ExprTag.AggregateFunction:
23802
23917
  return new AggrFuncColumnRendererCB(this, column, slot);
23803
23918
  case ExprTag.CustomSql:
23804
- // return new CustomSqlColumnRendererCB(this, column, slot);
23805
- case ExprTag.EntityAttribute:
23806
- case ExprTag.ParentEntityAttribute:
23807
- return new SimpleColumnRendererCB(this, column, slot);
23919
+ return new CustomSqlColumnRendererCB(this, column, slot);
23920
+ default:
23921
+ return new AttrColumnRendererCB(this, column, slot);
23808
23922
  }
23809
23923
  return null;
23810
23924
  };
23811
- ColumnsBar.prototype.addNewColumn = function (attrId, index) {
23812
- var _this = this;
23925
+ ColumnsBar.prototype.addNewColumn = function (attrs, index) {
23813
23926
  var model = this.getContext().getModel();
23814
23927
  var query = this.getQuery();
23815
- var getColumnByAttrId = function (attrid) {
23816
- var attribute = model.getAttributeById(attrid);
23817
- if (!attribute) {
23818
- return null;
23819
- }
23820
- if (!attribute.useInResult) {
23821
- if (attribute.lookupAttr) {
23822
- attrid = attribute.lookupAttr;
23823
- attribute = model.getAttributeById(attrid);
23824
- if (!attribute || !attribute.useInResult) {
23825
- return null;
23826
- }
23827
- }
23828
- else
23829
- return null;
23830
- }
23831
- var column = query.createColumn();
23832
- column.caption = _this.getDefaultColumnCaption(attribute);
23833
- column.sorting = SortDirection.None;
23834
- column.sortIndex = -1;
23835
- column.expr.tag = ExprTag.EntityAttribute;
23836
- column.expr.kind = DataKind.Attribute;
23837
- column.expr.dataType = attribute.dataType;
23838
- column.expr.setValue(attrid, true);
23839
- column.params.concat(attribute.params);
23840
- return column;
23841
- };
23842
- if (!this.getQuery()) {
23843
- return;
23844
- }
23845
- var colToAdd, col;
23846
- if (Array.isArray(attrId)) {
23847
- colToAdd = [];
23848
- for (var i = 0; i < attrId.length; i++) {
23849
- col = getColumnByAttrId(attrId[i]);
23928
+ if (Array.isArray(attrs)) {
23929
+ var col = null;
23930
+ var cols = [];
23931
+ for (var i = 0; i < attrs.length; i++) {
23932
+ col = query.addColumn({
23933
+ attributeId: attrs[i],
23934
+ index: index
23935
+ }, true);
23850
23936
  if (col) {
23851
- colToAdd.push(col);
23937
+ cols.push(col);
23852
23938
  }
23853
23939
  }
23940
+ return cols;
23941
+ }
23942
+ else {
23943
+ var col = query.addColumn({
23944
+ attributeId: attrs,
23945
+ index: index
23946
+ });
23947
+ return col;
23854
23948
  }
23855
- else
23856
- colToAdd = getColumnByAttrId(attrId);
23857
- this.addColumn(colToAdd, index);
23858
- return colToAdd;
23859
23949
  };
23860
23950
  ColumnsBar.prototype.toggleColumnPicked = function (column) {
23861
23951
  var el;
@@ -23880,25 +23970,6 @@ var ColumnsBar = /** @class */ (function (_super) {
23880
23970
  .data("show-buttons", "");
23881
23971
  }
23882
23972
  };
23883
- ColumnsBar.prototype.addColumn = function (column, index) {
23884
- var query = this.getQuery();
23885
- if (!query) {
23886
- return;
23887
- }
23888
- if (Array.isArray(column))
23889
- column = this.checkColumnsArray(column);
23890
- else
23891
- column = this.checkColumn(column);
23892
- if (!column || (Array.isArray(column) && column.length == 0)) {
23893
- return;
23894
- }
23895
- query.addColumnObj(column, index, self);
23896
- query.fireChangedEvent({
23897
- part: QueryChangePart.Columns,
23898
- action: QueryChangeAction.Add,
23899
- changee: column
23900
- });
23901
- };
23902
23973
  //adds one column to the bar on the specified position
23903
23974
  ColumnsBar.prototype.addColumnElement = function (column, index) {
23904
23975
  var rows = this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix, "-row]"));
@@ -23941,11 +24012,6 @@ var ColumnsBar = /** @class */ (function (_super) {
23941
24012
  }
23942
24013
  return col;
23943
24014
  };
23944
- ColumnsBar.prototype.getDefaultColumnCaption = function (attr) {
23945
- var format = this.options.titleElementFormat || this.options.attrElementFormat;
23946
- var model = this.getContext().getModel();
23947
- return model.getAttributeText(attr, format);
23948
- };
23949
24015
  ColumnsBar.prototype.getColumnsBlock = function () {
23950
24016
  return this.columnsBlock;
23951
24017
  };
@@ -24047,13 +24113,13 @@ var ColumnsBar = /** @class */ (function (_super) {
24047
24113
  };
24048
24114
  ColumnsBar.prototype.areCustomExpressionsAllowed = function () {
24049
24115
  var query = this.getQuery();
24050
- return query.isEx() && this.options.allowCustomExpressions;
24116
+ return query.isEx() && this.getContext().options.allowCustomExpressions;
24051
24117
  };
24052
24118
  ColumnsBar.globalCounter = 0;
24053
24119
  return ColumnsBar;
24054
24120
  }(Widget));
24055
24121
  //# sourceMappingURL=columns_bar.js.map
24056
- ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/sortingbar/column_renderer_sp.js
24122
+ ;// CONCATENATED MODULE: ./dist/lib/widgets/renderers/sortingbar/column_renderer_sb.js
24057
24123
 
24058
24124
 
24059
24125
 
@@ -24077,7 +24143,6 @@ var ColumnRendererSB = /** @class */ (function () {
24077
24143
  });
24078
24144
  ColumnRendererSB.prototype.render = function () {
24079
24145
  var _this = this;
24080
- this.baseAttr = this.getAttribute();
24081
24146
  var builder = (0,lib_public_api.domel)('div');
24082
24147
  builder.data('id', this.column.id);
24083
24148
  if (this.element) {
@@ -24128,9 +24193,6 @@ var ColumnRendererSB = /** @class */ (function () {
24128
24193
  };
24129
24194
  ColumnRendererSB.prototype.renderCaptionBlock = function () {
24130
24195
  var _this = this;
24131
- if (!this.column.caption || this.column.caption == '') {
24132
- this.column.caption = this.getDefaultCaption();
24133
- }
24134
24196
  function getArrow(sd) {
24135
24197
  switch (sd) {
24136
24198
  case SortDirection.Ascending:
@@ -24200,7 +24262,7 @@ var ColumnRendererSB = /** @class */ (function () {
24200
24262
  if (data.id == 'None' || data.id == "Ascending" || data.id == "Descending") {
24201
24263
  var query = _this.bar.getContext().getQuery();
24202
24264
  if (_this.column.isJustSorted() && data.id == 'None') {
24203
- query.removeColumn(_this.column, _this.bar);
24265
+ query.removeColumn(_this.column);
24204
24266
  query.fireColumnsChangedEvent(QueryChangeAction.Delete, _this.column, true);
24205
24267
  }
24206
24268
  else {
@@ -24219,14 +24281,6 @@ var ColumnRendererSB = /** @class */ (function () {
24219
24281
  });
24220
24282
  return false;
24221
24283
  };
24222
- ColumnRendererSB.prototype.getDefaultCaption = function () {
24223
- return this.getDefaultTitleText(this.baseAttr);
24224
- };
24225
- ColumnRendererSB.prototype.getDefaultTitleText = function (attr) {
24226
- var format = this.bar.options.titleElementFormat || this.bar.options.attrElementFormat;
24227
- var model = this.bar.getContext().getModel();
24228
- return model.getAttributeText(attr, format);
24229
- };
24230
24284
  ColumnRendererSB.prototype.getClassesToAdd = function () {
24231
24285
  return "".concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-entattr");
24232
24286
  };
@@ -24238,7 +24292,7 @@ var ColumnRendererSB = /** @class */ (function () {
24238
24292
  return ColumnRendererSB;
24239
24293
  }());
24240
24294
 
24241
- //# sourceMappingURL=column_renderer_sp.js.map
24295
+ //# sourceMappingURL=column_renderer_sb.js.map
24242
24296
  ;// CONCATENATED MODULE: ./dist/lib/widgets/sorting_bar.js
24243
24297
  var sorting_bar_extends = (undefined && undefined.__extends) || (function () {
24244
24298
  var extendStatics = function (d, b) {
@@ -24268,8 +24322,6 @@ var SortingBar = /** @class */ (function (_super) {
24268
24322
  var _this = _super.call(this, slot) || this;
24269
24323
  _this.options = {
24270
24324
  showAddRow: true,
24271
- attrElementFormat: '{entity} {attr}',
24272
- titleElementFormat: null,
24273
24325
  allowDragDrop: true,
24274
24326
  menuOptions: {
24275
24327
  showSearchBoxAfter: 30,
@@ -24313,6 +24365,12 @@ var SortingBar = /** @class */ (function (_super) {
24313
24365
  var _this = this;
24314
24366
  _super.prototype.init.call(this, context, options);
24315
24367
  this.setOptions(options);
24368
+ if (options.attrElementFormat) {
24369
+ this.context.options.attributeFormat = options.attrElementFormat;
24370
+ }
24371
+ if (options.titleElementFormat) {
24372
+ this.context.options.columnTitleFormat = options.titleElementFormat;
24373
+ }
24316
24374
  this.destroyCore();
24317
24375
  this.attachQueryObserver();
24318
24376
  lib_public_api.eqDragManager.removeDropContainer(this.slot);
@@ -24465,48 +24523,20 @@ var SortingBar = /** @class */ (function (_super) {
24465
24523
  });
24466
24524
  };
24467
24525
  SortingBar.prototype.addNewColumn = function (attrId) {
24468
- var _this = this;
24469
24526
  var model = this.getModel();
24470
24527
  var query = this.getQuery();
24471
- var getColumnByAttrId = function (attrid) {
24472
- var attribute = model.getAttributeById(attrid);
24473
- if (!attribute) {
24474
- return null;
24475
- }
24476
- if (!attribute.useInSorting) {
24477
- if (attribute.lookupAttr) {
24478
- attrid = attribute.lookupAttr;
24479
- attribute = model.getAttributeById(attrid);
24480
- if (!attribute || !attribute.useInSorting) {
24481
- return null;
24482
- }
24483
- }
24484
- else
24485
- return null;
24486
- }
24487
- var column = query.createColumn(true);
24488
- column.caption = _this.getDefaultColumnCaption(attribute);
24489
- column._sorting = SortDirection.Ascending;
24490
- //column.sortIndex = this.getQuery().getColumnSortIndex(column);
24491
- column.expr.tag = ExprTag.EntityAttribute;
24492
- column.expr.dataType = attribute.dataType;
24493
- //column.expr.id = attrid;
24494
- column.expr.setValue(attrid, true);
24495
- column.params.concat(attribute.params);
24496
- return column;
24497
- };
24498
- if (!this.getQuery()) {
24499
- return;
24500
- }
24501
- var newCol = getColumnByAttrId(attrId);
24502
- return this.getQuery().addColumn({
24503
- column: newCol
24528
+ var col = query.addColumn({
24529
+ attributeId: attrId,
24530
+ justsorted: true,
24531
+ sorting: SortDirection.Ascending
24504
24532
  });
24505
- };
24506
- SortingBar.prototype.getDefaultColumnCaption = function (attr) {
24507
- var format = this.options.titleElementFormat || this.options.attrElementFormat;
24508
- var model = this.getModel();
24509
- return model.getAttributeText(attr, format);
24533
+ query.fireChangedEvent({
24534
+ part: QueryChangePart.SortingColumns,
24535
+ action: QueryChangeAction.Add,
24536
+ changee: col,
24537
+ source: this
24538
+ });
24539
+ return col;
24510
24540
  };
24511
24541
  SortingBar.prototype.renderColumn = function (column, elem) {
24512
24542
  var renderer = new ColumnRendererSB(this, column, elem);
@@ -28228,78 +28258,17 @@ var EasyGridWidget = /** @class */ (function (_super) {
28228
28258
  }
28229
28259
  };
28230
28260
  EasyGridWidget.prototype.addNewColumn = function (attrId) {
28231
- var _this = this;
28232
28261
  var model = this.getContext().getModel();
28233
28262
  var query = this.getContext().getQuery();
28234
- var getColumnByAttrId = function (attrid) {
28235
- var attribute = model.getAttributeById(attrid);
28236
- if (!attribute) {
28237
- return null;
28238
- }
28239
- if (!attribute.useInSorting) {
28240
- if (attribute.lookupAttr) {
28241
- attrid = attribute.lookupAttr;
28242
- attribute = model.getAttributeById(attrid);
28243
- if (!attribute || !attribute.useInSorting) {
28244
- return null;
28245
- }
28246
- }
28247
- else
28248
- return null;
28249
- }
28250
- var column = query.createColumn();
28251
- column.caption = _this.getDefaultColumnCaption(attribute);
28252
- column.sorting = SortDirection.None;
28253
- column.sortIndex = -1;
28254
- column.expr.tag = ExprTag.EntityAttribute;
28255
- //column.expr.id = attrid;
28256
- column.expr.setValue(attrid, true);
28257
- column.params.concat(attribute.params);
28258
- return column;
28259
- };
28260
- if (!this.getContext().getQuery()) {
28261
- return;
28262
- }
28263
- return this.addColumn(getColumnByAttrId(attrId));
28264
- };
28265
- EasyGridWidget.prototype.getDefaultColumnCaption = function (attr) {
28266
- var format = this.options.titleElementFormat || this.options.attrElementFormat;
28267
- var model = this.getContext().getModel();
28268
- return model.getAttributeText(attr, format);
28269
- };
28270
- EasyGridWidget.prototype.addColumn = function (column) {
28271
- var query = this.getContext().getQuery();
28272
- if (!query) {
28273
- return;
28274
- }
28275
- column = this.checkColumn(column);
28276
- if (!column) {
28277
- return;
28278
- }
28279
- column = query.addColumn({
28280
- caption: column.caption,
28281
- attributeId: column.expr.value,
28282
- sorting: column.sorting,
28283
- sortIndex: column.sortIndex
28263
+ var col = query.addColumn({
28264
+ attributeId: attrId
28284
28265
  });
28285
28266
  query.fireChangedEvent({
28286
28267
  part: QueryChangePart.Columns,
28287
28268
  action: QueryChangeAction.Add,
28288
- changee: column,
28269
+ changee: col,
28289
28270
  source: this
28290
28271
  });
28291
- return column;
28292
- };
28293
- EasyGridWidget.prototype.checkColumn = function (col) {
28294
- var query = this.getContext().getQuery();
28295
- var columns = query.getColumns();
28296
- var colJson = JSON.stringify(col.expr.saveToData());
28297
- for (var i = 0; i < columns.length; i++) {
28298
- var qcolJson = JSON.stringify(columns[i].expr.saveToData());
28299
- if (qcolJson === colJson) {
28300
- return null;
28301
- }
28302
- }
28303
28272
  return col;
28304
28273
  };
28305
28274
  return EasyGridWidget;
@@ -32249,12 +32218,7 @@ var View = /** @class */ (function () {
32249
32218
  }
32250
32219
  // map columnTitleFormat option to widgets that have similar option
32251
32220
  if (options.columnTitleFormat) {
32252
- options.widgets.entitiesPanel = options.widgets.entitiesPanel || {};
32253
- options.widgets.entitiesPanel.columnTitleFormat = options.widgets.entitiesPanel.columnTitleFormat || options.columnTitleFormat;
32254
- options.widgets.columnsBar = options.widgets.columnsBar || {};
32255
- options.widgets.columnsBar.titleElementFormat = options.widgets.columnsBar.titleElementFormat || options.columnTitleFormat;
32256
- options.widgets.columnsPanel = options.widgets.columnsPanel || {};
32257
- options.widgets.columnsPanel.titleElementFormat = options.widgets.columnsPanel.titleElementFormat || options.columnTitleFormat;
32221
+ this.context.options.columnTitleFormat = options.columnTitleFormat;
32258
32222
  }
32259
32223
  //to support old paging options (should be removed in the next versions)
32260
32224
  options.widgets.easyGrid.paging =