@easyquery/ui 7.2.4-rc04 → 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.
- package/dist/browser/eq.community.js +451 -483
- package/dist/browser/eq.community.js.map +1 -1
- package/dist/browser/eq.community.min.js +1 -1
- package/dist/browser/eq.community.min.js.map +1 -1
- package/dist/browser/eq.core.css +1 -1
- package/dist/browser/eq.view.css +1 -1
- package/dist/bundles/easyquery.ui.js +368 -435
- package/dist/bundles/easyquery.ui.js.map +1 -1
- package/dist/bundles/easyquery.ui.min.js +1 -1
- package/dist/bundles/easyquery.ui.min.js.map +1 -1
- package/dist/lib/public_api.d.ts +5 -5
- package/dist/lib/public_api.js +5 -5
- package/dist/lib/public_api.js.map +1 -1
- package/dist/lib/views/view.js +1 -6
- package/dist/lib/views/view.js.map +1 -1
- package/dist/lib/widgets/columns_bar.d.ts +2 -4
- package/dist/lib/widgets/columns_bar.js +35 -76
- package/dist/lib/widgets/columns_bar.js.map +1 -1
- package/dist/lib/widgets/columns_panel.d.ts +2 -4
- package/dist/lib/widgets/columns_panel.js +47 -67
- package/dist/lib/widgets/columns_panel.js.map +1 -1
- package/dist/lib/widgets/easy_grid_widget.d.ts +0 -3
- package/dist/lib/widgets/easy_grid_widget.js +4 -65
- package/dist/lib/widgets/easy_grid_widget.js.map +1 -1
- package/dist/lib/widgets/entities_panel.js +4 -9
- package/dist/lib/widgets/entities_panel.js.map +1 -1
- package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer_cb.d.ts +9 -0
- package/dist/lib/widgets/renderers/columnsbar/{aggrfunc_column_renderer.js → aggrfunc_column_renderer_cb.js} +6 -19
- package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer_cb.js.map +1 -0
- package/dist/lib/widgets/renderers/columnsbar/{simple_column_renderer.d.ts → attr_column_renderer_cb.d.ts} +4 -2
- package/dist/lib/widgets/renderers/columnsbar/{simple_column_renderer.js → attr_column_renderer_cb.js} +22 -16
- package/dist/lib/widgets/renderers/columnsbar/attr_column_renderer_cb.js.map +1 -0
- package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.d.ts +1 -5
- package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js +3 -22
- package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js.map +1 -1
- package/dist/lib/widgets/renderers/columnsbar/editable_column_renderer_cb.d.ts +22 -0
- package/dist/lib/widgets/renderers/columnsbar/editable_column_renderer_cb.js +102 -0
- package/dist/lib/widgets/renderers/columnsbar/editable_column_renderer_cb.js.map +1 -0
- package/dist/lib/widgets/renderers/columnspanel/{aggrfunc_column_renderer.d.ts → aggrfunc_column_renderer_cp.d.ts} +3 -4
- package/dist/lib/widgets/renderers/columnspanel/{aggrfunc_column_renderer.js → aggrfunc_column_renderer_cp.js} +7 -15
- package/dist/lib/widgets/renderers/columnspanel/aggrfunc_column_renderer_cp.js.map +1 -0
- package/dist/lib/widgets/renderers/columnspanel/{simple_column_renderer.d.ts → attr_column_renderer_cp.d.ts} +4 -1
- package/dist/lib/widgets/renderers/columnspanel/{simple_column_renderer.js → attr_column_renderer_cp.js} +31 -19
- package/dist/lib/widgets/renderers/columnspanel/attr_column_renderer_cp.js.map +1 -0
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.d.ts +1 -6
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js +1 -20
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js.map +1 -1
- package/dist/lib/widgets/renderers/columnspanel/{customsql_column_renderer.d.ts → editable_column_renderer_cp.d.ts} +19 -7
- package/dist/lib/widgets/renderers/columnspanel/{customsql_column_renderer.js → editable_column_renderer_cp.js} +88 -50
- package/dist/lib/widgets/renderers/columnspanel/editable_column_renderer_cp.js.map +1 -0
- package/dist/lib/widgets/renderers/querypanel/condition_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/sortingbar/{column_renderer_sp.d.ts → column_renderer_sb.d.ts} +0 -3
- package/dist/lib/widgets/renderers/sortingbar/{column_renderer_sp.js → column_renderer_sb.js} +2 -14
- package/dist/lib/widgets/renderers/sortingbar/column_renderer_sb.js.map +1 -0
- package/dist/lib/widgets/sorting_bar.d.ts +0 -1
- package/dist/lib/widgets/sorting_bar.js +19 -43
- package/dist/lib/widgets/sorting_bar.js.map +1 -1
- package/package.json +2 -2
- package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer.d.ts +0 -11
- package/dist/lib/widgets/renderers/columnsbar/aggrfunc_column_renderer.js.map +0 -1
- package/dist/lib/widgets/renderers/columnsbar/simple_column_renderer.js.map +0 -1
- package/dist/lib/widgets/renderers/columnspanel/aggrfunc_column_renderer.js.map +0 -1
- package/dist/lib/widgets/renderers/columnspanel/customsql_column_renderer.js.map +0 -1
- package/dist/lib/widgets/renderers/columnspanel/simple_column_renderer.js.map +0 -1
- package/dist/lib/widgets/renderers/sortingbar/column_renderer_sp.js.map +0 -1
|
@@ -6901,6 +6901,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
6901
6901
|
AggrSettingsDialog: function() { return /* reexport */ AggrSettingsDialog; },
|
|
6902
6902
|
AggrSettingsRenderer: function() { return /* reexport */ AggrSettingsRenderer; },
|
|
6903
6903
|
AggregationBar: function() { return /* reexport */ AggregationBar; },
|
|
6904
|
+
AttrColumnRendererCB: function() { return /* reexport */ AttrColumnRendererCB; },
|
|
6905
|
+
AttrColumnRendererCP: function() { return /* reexport */ AttrColumnRendererCP; },
|
|
6904
6906
|
AttributeExpressionRenderer: function() { return /* reexport */ AttributeExpressionRenderer; },
|
|
6905
6907
|
BaseElementRenderer: function() { return /* reexport */ BaseElementRenderer; },
|
|
6906
6908
|
ChartFacet: function() { return /* reexport */ ChartFacet; },
|
|
@@ -6916,6 +6918,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
6916
6918
|
ConditionGroupRenderer: function() { return /* reexport */ ConditionGroupRenderer; },
|
|
6917
6919
|
ConditionGroupRowRenderer: function() { return /* reexport */ ConditionGroupRowRenderer; },
|
|
6918
6920
|
ConditionRenderer: function() { return /* reexport */ ConditionRenderer; },
|
|
6921
|
+
ConstColumnRendererCP: function() { return /* reexport */ ConstColumnRendererCP; },
|
|
6919
6922
|
CustomListExpressionRenderer: function() { return /* reexport */ CustomListExpressionRenderer; },
|
|
6920
6923
|
CustomSqlColumnRendererCP: function() { return /* reexport */ CustomSqlColumnRendererCP; },
|
|
6921
6924
|
DataFilterView: function() { return /* reexport */ DataFilterView; },
|
|
@@ -6947,8 +6950,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
6947
6950
|
ReportView: function() { return /* reexport */ ReportView; },
|
|
6948
6951
|
ResultFacet: function() { return /* reexport */ ResultFacet; },
|
|
6949
6952
|
ResultFacetsPanel: function() { return /* reexport */ ResultFacetsPanel; },
|
|
6950
|
-
SimpleColumnRendererCB: function() { return /* reexport */ SimpleColumnRendererCB; },
|
|
6951
|
-
SimpleColumnRendererCP: function() { return /* reexport */ SimpleColumnRendererCP; },
|
|
6952
6953
|
SimpleConditionRenderer: function() { return /* reexport */ SimpleConditionRenderer; },
|
|
6953
6954
|
SortingBar: function() { return /* reexport */ SortingBar; },
|
|
6954
6955
|
SqlListExpressionRenderer: function() { return /* reexport */ SqlListExpressionRenderer; },
|
|
@@ -7073,7 +7074,6 @@ var EntitiesPanel = /** @class */ (function (_super) {
|
|
|
7073
7074
|
autoClearSelection: true,
|
|
7074
7075
|
entityRenderedCallback: null,
|
|
7075
7076
|
attributeRenderedCallback: null,
|
|
7076
|
-
columnTitleFormat: '{attr}'
|
|
7077
7077
|
};
|
|
7078
7078
|
if (options) {
|
|
7079
7079
|
public_api/* utils.assignDeep */.P6.assignDeep(this.options, options);
|
|
@@ -7202,10 +7202,8 @@ var EntitiesPanel = /** @class */ (function (_super) {
|
|
|
7202
7202
|
if (model.checkAttrProperty(attrId, "useInResult")) {
|
|
7203
7203
|
if (checkbox.checked) {
|
|
7204
7204
|
var attr = model.getAttributeById(attrId);
|
|
7205
|
-
var caption = model.getAttributeText(attr, _this.options.columnTitleFormat);
|
|
7206
7205
|
var column = query.addColumn({
|
|
7207
|
-
attribute: attr
|
|
7208
|
-
caption: caption
|
|
7206
|
+
attribute: attr
|
|
7209
7207
|
});
|
|
7210
7208
|
query.fireColumnsChangedEvent(external_easyqueryCore_.QueryChangeAction.Add, column);
|
|
7211
7209
|
}
|
|
@@ -7214,7 +7212,7 @@ var EntitiesPanel = /** @class */ (function (_super) {
|
|
|
7214
7212
|
.filter(function (col) { return col.expr.tag === external_easyqueryCore_.ExprTag.EntityAttribute
|
|
7215
7213
|
&& col.expr.value === attrId; });
|
|
7216
7214
|
if (columns.length > 0) {
|
|
7217
|
-
query.removeColumn(columns[0]
|
|
7215
|
+
query.removeColumn(columns[0]);
|
|
7218
7216
|
query.fireColumnsChangedEvent(external_easyqueryCore_.QueryChangeAction.Delete, columns[0]);
|
|
7219
7217
|
}
|
|
7220
7218
|
}
|
|
@@ -7428,11 +7426,9 @@ var EntitiesPanel = /** @class */ (function (_super) {
|
|
|
7428
7426
|
for (var _i = 0, attrList_3 = attrList; _i < attrList_3.length; _i++) {
|
|
7429
7427
|
var attrId_1 = attrList_3[_i];
|
|
7430
7428
|
var attr = model.getAttributeById(attrId_1);
|
|
7431
|
-
var caption = model.getAttributeText(attr, _this.options.columnTitleFormat);
|
|
7432
7429
|
query.addColumn({
|
|
7433
|
-
attribute: attr
|
|
7434
|
-
|
|
7435
|
-
});
|
|
7430
|
+
attribute: attr
|
|
7431
|
+
}, true);
|
|
7436
7432
|
}
|
|
7437
7433
|
query.fireChangedEvent();
|
|
7438
7434
|
if (_this.options.autoClearSelection) {
|
|
@@ -8985,7 +8981,6 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
8985
8981
|
});
|
|
8986
8982
|
ColumnRendererCP.prototype.render = function () {
|
|
8987
8983
|
var _this = this;
|
|
8988
|
-
this.baseAttr = this.getAttribute();
|
|
8989
8984
|
if (this.getButtonsToShow().indexOf("sorting") >= 0 && this.columnEnabled) {
|
|
8990
8985
|
this.sortingButton = this.renderSoringButton(this.column.sorting);
|
|
8991
8986
|
if (this.column.sorting !== external_easyqueryCore_.SortDirection.None) {
|
|
@@ -9108,15 +9103,8 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9108
9103
|
ColumnRendererCP.prototype.refresh = function () {
|
|
9109
9104
|
this.render();
|
|
9110
9105
|
};
|
|
9111
|
-
ColumnRendererCP.prototype.getAttribute = function () {
|
|
9112
|
-
var model = this.panel.getContext().getModel();
|
|
9113
|
-
return model.getAttributeByIdSafe(this.column.expr.value);
|
|
9114
|
-
};
|
|
9115
9106
|
ColumnRendererCP.prototype.renderCaptionBlock = function () {
|
|
9116
9107
|
var _this = this;
|
|
9117
|
-
if (!this.column.caption || this.column.caption == '') {
|
|
9118
|
-
this.column.caption = this.getDefaultColumnCaption();
|
|
9119
|
-
}
|
|
9120
9108
|
var builder = (0,lib_public_api/* domel */.uC)('div')
|
|
9121
9109
|
.addClass("".concat(this.cssPrefix, "-colelement"), "".concat(this.cssPrefix, "-captionelement"))
|
|
9122
9110
|
.addClass(browser_utils/* browserUtils.getMobileCssClass */.z.getMobileCssClass());
|
|
@@ -9319,17 +9307,6 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9319
9307
|
} }); })
|
|
9320
9308
|
.toDOM();
|
|
9321
9309
|
};
|
|
9322
|
-
ColumnRendererCP.prototype.getDefaultColumnCaption = function () {
|
|
9323
|
-
return this.getDefaultTitleText(this.baseAttr);
|
|
9324
|
-
};
|
|
9325
|
-
ColumnRendererCP.prototype.getDefaultTitleText = function (attr) {
|
|
9326
|
-
return this.getAttributeCaption(attr, this.panel.options.titleElementFormat);
|
|
9327
|
-
};
|
|
9328
|
-
ColumnRendererCP.prototype.getAttributeCaption = function (attr, format) {
|
|
9329
|
-
format = format || this.panel.options.attrElementFormat;
|
|
9330
|
-
var model = this.panel.getContext().getModel();
|
|
9331
|
-
return model.getAttributeText(attr, format);
|
|
9332
|
-
};
|
|
9333
9310
|
ColumnRendererCP.prototype.getClassesToAdd = function () {
|
|
9334
9311
|
var result = "";
|
|
9335
9312
|
result += this.columnEnabled ? '' : " ".concat(this.cssPrefix, "-disabled");
|
|
@@ -9560,7 +9537,7 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9560
9537
|
switch (action) {
|
|
9561
9538
|
case ColumnAction.Delete:
|
|
9562
9539
|
var curQuery = this.column.getQuery();
|
|
9563
|
-
curQuery.removeColumn(this.column
|
|
9540
|
+
curQuery.removeColumn(this.column);
|
|
9564
9541
|
curQuery.fireColumnsChangedEvent(external_easyqueryCore_.QueryChangeAction.Delete, this.column);
|
|
9565
9542
|
break;
|
|
9566
9543
|
case ColumnAction.Enable:
|
|
@@ -9754,8 +9731,8 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9754
9731
|
}());
|
|
9755
9732
|
|
|
9756
9733
|
|
|
9757
|
-
;// CONCATENATED MODULE: ./src/widgets/renderers/columnspanel/
|
|
9758
|
-
var
|
|
9734
|
+
;// CONCATENATED MODULE: ./src/widgets/renderers/columnspanel/attr_column_renderer_cp.ts
|
|
9735
|
+
var attr_column_renderer_cp_extends = (undefined && undefined.__extends) || (function () {
|
|
9759
9736
|
var extendStatics = function (d, b) {
|
|
9760
9737
|
extendStatics = Object.setPrototypeOf ||
|
|
9761
9738
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -9775,15 +9752,15 @@ var simple_column_renderer_extends = (undefined && undefined.__extends) || (func
|
|
|
9775
9752
|
|
|
9776
9753
|
|
|
9777
9754
|
|
|
9778
|
-
var
|
|
9779
|
-
|
|
9780
|
-
function
|
|
9755
|
+
var AttrColumnRendererCP = /** @class */ (function (_super) {
|
|
9756
|
+
attr_column_renderer_cp_extends(AttrColumnRendererCP, _super);
|
|
9757
|
+
function AttrColumnRendererCP() {
|
|
9781
9758
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
9782
9759
|
}
|
|
9783
|
-
|
|
9760
|
+
AttrColumnRendererCP.prototype.getClassesToAdd = function () {
|
|
9784
9761
|
return "".concat(_super.prototype.getClassesToAdd.call(this), " ").concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-entattr");
|
|
9785
9762
|
};
|
|
9786
|
-
|
|
9763
|
+
AttrColumnRendererCP.prototype.renderExpressionBlock = function () {
|
|
9787
9764
|
var _this = this;
|
|
9788
9765
|
return (0,lib_public_api/* domel */.uC)("div")
|
|
9789
9766
|
.addClass("".concat(this.cssPrefix, "-expr-block"))
|
|
@@ -9794,9 +9771,14 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
|
|
|
9794
9771
|
.addChildElement(_this.renderBaseExpression()); })
|
|
9795
9772
|
.toDOM();
|
|
9796
9773
|
};
|
|
9797
|
-
|
|
9774
|
+
AttrColumnRendererCP.prototype.getAttribute = function () {
|
|
9775
|
+
var model = this.panel.getContext().getModel();
|
|
9776
|
+
return model.getAttributeByIdSafe(this.column.expr.value);
|
|
9777
|
+
};
|
|
9778
|
+
AttrColumnRendererCP.prototype.renderBaseExpression = function () {
|
|
9798
9779
|
var _this = this;
|
|
9799
|
-
var
|
|
9780
|
+
var baseAttr = this.getAttribute();
|
|
9781
|
+
var attrCaption = this.panel.getContext().getAttributeTitle(baseAttr);
|
|
9800
9782
|
if (this.isEditable()) {
|
|
9801
9783
|
return (0,lib_public_api/* domel */.uC)('a')
|
|
9802
9784
|
.attr('href', 'javascript:void(0)')
|
|
@@ -9819,14 +9801,21 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
|
|
|
9819
9801
|
.title(attrCaption)
|
|
9820
9802
|
.toDOM();
|
|
9821
9803
|
};
|
|
9822
|
-
|
|
9804
|
+
AttrColumnRendererCP.prototype.baseExpressionItemSelectedCallback = function (data, item) {
|
|
9823
9805
|
var attrid = data.id;
|
|
9824
|
-
this.
|
|
9825
|
-
|
|
9806
|
+
var context = this.panel.getContext();
|
|
9807
|
+
var attr = context.getModel().getAttributeById(attrid);
|
|
9808
|
+
this.updateBaseAttr(attr);
|
|
9809
|
+
this.column.caption = context.getDefaultColumnCaption(this.column);
|
|
9826
9810
|
this.fireColumnChanged();
|
|
9827
9811
|
return false;
|
|
9828
9812
|
};
|
|
9829
|
-
|
|
9813
|
+
AttrColumnRendererCP.prototype.updateBaseAttr = function (attr) {
|
|
9814
|
+
this.column.expr.setValue(attr.id, true);
|
|
9815
|
+
this.column.expr.baseAttrId = attr.id;
|
|
9816
|
+
this.column.expr.dataType = attr.dataType;
|
|
9817
|
+
};
|
|
9818
|
+
AttrColumnRendererCP.prototype.getUIS = function () {
|
|
9830
9819
|
var arg = this.column.expr.args[0];
|
|
9831
9820
|
if (arg) {
|
|
9832
9821
|
var model = this.panel.getContext().getModel();
|
|
@@ -9836,7 +9825,7 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
|
|
|
9836
9825
|
return true;
|
|
9837
9826
|
}
|
|
9838
9827
|
};
|
|
9839
|
-
|
|
9828
|
+
AttrColumnRendererCP.prototype.changeTypeHandler = function (ev) {
|
|
9840
9829
|
var _this = this;
|
|
9841
9830
|
this.keepShowingButtons = true;
|
|
9842
9831
|
this.functionMenu.showMenu({
|
|
@@ -9854,7 +9843,7 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
|
|
|
9854
9843
|
}
|
|
9855
9844
|
});
|
|
9856
9845
|
};
|
|
9857
|
-
|
|
9846
|
+
AttrColumnRendererCP.prototype.changeTypeToCustomSql = function () {
|
|
9858
9847
|
var _this = this;
|
|
9859
9848
|
var query = this.column.getQuery();
|
|
9860
9849
|
query.changeColumnType(this.column, external_easyqueryCore_.ExprTag.CustomSql);
|
|
@@ -9867,12 +9856,12 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
|
|
|
9867
9856
|
}, 500);
|
|
9868
9857
|
this.fireColumnChanged();
|
|
9869
9858
|
};
|
|
9870
|
-
|
|
9859
|
+
AttrColumnRendererCP.prototype.changeTypeToAggr = function (funcId) {
|
|
9871
9860
|
var query = this.column.getQuery();
|
|
9872
9861
|
query.changeColumnType(this.column, external_easyqueryCore_.ExprTag.AggregateFunction, { funcId: funcId });
|
|
9873
9862
|
this.fireColumnChanged();
|
|
9874
9863
|
};
|
|
9875
|
-
|
|
9864
|
+
AttrColumnRendererCP.prototype.processExtraButtonMenuItems = function (action, evt) {
|
|
9876
9865
|
if (action === "CUSTOMSQL") {
|
|
9877
9866
|
this.changeTypeToCustomSql();
|
|
9878
9867
|
}
|
|
@@ -9881,7 +9870,7 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
|
|
|
9881
9870
|
}
|
|
9882
9871
|
return true;
|
|
9883
9872
|
};
|
|
9884
|
-
|
|
9873
|
+
AttrColumnRendererCP.prototype.getExtraButtonMenuItems = function () {
|
|
9885
9874
|
var items = [];
|
|
9886
9875
|
var funcs = this.panel.getContext().getModel().getAggrFunctions();
|
|
9887
9876
|
var toInclude = true;
|
|
@@ -9932,12 +9921,12 @@ var SimpleColumnRendererCP = /** @class */ (function (_super) {
|
|
|
9932
9921
|
items: items
|
|
9933
9922
|
}];
|
|
9934
9923
|
};
|
|
9935
|
-
return
|
|
9924
|
+
return AttrColumnRendererCP;
|
|
9936
9925
|
}(ColumnRendererCP));
|
|
9937
9926
|
|
|
9938
9927
|
|
|
9939
|
-
;// CONCATENATED MODULE: ./src/widgets/renderers/columnspanel/
|
|
9940
|
-
var
|
|
9928
|
+
;// CONCATENATED MODULE: ./src/widgets/renderers/columnspanel/aggrfunc_column_renderer_cp.ts
|
|
9929
|
+
var aggrfunc_column_renderer_cp_extends = (undefined && undefined.__extends) || (function () {
|
|
9941
9930
|
var extendStatics = function (d, b) {
|
|
9942
9931
|
extendStatics = Object.setPrototypeOf ||
|
|
9943
9932
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -9960,7 +9949,7 @@ var aggrfunc_column_renderer_extends = (undefined && undefined.__extends) || (fu
|
|
|
9960
9949
|
|
|
9961
9950
|
|
|
9962
9951
|
var AggrFuncColumnRendererCP = /** @class */ (function (_super) {
|
|
9963
|
-
|
|
9952
|
+
aggrfunc_column_renderer_cp_extends(AggrFuncColumnRendererCP, _super);
|
|
9964
9953
|
function AggrFuncColumnRendererCP() {
|
|
9965
9954
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
9966
9955
|
_this.displayFormatParser = new DisplayFormatParser();
|
|
@@ -9975,10 +9964,6 @@ var AggrFuncColumnRendererCP = /** @class */ (function (_super) {
|
|
|
9975
9964
|
.getModel()
|
|
9976
9965
|
.getAttributeByIdSafe(this.column.expr.args[0].value);
|
|
9977
9966
|
};
|
|
9978
|
-
AggrFuncColumnRendererCP.prototype.getDefaultColumnCaption = function () {
|
|
9979
|
-
return this.getDefaultTitleText(this.baseAttr) + ' '
|
|
9980
|
-
+ this.panel.getContext().getModel().getAggrFunctionCaption(this.column.expr.func);
|
|
9981
|
-
};
|
|
9982
9967
|
AggrFuncColumnRendererCP.prototype.renderExpressionBlock = function () {
|
|
9983
9968
|
var _this = this;
|
|
9984
9969
|
var model = this.panel.getContext().getModel();
|
|
@@ -10063,14 +10048,6 @@ var AggrFuncColumnRendererCP = /** @class */ (function (_super) {
|
|
|
10063
10048
|
}
|
|
10064
10049
|
return button;
|
|
10065
10050
|
};
|
|
10066
|
-
AggrFuncColumnRendererCP.prototype.baseExpressionItemSelectedCallback = function (data, item) {
|
|
10067
|
-
var attrid = data.id;
|
|
10068
|
-
//this.column.expr.args[0].id = attrid;
|
|
10069
|
-
this.column.expr.args[0].setValue(attrid, true);
|
|
10070
|
-
this.column.caption = '';
|
|
10071
|
-
this.fireColumnChanged();
|
|
10072
|
-
return false;
|
|
10073
|
-
};
|
|
10074
10051
|
AggrFuncColumnRendererCP.prototype.changeTypeToSimple = function () {
|
|
10075
10052
|
var query = this.column.getQuery();
|
|
10076
10053
|
query.changeColumnType(this.column, external_easyqueryCore_.ExprTag.EntityAttribute);
|
|
@@ -10097,6 +10074,10 @@ var AggrFuncColumnRendererCP = /** @class */ (function (_super) {
|
|
|
10097
10074
|
}
|
|
10098
10075
|
return result;
|
|
10099
10076
|
};
|
|
10077
|
+
AggrFuncColumnRendererCP.prototype.updateBaseAttr = function (attr) {
|
|
10078
|
+
this.column.expr.args[0].setValue(attr.id, true);
|
|
10079
|
+
this.column.expr.baseAttrId = attr.id;
|
|
10080
|
+
};
|
|
10100
10081
|
AggrFuncColumnRendererCP.prototype.changeTypeHandler = function (ev) {
|
|
10101
10082
|
this.changeTypeToSimple();
|
|
10102
10083
|
};
|
|
@@ -10115,11 +10096,11 @@ var AggrFuncColumnRendererCP = /** @class */ (function (_super) {
|
|
|
10115
10096
|
}];
|
|
10116
10097
|
};
|
|
10117
10098
|
return AggrFuncColumnRendererCP;
|
|
10118
|
-
}(
|
|
10099
|
+
}(AttrColumnRendererCP));
|
|
10119
10100
|
|
|
10120
10101
|
|
|
10121
|
-
;// CONCATENATED MODULE: ./src/widgets/renderers/columnspanel/
|
|
10122
|
-
var
|
|
10102
|
+
;// CONCATENATED MODULE: ./src/widgets/renderers/columnspanel/editable_column_renderer_cp.ts
|
|
10103
|
+
var editable_column_renderer_cp_extends = (undefined && undefined.__extends) || (function () {
|
|
10123
10104
|
var extendStatics = function (d, b) {
|
|
10124
10105
|
extendStatics = Object.setPrototypeOf ||
|
|
10125
10106
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -10140,51 +10121,25 @@ var customsql_column_renderer_extends = (undefined && undefined.__extends) || (f
|
|
|
10140
10121
|
|
|
10141
10122
|
|
|
10142
10123
|
|
|
10143
|
-
var
|
|
10144
|
-
|
|
10145
|
-
function
|
|
10124
|
+
var EditableColumnRendererCP = /** @class */ (function (_super) {
|
|
10125
|
+
editable_column_renderer_cp_extends(EditableColumnRendererCP, _super);
|
|
10126
|
+
function EditableColumnRendererCP() {
|
|
10146
10127
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
10147
10128
|
_this.dataTypeMenu = null;
|
|
10148
10129
|
return _this;
|
|
10149
10130
|
}
|
|
10150
|
-
|
|
10131
|
+
EditableColumnRendererCP.prototype.renderEnabledButton = function () {
|
|
10151
10132
|
var elem = _super.prototype.renderEnabledButton.call(this);
|
|
10152
10133
|
var child = elem.children[0];
|
|
10153
10134
|
child.title = public_api/* i18n.getText */.ag.getText('CmdToggleEnableCustom');
|
|
10154
10135
|
return elem;
|
|
10155
10136
|
};
|
|
10156
10137
|
;
|
|
10157
|
-
|
|
10138
|
+
EditableColumnRendererCP.prototype.getClassesToAdd = function () {
|
|
10158
10139
|
return "".concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-entattr") + _super.prototype.getClassesToAdd.call(this);
|
|
10159
10140
|
};
|
|
10160
|
-
|
|
10161
|
-
get: function () {
|
|
10162
|
-
return this.panel.areCustomExpressionsAllowed() ? this.column.enabled : false;
|
|
10163
|
-
},
|
|
10164
|
-
set: function (value) {
|
|
10165
|
-
if (this.panel.areCustomExpressionsAllowed()) {
|
|
10166
|
-
this.column.enabled = value;
|
|
10167
|
-
}
|
|
10168
|
-
else {
|
|
10169
|
-
this.column.enabled = false;
|
|
10170
|
-
}
|
|
10171
|
-
},
|
|
10172
|
-
enumerable: false,
|
|
10173
|
-
configurable: true
|
|
10174
|
-
});
|
|
10175
|
-
CustomSqlColumnRendererCP.prototype.renderColumnTypeButton = function () {
|
|
10176
|
-
var button = _super.prototype.renderColumnTypeButton.call(this);
|
|
10177
|
-
if (button) {
|
|
10178
|
-
button.firstElementChild.classList.add('aggregated');
|
|
10179
|
-
button.firstElementChild.setAttribute('title', public_api/* i18n.getText */.ag.getText('ButtonToSimple'));
|
|
10180
|
-
}
|
|
10181
|
-
return button;
|
|
10182
|
-
};
|
|
10183
|
-
CustomSqlColumnRendererCP.prototype.renderExpressionBlock = function () {
|
|
10141
|
+
EditableColumnRendererCP.prototype.renderExpressionBlock = function () {
|
|
10184
10142
|
var _this = this;
|
|
10185
|
-
if (!this.column.caption || this.column.caption == '') {
|
|
10186
|
-
this.column.caption = this.getDefaultColumnCaption();
|
|
10187
|
-
}
|
|
10188
10143
|
var exprBlock = (0,lib_public_api/* domel */.uC)("div")
|
|
10189
10144
|
.addClass("".concat(this.cssPrefix, "-expr-block"))
|
|
10190
10145
|
.addClass(browser_utils/* browserUtils.getMobileCssClass */.z.getMobileCssClass())
|
|
@@ -10214,7 +10169,7 @@ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
|
|
|
10214
10169
|
)
|
|
10215
10170
|
.addChild('input', function (b) { return b
|
|
10216
10171
|
.hide()
|
|
10217
|
-
.value(_this.
|
|
10172
|
+
.value(_this.getColumnValue())
|
|
10218
10173
|
.on('blur keydown', function (ev) {
|
|
10219
10174
|
var isEndEvent = false;
|
|
10220
10175
|
var save = true;
|
|
@@ -10239,12 +10194,13 @@ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
|
|
|
10239
10194
|
aEl.style.removeProperty('display');
|
|
10240
10195
|
inputEl.style.display = 'none';
|
|
10241
10196
|
}
|
|
10242
|
-
|
|
10243
|
-
|
|
10197
|
+
var colVal = _this.getColumnValue();
|
|
10198
|
+
if (save && colVal !== inputEl.value) {
|
|
10199
|
+
_this.setColumnValue(inputEl.value);
|
|
10244
10200
|
_this.fireColumnChanged();
|
|
10245
10201
|
}
|
|
10246
10202
|
else {
|
|
10247
|
-
inputEl.value =
|
|
10203
|
+
inputEl.value = colVal;
|
|
10248
10204
|
}
|
|
10249
10205
|
_this.element.removeAttribute(lib_public_api/* eqDragManager.DRAG_DISABLED_ATTR */.Yy.DRAG_DISABLED_ATTR);
|
|
10250
10206
|
}
|
|
@@ -10297,31 +10253,30 @@ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
|
|
|
10297
10253
|
}
|
|
10298
10254
|
return exprBlock;
|
|
10299
10255
|
};
|
|
10300
|
-
|
|
10256
|
+
EditableColumnRendererCP.prototype.changeTypeToSimple = function () {
|
|
10301
10257
|
var query = this.column.getQuery();
|
|
10302
10258
|
query.changeColumnType(this.column, external_easyqueryCore_.ExprTag.EntityAttribute);
|
|
10303
10259
|
this.fireColumnChanged();
|
|
10304
10260
|
};
|
|
10305
|
-
|
|
10306
|
-
return
|
|
10261
|
+
EditableColumnRendererCP.prototype.getColumnValue = function () {
|
|
10262
|
+
return '';
|
|
10307
10263
|
};
|
|
10308
|
-
|
|
10309
|
-
return this.column.expr.sql;
|
|
10264
|
+
EditableColumnRendererCP.prototype.setColumnValue = function (value) {
|
|
10310
10265
|
};
|
|
10311
|
-
|
|
10266
|
+
EditableColumnRendererCP.prototype.getUIS = function () {
|
|
10312
10267
|
return true;
|
|
10313
10268
|
};
|
|
10314
|
-
|
|
10269
|
+
EditableColumnRendererCP.prototype.changeTypeHandler = function (ev) {
|
|
10315
10270
|
this.changeTypeToSimple();
|
|
10316
10271
|
};
|
|
10317
|
-
|
|
10272
|
+
EditableColumnRendererCP.prototype.processExtraButtonMenuItems = function (action, evt) {
|
|
10318
10273
|
this.changeTypeToSimple();
|
|
10319
10274
|
return true;
|
|
10320
10275
|
};
|
|
10321
|
-
|
|
10276
|
+
EditableColumnRendererCP.prototype.createFunctionMenu = function () {
|
|
10322
10277
|
// Nothing TO DO
|
|
10323
10278
|
};
|
|
10324
|
-
|
|
10279
|
+
EditableColumnRendererCP.prototype.getExtraButtonMenuItems = function () {
|
|
10325
10280
|
return [{
|
|
10326
10281
|
id: '__group',
|
|
10327
10282
|
text: public_api/* i18n.getText */.ag.getText('ColTypeGroup'),
|
|
@@ -10331,7 +10286,7 @@ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
|
|
|
10331
10286
|
}]
|
|
10332
10287
|
}];
|
|
10333
10288
|
};
|
|
10334
|
-
|
|
10289
|
+
EditableColumnRendererCP.prototype.createDataTypeMenu = function () {
|
|
10335
10290
|
var items = [];
|
|
10336
10291
|
for (var typeItem in public_api/* DataType */.g) {
|
|
10337
10292
|
if (!isNaN(Number(typeItem))) {
|
|
@@ -10354,8 +10309,72 @@ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
|
|
|
10354
10309
|
};
|
|
10355
10310
|
this.dataTypeMenu = new PopupMenu(menuOptions);
|
|
10356
10311
|
};
|
|
10312
|
+
return EditableColumnRendererCP;
|
|
10313
|
+
}(AttrColumnRendererCP));
|
|
10314
|
+
var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
|
|
10315
|
+
editable_column_renderer_cp_extends(CustomSqlColumnRendererCP, _super);
|
|
10316
|
+
function CustomSqlColumnRendererCP() {
|
|
10317
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
10318
|
+
}
|
|
10319
|
+
Object.defineProperty(CustomSqlColumnRendererCP.prototype, "columnEnabled", {
|
|
10320
|
+
get: function () {
|
|
10321
|
+
return this.panel.areCustomExpressionsAllowed() ? this.column.enabled : false;
|
|
10322
|
+
},
|
|
10323
|
+
set: function (value) {
|
|
10324
|
+
if (this.panel.areCustomExpressionsAllowed()) {
|
|
10325
|
+
this.column.enabled = value;
|
|
10326
|
+
}
|
|
10327
|
+
else {
|
|
10328
|
+
this.column.enabled = false;
|
|
10329
|
+
}
|
|
10330
|
+
},
|
|
10331
|
+
enumerable: false,
|
|
10332
|
+
configurable: true
|
|
10333
|
+
});
|
|
10334
|
+
CustomSqlColumnRendererCP.prototype.renderColumnTypeButton = function () {
|
|
10335
|
+
var button = _super.prototype.renderColumnTypeButton.call(this);
|
|
10336
|
+
if (button) {
|
|
10337
|
+
button.firstElementChild.classList.add('aggregated');
|
|
10338
|
+
button.firstElementChild.setAttribute('title', public_api/* i18n.getText */.ag.getText('ButtonToSimple'));
|
|
10339
|
+
}
|
|
10340
|
+
return button;
|
|
10341
|
+
};
|
|
10342
|
+
CustomSqlColumnRendererCP.prototype.getColumnValue = function () {
|
|
10343
|
+
return this.column.expr.sql;
|
|
10344
|
+
};
|
|
10345
|
+
CustomSqlColumnRendererCP.prototype.setColumnValue = function (value) {
|
|
10346
|
+
this.column.expr.sql = value;
|
|
10347
|
+
};
|
|
10348
|
+
CustomSqlColumnRendererCP.prototype.getDefaultValue = function () {
|
|
10349
|
+
return this.column.expr.sql;
|
|
10350
|
+
};
|
|
10357
10351
|
return CustomSqlColumnRendererCP;
|
|
10358
|
-
}(
|
|
10352
|
+
}(EditableColumnRendererCP));
|
|
10353
|
+
|
|
10354
|
+
var ConstColumnRendererCP = /** @class */ (function (_super) {
|
|
10355
|
+
editable_column_renderer_cp_extends(ConstColumnRendererCP, _super);
|
|
10356
|
+
function ConstColumnRendererCP() {
|
|
10357
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
10358
|
+
}
|
|
10359
|
+
ConstColumnRendererCP.prototype.renderColumnTypeButton = function () {
|
|
10360
|
+
var button = _super.prototype.renderColumnTypeButton.call(this);
|
|
10361
|
+
if (button) {
|
|
10362
|
+
button.firstElementChild.classList.add('aggregated');
|
|
10363
|
+
button.firstElementChild.setAttribute('title', public_api/* i18n.getText */.ag.getText('ButtonToSimple'));
|
|
10364
|
+
}
|
|
10365
|
+
return button;
|
|
10366
|
+
};
|
|
10367
|
+
ConstColumnRendererCP.prototype.getColumnValue = function () {
|
|
10368
|
+
return this.column.expr.value;
|
|
10369
|
+
};
|
|
10370
|
+
ConstColumnRendererCP.prototype.setColumnValue = function (value) {
|
|
10371
|
+
this.column.expr.setValue(value);
|
|
10372
|
+
};
|
|
10373
|
+
ConstColumnRendererCP.prototype.getDefaultValue = function () {
|
|
10374
|
+
return this.column.expr.value;
|
|
10375
|
+
};
|
|
10376
|
+
return ConstColumnRendererCP;
|
|
10377
|
+
}(EditableColumnRendererCP));
|
|
10359
10378
|
|
|
10360
10379
|
|
|
10361
10380
|
;// CONCATENATED MODULE: ./src/widgets/columns_panel.ts
|
|
@@ -10604,7 +10623,15 @@ var ColumnsPanel = /** @class */ (function (_super) {
|
|
|
10604
10623
|
var index = query.getColumns().indexOf(column);
|
|
10605
10624
|
var newEl = _this.addColumnElement(column, index);
|
|
10606
10625
|
if (isFocusInside) {
|
|
10607
|
-
newEl.querySelector(
|
|
10626
|
+
var focusElem = newEl.querySelector('a');
|
|
10627
|
+
if (focusElem) {
|
|
10628
|
+
try {
|
|
10629
|
+
focusElem.focus();
|
|
10630
|
+
}
|
|
10631
|
+
catch (_a) {
|
|
10632
|
+
//do nothing
|
|
10633
|
+
}
|
|
10634
|
+
}
|
|
10608
10635
|
}
|
|
10609
10636
|
};
|
|
10610
10637
|
if (Array.isArray(columns)) {
|
|
@@ -10704,7 +10731,13 @@ var ColumnsPanel = /** @class */ (function (_super) {
|
|
|
10704
10731
|
};
|
|
10705
10732
|
ColumnsPanel.prototype.setOptions = function (options) {
|
|
10706
10733
|
public_api/* utils.assignDeep */.P6.assignDeep(this.options, options);
|
|
10707
|
-
this.
|
|
10734
|
+
this.context.options.allowCustomExpressions = options.allowCustomExpressions;
|
|
10735
|
+
if (options.attrElementFormat) {
|
|
10736
|
+
this.context.options.attributeFormat = options.attrElementFormat;
|
|
10737
|
+
}
|
|
10738
|
+
if (options.titleElementFormat) {
|
|
10739
|
+
this.context.options.columnTitleFormat = options.titleElementFormat;
|
|
10740
|
+
}
|
|
10708
10741
|
if (browser_utils/* browserUtils.isMobileMode */.z.isMobileMode()) {
|
|
10709
10742
|
this.options.buttons = ["menu"];
|
|
10710
10743
|
this.options.showHeader = false;
|
|
@@ -10793,66 +10826,36 @@ var ColumnsPanel = /** @class */ (function (_super) {
|
|
|
10793
10826
|
.data("show-buttons", "");
|
|
10794
10827
|
}
|
|
10795
10828
|
};
|
|
10796
|
-
ColumnsPanel.prototype.addNewColumn = function (
|
|
10797
|
-
var _this = this;
|
|
10829
|
+
ColumnsPanel.prototype.addNewColumn = function (attrs, index) {
|
|
10798
10830
|
var model = this.getContext().getModel();
|
|
10799
10831
|
var query = this.getQuery();
|
|
10800
|
-
|
|
10801
|
-
var
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
attribute = model.getAttributeById(attrid);
|
|
10809
|
-
if (!attribute || !attribute.useInResult) {
|
|
10810
|
-
return null;
|
|
10811
|
-
}
|
|
10812
|
-
}
|
|
10813
|
-
else
|
|
10814
|
-
return null;
|
|
10815
|
-
}
|
|
10816
|
-
var column = query.createColumn();
|
|
10817
|
-
column.caption = _this.getDefaultColumnCaption(attribute);
|
|
10818
|
-
column.sorting = external_easyqueryCore_.SortDirection.None;
|
|
10819
|
-
column.sortIndex = -1;
|
|
10820
|
-
column.expr.tag = external_easyqueryCore_.ExprTag.EntityAttribute;
|
|
10821
|
-
column.expr.kind = external_easyqueryCore_.DataKind.Attribute;
|
|
10822
|
-
column.expr.dataType = attribute.dataType;
|
|
10823
|
-
column.expr.setValue(attrid, true);
|
|
10824
|
-
column.params.concat(attribute.params);
|
|
10825
|
-
return column;
|
|
10826
|
-
};
|
|
10827
|
-
var colToAdd, col;
|
|
10828
|
-
if (Array.isArray(attrId)) {
|
|
10829
|
-
colToAdd = [];
|
|
10830
|
-
for (var i = 0; i < attrId.length; i++) {
|
|
10831
|
-
col = getColumnByAttrId(attrId[i]);
|
|
10832
|
+
if (Array.isArray(attrs)) {
|
|
10833
|
+
var col = null;
|
|
10834
|
+
var cols = [];
|
|
10835
|
+
for (var i = 0; i < attrs.length; i++) {
|
|
10836
|
+
col = query.addColumn({
|
|
10837
|
+
attributeId: attrs[i],
|
|
10838
|
+
index: index
|
|
10839
|
+
}, true);
|
|
10832
10840
|
if (col) {
|
|
10833
|
-
|
|
10841
|
+
cols.push(col);
|
|
10834
10842
|
}
|
|
10835
10843
|
}
|
|
10844
|
+
query.fireChangedEvent({
|
|
10845
|
+
part: external_easyqueryCore_.QueryChangePart.Columns,
|
|
10846
|
+
action: external_easyqueryCore_.QueryChangeAction.Add,
|
|
10847
|
+
changee: cols,
|
|
10848
|
+
source: this
|
|
10849
|
+
});
|
|
10850
|
+
return cols;
|
|
10836
10851
|
}
|
|
10837
|
-
else
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
var query = this.getQuery();
|
|
10844
|
-
if (!query) {
|
|
10845
|
-
return;
|
|
10846
|
-
}
|
|
10847
|
-
if (Array.isArray(column))
|
|
10848
|
-
column = this.checkColumnsArray(column);
|
|
10849
|
-
else
|
|
10850
|
-
column = this.checkColumn(column);
|
|
10851
|
-
if (!column || (Array.isArray(column) && column.length == 0)) {
|
|
10852
|
-
return;
|
|
10852
|
+
else {
|
|
10853
|
+
var col = query.addColumn({
|
|
10854
|
+
attributeId: attrs,
|
|
10855
|
+
index: index
|
|
10856
|
+
});
|
|
10857
|
+
return col;
|
|
10853
10858
|
}
|
|
10854
|
-
query.addColumnObj(column, index, self);
|
|
10855
|
-
query.fireColumnsChangedEvent(external_easyqueryCore_.QueryChangeAction.Add, column);
|
|
10856
10859
|
};
|
|
10857
10860
|
//adds one column to the panel on the specified position
|
|
10858
10861
|
ColumnsPanel.prototype.addColumnElement = function (column, index) {
|
|
@@ -10902,23 +10905,19 @@ var ColumnsPanel = /** @class */ (function (_super) {
|
|
|
10902
10905
|
}
|
|
10903
10906
|
return col;
|
|
10904
10907
|
};
|
|
10905
|
-
ColumnsPanel.prototype.getDefaultColumnCaption = function (attr) {
|
|
10906
|
-
var format = this.options.titleElementFormat || this.options.attrElementFormat;
|
|
10907
|
-
var model = this.getContext().getModel();
|
|
10908
|
-
return model.getAttributeText(attr, format);
|
|
10909
|
-
};
|
|
10910
10908
|
ColumnsPanel.prototype.getColumnsBlock = function () {
|
|
10911
10909
|
return this.columnsBlock;
|
|
10912
10910
|
};
|
|
10913
10911
|
ColumnsPanel.prototype.getColumnRenderer = function (column, slot) {
|
|
10914
10912
|
switch (column.expr.tag) {
|
|
10913
|
+
case external_easyqueryCore_.ExprTag.Constant:
|
|
10914
|
+
return new ConstColumnRendererCP(this, column, slot);
|
|
10915
10915
|
case external_easyqueryCore_.ExprTag.AggregateFunction:
|
|
10916
10916
|
return new AggrFuncColumnRendererCP(this, column, slot);
|
|
10917
10917
|
case external_easyqueryCore_.ExprTag.CustomSql:
|
|
10918
10918
|
return new CustomSqlColumnRendererCP(this, column, slot);
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
return new SimpleColumnRendererCP(this, column, slot);
|
|
10919
|
+
default:
|
|
10920
|
+
return new AttrColumnRendererCP(this, column, slot);
|
|
10922
10921
|
}
|
|
10923
10922
|
return null;
|
|
10924
10923
|
};
|
|
@@ -11127,7 +11126,6 @@ var ColumnRendererCB = /** @class */ (function () {
|
|
|
11127
11126
|
});
|
|
11128
11127
|
ColumnRendererCB.prototype.render = function () {
|
|
11129
11128
|
var _this = this;
|
|
11130
|
-
this.baseAttr = this.getAttribute();
|
|
11131
11129
|
var builder = (0,lib_public_api/* domel */.uC)('div');
|
|
11132
11130
|
builder.data('id', this.column.id);
|
|
11133
11131
|
if (this.element) {
|
|
@@ -11184,10 +11182,6 @@ var ColumnRendererCB = /** @class */ (function () {
|
|
|
11184
11182
|
ColumnRendererCB.prototype.refresh = function () {
|
|
11185
11183
|
this.render();
|
|
11186
11184
|
};
|
|
11187
|
-
ColumnRendererCB.prototype.getAttribute = function () {
|
|
11188
|
-
var model = this.bar.getContext().getModel();
|
|
11189
|
-
return model.getAttributeByIdSafe(this.column.expr.value);
|
|
11190
|
-
};
|
|
11191
11185
|
ColumnRendererCB.prototype.isEditable = function () {
|
|
11192
11186
|
return this.column.enabled && !this.column.isReadOnly();
|
|
11193
11187
|
};
|
|
@@ -11202,19 +11196,13 @@ var ColumnRendererCB = /** @class */ (function () {
|
|
|
11202
11196
|
};
|
|
11203
11197
|
ColumnRendererCB.prototype.renderCaptionBlock = function () {
|
|
11204
11198
|
var _this = this;
|
|
11205
|
-
|
|
11206
|
-
this.column.caption = this.getDefaultCaption();
|
|
11207
|
-
}
|
|
11208
|
-
var model = this.column.getModel();
|
|
11209
|
-
var caption = this.baseAttr !== model.nullAttribute
|
|
11210
|
-
? this.column.caption
|
|
11211
|
-
: model.getAttributeText(model.nullAttribute, '{attr}');
|
|
11199
|
+
var caption = this.column.caption;
|
|
11212
11200
|
if (!this.isEditable()) {
|
|
11213
11201
|
return (0,lib_public_api/* domel */.uC)('div')
|
|
11214
11202
|
.addClass("".concat(this.cssPrefix, "-colelement"), "".concat(this.cssPrefix, "-captionelement"))
|
|
11215
11203
|
.addClass(browser_utils/* browserUtils.getMobileCssClass */.z.getMobileCssClass())
|
|
11216
11204
|
.addChild('div', function (b) { return b
|
|
11217
|
-
.title(
|
|
11205
|
+
.title(caption)
|
|
11218
11206
|
.text(caption)
|
|
11219
11207
|
.attr('tabIndex', '0'); })
|
|
11220
11208
|
.toDOM();
|
|
@@ -11387,7 +11375,7 @@ var ColumnRendererCB = /** @class */ (function () {
|
|
|
11387
11375
|
ColumnRendererCB.prototype.buttonDeleteClickHandler = function (ev) {
|
|
11388
11376
|
ev.stopPropagation();
|
|
11389
11377
|
var query = this.bar.getQuery();
|
|
11390
|
-
query.removeColumn(this.column
|
|
11378
|
+
query.removeColumn(this.column);
|
|
11391
11379
|
query.fireColumnsChangedEvent(external_easyqueryCore_.QueryChangeAction.Delete, this.column);
|
|
11392
11380
|
return false;
|
|
11393
11381
|
};
|
|
@@ -11406,14 +11394,6 @@ var ColumnRendererCB = /** @class */ (function () {
|
|
|
11406
11394
|
} })
|
|
11407
11395
|
.toDOM();
|
|
11408
11396
|
};
|
|
11409
|
-
ColumnRendererCB.prototype.getDefaultCaption = function () {
|
|
11410
|
-
return this.getDefaultTitleText(this.baseAttr);
|
|
11411
|
-
};
|
|
11412
|
-
ColumnRendererCB.prototype.getDefaultTitleText = function (attr) {
|
|
11413
|
-
var format = this.bar.options.titleElementFormat || this.bar.options.attrElementFormat;
|
|
11414
|
-
var model = this.bar.getContext().getModel();
|
|
11415
|
-
return model.getAttributeText(attr, format);
|
|
11416
|
-
};
|
|
11417
11397
|
ColumnRendererCB.prototype.getClassesToAdd = function () {
|
|
11418
11398
|
var result = "";
|
|
11419
11399
|
result += this.column.enabled ? '' : " ".concat(this.cssPrefix, "-disabled");
|
|
@@ -11652,8 +11632,8 @@ var ColumnRendererCB = /** @class */ (function () {
|
|
|
11652
11632
|
}());
|
|
11653
11633
|
|
|
11654
11634
|
|
|
11655
|
-
;// CONCATENATED MODULE: ./src/widgets/renderers/columnsbar/
|
|
11656
|
-
var
|
|
11635
|
+
;// CONCATENATED MODULE: ./src/widgets/renderers/columnsbar/attr_column_renderer_cb.ts
|
|
11636
|
+
var attr_column_renderer_cb_extends = (undefined && undefined.__extends) || (function () {
|
|
11657
11637
|
var extendStatics = function (d, b) {
|
|
11658
11638
|
extendStatics = Object.setPrototypeOf ||
|
|
11659
11639
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -11671,23 +11651,29 @@ var columnsbar_simple_column_renderer_extends = (undefined && undefined.__extend
|
|
|
11671
11651
|
|
|
11672
11652
|
|
|
11673
11653
|
|
|
11674
|
-
var
|
|
11675
|
-
|
|
11676
|
-
function
|
|
11654
|
+
var AttrColumnRendererCB = /** @class */ (function (_super) {
|
|
11655
|
+
attr_column_renderer_cb_extends(AttrColumnRendererCB, _super);
|
|
11656
|
+
function AttrColumnRendererCB() {
|
|
11677
11657
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
11678
11658
|
}
|
|
11679
|
-
|
|
11659
|
+
AttrColumnRendererCB.prototype.getClassesToAdd = function () {
|
|
11680
11660
|
return "".concat(_super.prototype.getClassesToAdd.call(this), " ").concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-entattr");
|
|
11681
11661
|
};
|
|
11682
|
-
|
|
11662
|
+
AttrColumnRendererCB.prototype.baseExpressionItemSelectedCallback = function (data, item) {
|
|
11683
11663
|
var attrid = data.id;
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
this.
|
|
11687
|
-
this.
|
|
11664
|
+
var context = this.bar.getContext();
|
|
11665
|
+
var attr = context.getModel().getAttributeById(attrid);
|
|
11666
|
+
this.updateBaseAttr(attr);
|
|
11667
|
+
this.column.caption = context.getDefaultColumnCaption(this.column);
|
|
11688
11668
|
this.fireColumnChanged();
|
|
11669
|
+
return false;
|
|
11670
|
+
};
|
|
11671
|
+
AttrColumnRendererCB.prototype.updateBaseAttr = function (attr) {
|
|
11672
|
+
this.column.expr.setValue(attr.id, true);
|
|
11673
|
+
this.column.expr.baseAttrId = attr.id;
|
|
11674
|
+
this.column.expr.dataType = attr.dataType;
|
|
11689
11675
|
};
|
|
11690
|
-
|
|
11676
|
+
AttrColumnRendererCB.prototype.getUIS = function () {
|
|
11691
11677
|
var arg = this.column.expr.args[0];
|
|
11692
11678
|
if (arg) {
|
|
11693
11679
|
var model = this.bar.getContext().getModel();
|
|
@@ -11697,17 +11683,17 @@ var SimpleColumnRendererCB = /** @class */ (function (_super) {
|
|
|
11697
11683
|
return true;
|
|
11698
11684
|
}
|
|
11699
11685
|
};
|
|
11700
|
-
|
|
11686
|
+
AttrColumnRendererCB.prototype.changeTypeToCustomSql = function () {
|
|
11701
11687
|
var query = this.column.getQuery();
|
|
11702
11688
|
query.changeColumnType(this.column, external_easyqueryCore_.ExprTag.CustomSql);
|
|
11703
11689
|
this.fireColumnChanged();
|
|
11704
11690
|
};
|
|
11705
|
-
|
|
11691
|
+
AttrColumnRendererCB.prototype.changeTypeToAggr = function (funcId) {
|
|
11706
11692
|
var query = this.column.getQuery();
|
|
11707
11693
|
query.changeColumnType(this.column, external_easyqueryCore_.ExprTag.AggregateFunction, { funcId: funcId });
|
|
11708
11694
|
this.fireColumnChanged();
|
|
11709
11695
|
};
|
|
11710
|
-
|
|
11696
|
+
AttrColumnRendererCB.prototype.changeColumnTypeHandler = function (ev) {
|
|
11711
11697
|
var _this = this;
|
|
11712
11698
|
this.functionMenu.showMenu({
|
|
11713
11699
|
anchor: ev.target,
|
|
@@ -11729,12 +11715,12 @@ var SimpleColumnRendererCB = /** @class */ (function (_super) {
|
|
|
11729
11715
|
}
|
|
11730
11716
|
});
|
|
11731
11717
|
};
|
|
11732
|
-
return
|
|
11718
|
+
return AttrColumnRendererCB;
|
|
11733
11719
|
}(ColumnRendererCB));
|
|
11734
11720
|
|
|
11735
11721
|
|
|
11736
|
-
;// CONCATENATED MODULE: ./src/widgets/renderers/columnsbar/
|
|
11737
|
-
var
|
|
11722
|
+
;// CONCATENATED MODULE: ./src/widgets/renderers/columnsbar/aggrfunc_column_renderer_cb.ts
|
|
11723
|
+
var aggrfunc_column_renderer_cb_extends = (undefined && undefined.__extends) || (function () {
|
|
11738
11724
|
var extendStatics = function (d, b) {
|
|
11739
11725
|
extendStatics = Object.setPrototypeOf ||
|
|
11740
11726
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -11753,23 +11739,13 @@ var columnsbar_aggrfunc_column_renderer_extends = (undefined && undefined.__exte
|
|
|
11753
11739
|
|
|
11754
11740
|
|
|
11755
11741
|
var AggrFuncColumnRendererCB = /** @class */ (function (_super) {
|
|
11756
|
-
|
|
11742
|
+
aggrfunc_column_renderer_cb_extends(AggrFuncColumnRendererCB, _super);
|
|
11757
11743
|
function AggrFuncColumnRendererCB() {
|
|
11758
11744
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
11759
11745
|
}
|
|
11760
11746
|
AggrFuncColumnRendererCB.prototype.getClassesToAdd = function () {
|
|
11761
11747
|
return "".concat(_super.prototype.getClassesToAdd.call(this), " ").concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-aggr");
|
|
11762
11748
|
};
|
|
11763
|
-
AggrFuncColumnRendererCB.prototype.getAttribute = function () {
|
|
11764
|
-
return this.bar
|
|
11765
|
-
.getContext()
|
|
11766
|
-
.getModel()
|
|
11767
|
-
.getAttributeByIdSafe(this.column.expr.args[0].value);
|
|
11768
|
-
};
|
|
11769
|
-
AggrFuncColumnRendererCB.prototype.getDefaultCaption = function () {
|
|
11770
|
-
return this.getDefaultTitleText(this.baseAttr) + ' '
|
|
11771
|
-
+ this.bar.getContext().getModel().getAggrFunctionCaption(this.column.expr.func);
|
|
11772
|
-
};
|
|
11773
11749
|
AggrFuncColumnRendererCB.prototype.renderColumnTypeButton = function () {
|
|
11774
11750
|
var button = _super.prototype.renderColumnTypeButton.call(this);
|
|
11775
11751
|
if (button) {
|
|
@@ -11778,12 +11754,9 @@ var AggrFuncColumnRendererCB = /** @class */ (function (_super) {
|
|
|
11778
11754
|
}
|
|
11779
11755
|
return button;
|
|
11780
11756
|
};
|
|
11781
|
-
AggrFuncColumnRendererCB.prototype.
|
|
11782
|
-
|
|
11783
|
-
|
|
11784
|
-
this.column.expr.args[0].setValue(attrid, true);
|
|
11785
|
-
this.column.caption = '';
|
|
11786
|
-
this.fireColumnChanged();
|
|
11757
|
+
AggrFuncColumnRendererCB.prototype.updateBaseAttr = function (attr) {
|
|
11758
|
+
this.column.expr.args[0].setValue(attr.id, true);
|
|
11759
|
+
this.column.expr.baseAttrId = attr.id;
|
|
11787
11760
|
};
|
|
11788
11761
|
AggrFuncColumnRendererCB.prototype.changeTypeToSimple = function () {
|
|
11789
11762
|
var query = this.column.getQuery();
|
|
@@ -11794,7 +11767,110 @@ var AggrFuncColumnRendererCB = /** @class */ (function (_super) {
|
|
|
11794
11767
|
this.changeTypeToSimple();
|
|
11795
11768
|
};
|
|
11796
11769
|
return AggrFuncColumnRendererCB;
|
|
11797
|
-
}(
|
|
11770
|
+
}(AttrColumnRendererCB));
|
|
11771
|
+
|
|
11772
|
+
|
|
11773
|
+
;// CONCATENATED MODULE: ./src/widgets/renderers/columnsbar/editable_column_renderer_cb.ts
|
|
11774
|
+
var editable_column_renderer_cb_extends = (undefined && undefined.__extends) || (function () {
|
|
11775
|
+
var extendStatics = function (d, b) {
|
|
11776
|
+
extendStatics = Object.setPrototypeOf ||
|
|
11777
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
11778
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
11779
|
+
return extendStatics(d, b);
|
|
11780
|
+
};
|
|
11781
|
+
return function (d, b) {
|
|
11782
|
+
if (typeof b !== "function" && b !== null)
|
|
11783
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11784
|
+
extendStatics(d, b);
|
|
11785
|
+
function __() { this.constructor = d; }
|
|
11786
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
11787
|
+
};
|
|
11788
|
+
})();
|
|
11789
|
+
|
|
11790
|
+
|
|
11791
|
+
var EditableColumnRendererCB = /** @class */ (function (_super) {
|
|
11792
|
+
editable_column_renderer_cb_extends(EditableColumnRendererCB, _super);
|
|
11793
|
+
function EditableColumnRendererCB() {
|
|
11794
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
11795
|
+
}
|
|
11796
|
+
EditableColumnRendererCB.prototype.getClassesToAdd = function () {
|
|
11797
|
+
return "".concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-entattr") + _super.prototype.getClassesToAdd.call(this);
|
|
11798
|
+
};
|
|
11799
|
+
EditableColumnRendererCB.prototype.renderColumnTypeButton = function () {
|
|
11800
|
+
var button = _super.prototype.renderColumnTypeButton.call(this);
|
|
11801
|
+
if (button) {
|
|
11802
|
+
button.classList.add('aggregated');
|
|
11803
|
+
button.title = external_easyqueryCore_.i18n.getText('ButtonToSimple');
|
|
11804
|
+
}
|
|
11805
|
+
return button;
|
|
11806
|
+
};
|
|
11807
|
+
EditableColumnRendererCB.prototype.changeTypeToSimple = function () {
|
|
11808
|
+
var query = this.column.getQuery();
|
|
11809
|
+
query.changeColumnType(this.column, external_easyqueryCore_.ExprTag.EntityAttribute);
|
|
11810
|
+
this.fireColumnChanged();
|
|
11811
|
+
};
|
|
11812
|
+
EditableColumnRendererCB.prototype.getColumnValue = function () {
|
|
11813
|
+
return '';
|
|
11814
|
+
};
|
|
11815
|
+
EditableColumnRendererCB.prototype.setColumnValue = function (value) {
|
|
11816
|
+
};
|
|
11817
|
+
EditableColumnRendererCB.prototype.getUIS = function () {
|
|
11818
|
+
return true;
|
|
11819
|
+
};
|
|
11820
|
+
EditableColumnRendererCB.prototype.changeColumnTypeHandler = function (ev) {
|
|
11821
|
+
this.changeTypeToSimple();
|
|
11822
|
+
};
|
|
11823
|
+
return EditableColumnRendererCB;
|
|
11824
|
+
}(ColumnRendererCB));
|
|
11825
|
+
|
|
11826
|
+
var CustomSqlColumnRendererCB = /** @class */ (function (_super) {
|
|
11827
|
+
editable_column_renderer_cb_extends(CustomSqlColumnRendererCB, _super);
|
|
11828
|
+
function CustomSqlColumnRendererCB() {
|
|
11829
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
11830
|
+
}
|
|
11831
|
+
Object.defineProperty(CustomSqlColumnRendererCB.prototype, "columnEnabled", {
|
|
11832
|
+
get: function () {
|
|
11833
|
+
return this.bar.areCustomExpressionsAllowed() ? this.column.enabled : false;
|
|
11834
|
+
},
|
|
11835
|
+
set: function (value) {
|
|
11836
|
+
if (this.bar.areCustomExpressionsAllowed()) {
|
|
11837
|
+
this.column.enabled = value;
|
|
11838
|
+
}
|
|
11839
|
+
else {
|
|
11840
|
+
this.column.enabled = false;
|
|
11841
|
+
}
|
|
11842
|
+
},
|
|
11843
|
+
enumerable: false,
|
|
11844
|
+
configurable: true
|
|
11845
|
+
});
|
|
11846
|
+
CustomSqlColumnRendererCB.prototype.getColumnValue = function () {
|
|
11847
|
+
return this.column.expr.sql;
|
|
11848
|
+
};
|
|
11849
|
+
CustomSqlColumnRendererCB.prototype.setColumnValue = function (value) {
|
|
11850
|
+
this.column.expr.sql = value;
|
|
11851
|
+
};
|
|
11852
|
+
CustomSqlColumnRendererCB.prototype.getDefaultValue = function () {
|
|
11853
|
+
return this.column.expr.sql;
|
|
11854
|
+
};
|
|
11855
|
+
return CustomSqlColumnRendererCB;
|
|
11856
|
+
}(EditableColumnRendererCB));
|
|
11857
|
+
|
|
11858
|
+
var ConstColumnRendererCB = /** @class */ (function (_super) {
|
|
11859
|
+
editable_column_renderer_cb_extends(ConstColumnRendererCB, _super);
|
|
11860
|
+
function ConstColumnRendererCB() {
|
|
11861
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
11862
|
+
}
|
|
11863
|
+
ConstColumnRendererCB.prototype.getColumnValue = function () {
|
|
11864
|
+
return this.column.expr.value;
|
|
11865
|
+
};
|
|
11866
|
+
ConstColumnRendererCB.prototype.setColumnValue = function (value) {
|
|
11867
|
+
this.column.expr.setValue(value);
|
|
11868
|
+
};
|
|
11869
|
+
ConstColumnRendererCB.prototype.getDefaultValue = function () {
|
|
11870
|
+
return this.column.expr.value;
|
|
11871
|
+
};
|
|
11872
|
+
return ConstColumnRendererCB;
|
|
11873
|
+
}(EditableColumnRendererCB));
|
|
11798
11874
|
|
|
11799
11875
|
|
|
11800
11876
|
;// CONCATENATED MODULE: ./src/widgets/columns_bar.ts
|
|
@@ -11822,6 +11898,7 @@ var columns_bar_extends = (undefined && undefined.__extends) || (function () {
|
|
|
11822
11898
|
|
|
11823
11899
|
|
|
11824
11900
|
|
|
11901
|
+
|
|
11825
11902
|
var ColumnsBar = /** @class */ (function (_super) {
|
|
11826
11903
|
columns_bar_extends(ColumnsBar, _super);
|
|
11827
11904
|
function ColumnsBar(slot, customQuery) {
|
|
@@ -11836,8 +11913,6 @@ var ColumnsBar = /** @class */ (function (_super) {
|
|
|
11836
11913
|
allowDuplicates: true,
|
|
11837
11914
|
allowCustomExpressions: false,
|
|
11838
11915
|
allowSorting: true,
|
|
11839
|
-
attrElementFormat: '{entity} {attr}',
|
|
11840
|
-
titleElementFormat: null,
|
|
11841
11916
|
alwaysShowButtons: false,
|
|
11842
11917
|
accentActiveColumn: true,
|
|
11843
11918
|
allowDragDrop: true,
|
|
@@ -11890,6 +11965,12 @@ var ColumnsBar = /** @class */ (function (_super) {
|
|
|
11890
11965
|
var _this = this;
|
|
11891
11966
|
_super.prototype.init.call(this, context, options);
|
|
11892
11967
|
this.setOptions(options);
|
|
11968
|
+
if (options.attrElementFormat) {
|
|
11969
|
+
this.context.options.attributeFormat = options.attrElementFormat;
|
|
11970
|
+
}
|
|
11971
|
+
if (options.titleElementFormat) {
|
|
11972
|
+
this.context.options.columnTitleFormat = options.titleElementFormat;
|
|
11973
|
+
}
|
|
11893
11974
|
this.detachQueryObserver();
|
|
11894
11975
|
this.attachQueryObserver();
|
|
11895
11976
|
lib_public_api/* eqDragManager.removeDropContainer */.Yy.removeDropContainer(this.slot);
|
|
@@ -12020,6 +12101,7 @@ var ColumnsBar = /** @class */ (function (_super) {
|
|
|
12020
12101
|
};
|
|
12021
12102
|
ColumnsBar.prototype.setOptions = function (options) {
|
|
12022
12103
|
this.options = public_api/* utils.assignDeep */.P6.assignDeep(this.options, options);
|
|
12104
|
+
this.getContext().options.allowCustomExpressions = options.allowCustomExpressions;
|
|
12023
12105
|
};
|
|
12024
12106
|
ColumnsBar.prototype.showLandingSlot = function (pageX, pageY) {
|
|
12025
12107
|
var elements = this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix, "-row]"));
|
|
@@ -12271,64 +12353,41 @@ var ColumnsBar = /** @class */ (function (_super) {
|
|
|
12271
12353
|
};
|
|
12272
12354
|
ColumnsBar.prototype.getColumnRenderer = function (column, slot) {
|
|
12273
12355
|
switch (column.expr.tag) {
|
|
12356
|
+
case external_easyqueryCore_.ExprTag.Constant:
|
|
12357
|
+
return new ConstColumnRendererCB(this, column, slot);
|
|
12274
12358
|
case external_easyqueryCore_.ExprTag.AggregateFunction:
|
|
12275
12359
|
return new AggrFuncColumnRendererCB(this, column, slot);
|
|
12276
12360
|
case external_easyqueryCore_.ExprTag.CustomSql:
|
|
12277
|
-
|
|
12278
|
-
|
|
12279
|
-
|
|
12280
|
-
return new SimpleColumnRendererCB(this, column, slot);
|
|
12361
|
+
return new CustomSqlColumnRendererCB(this, column, slot);
|
|
12362
|
+
default:
|
|
12363
|
+
return new AttrColumnRendererCB(this, column, slot);
|
|
12281
12364
|
}
|
|
12282
12365
|
return null;
|
|
12283
12366
|
};
|
|
12284
|
-
ColumnsBar.prototype.addNewColumn = function (
|
|
12285
|
-
var _this = this;
|
|
12367
|
+
ColumnsBar.prototype.addNewColumn = function (attrs, index) {
|
|
12286
12368
|
var model = this.getContext().getModel();
|
|
12287
12369
|
var query = this.getQuery();
|
|
12288
|
-
|
|
12289
|
-
var
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12295
|
-
|
|
12296
|
-
attribute = model.getAttributeById(attrid);
|
|
12297
|
-
if (!attribute || !attribute.useInResult) {
|
|
12298
|
-
return null;
|
|
12299
|
-
}
|
|
12300
|
-
}
|
|
12301
|
-
else
|
|
12302
|
-
return null;
|
|
12303
|
-
}
|
|
12304
|
-
var column = query.createColumn();
|
|
12305
|
-
column.caption = _this.getDefaultColumnCaption(attribute);
|
|
12306
|
-
column.sorting = external_easyqueryCore_.SortDirection.None;
|
|
12307
|
-
column.sortIndex = -1;
|
|
12308
|
-
column.expr.tag = external_easyqueryCore_.ExprTag.EntityAttribute;
|
|
12309
|
-
column.expr.kind = external_easyqueryCore_.DataKind.Attribute;
|
|
12310
|
-
column.expr.dataType = attribute.dataType;
|
|
12311
|
-
column.expr.setValue(attrid, true);
|
|
12312
|
-
column.params.concat(attribute.params);
|
|
12313
|
-
return column;
|
|
12314
|
-
};
|
|
12315
|
-
if (!this.getQuery()) {
|
|
12316
|
-
return;
|
|
12317
|
-
}
|
|
12318
|
-
var colToAdd, col;
|
|
12319
|
-
if (Array.isArray(attrId)) {
|
|
12320
|
-
colToAdd = [];
|
|
12321
|
-
for (var i = 0; i < attrId.length; i++) {
|
|
12322
|
-
col = getColumnByAttrId(attrId[i]);
|
|
12370
|
+
if (Array.isArray(attrs)) {
|
|
12371
|
+
var col = null;
|
|
12372
|
+
var cols = [];
|
|
12373
|
+
for (var i = 0; i < attrs.length; i++) {
|
|
12374
|
+
col = query.addColumn({
|
|
12375
|
+
attributeId: attrs[i],
|
|
12376
|
+
index: index
|
|
12377
|
+
}, true);
|
|
12323
12378
|
if (col) {
|
|
12324
|
-
|
|
12379
|
+
cols.push(col);
|
|
12325
12380
|
}
|
|
12326
12381
|
}
|
|
12382
|
+
return cols;
|
|
12383
|
+
}
|
|
12384
|
+
else {
|
|
12385
|
+
var col = query.addColumn({
|
|
12386
|
+
attributeId: attrs,
|
|
12387
|
+
index: index
|
|
12388
|
+
});
|
|
12389
|
+
return col;
|
|
12327
12390
|
}
|
|
12328
|
-
else
|
|
12329
|
-
colToAdd = getColumnByAttrId(attrId);
|
|
12330
|
-
this.addColumn(colToAdd, index);
|
|
12331
|
-
return colToAdd;
|
|
12332
12391
|
};
|
|
12333
12392
|
ColumnsBar.prototype.toggleColumnPicked = function (column) {
|
|
12334
12393
|
var el;
|
|
@@ -12353,25 +12412,6 @@ var ColumnsBar = /** @class */ (function (_super) {
|
|
|
12353
12412
|
.data("show-buttons", "");
|
|
12354
12413
|
}
|
|
12355
12414
|
};
|
|
12356
|
-
ColumnsBar.prototype.addColumn = function (column, index) {
|
|
12357
|
-
var query = this.getQuery();
|
|
12358
|
-
if (!query) {
|
|
12359
|
-
return;
|
|
12360
|
-
}
|
|
12361
|
-
if (Array.isArray(column))
|
|
12362
|
-
column = this.checkColumnsArray(column);
|
|
12363
|
-
else
|
|
12364
|
-
column = this.checkColumn(column);
|
|
12365
|
-
if (!column || (Array.isArray(column) && column.length == 0)) {
|
|
12366
|
-
return;
|
|
12367
|
-
}
|
|
12368
|
-
query.addColumnObj(column, index, self);
|
|
12369
|
-
query.fireChangedEvent({
|
|
12370
|
-
part: external_easyqueryCore_.QueryChangePart.Columns,
|
|
12371
|
-
action: external_easyqueryCore_.QueryChangeAction.Add,
|
|
12372
|
-
changee: column
|
|
12373
|
-
});
|
|
12374
|
-
};
|
|
12375
12415
|
//adds one column to the bar on the specified position
|
|
12376
12416
|
ColumnsBar.prototype.addColumnElement = function (column, index) {
|
|
12377
12417
|
var rows = this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix, "-row]"));
|
|
@@ -12414,11 +12454,6 @@ var ColumnsBar = /** @class */ (function (_super) {
|
|
|
12414
12454
|
}
|
|
12415
12455
|
return col;
|
|
12416
12456
|
};
|
|
12417
|
-
ColumnsBar.prototype.getDefaultColumnCaption = function (attr) {
|
|
12418
|
-
var format = this.options.titleElementFormat || this.options.attrElementFormat;
|
|
12419
|
-
var model = this.getContext().getModel();
|
|
12420
|
-
return model.getAttributeText(attr, format);
|
|
12421
|
-
};
|
|
12422
12457
|
ColumnsBar.prototype.getColumnsBlock = function () {
|
|
12423
12458
|
return this.columnsBlock;
|
|
12424
12459
|
};
|
|
@@ -12520,13 +12555,13 @@ var ColumnsBar = /** @class */ (function (_super) {
|
|
|
12520
12555
|
};
|
|
12521
12556
|
ColumnsBar.prototype.areCustomExpressionsAllowed = function () {
|
|
12522
12557
|
var query = this.getQuery();
|
|
12523
|
-
return query.isEx() && this.options.allowCustomExpressions;
|
|
12558
|
+
return query.isEx() && this.getContext().options.allowCustomExpressions;
|
|
12524
12559
|
};
|
|
12525
12560
|
ColumnsBar.globalCounter = 0;
|
|
12526
12561
|
return ColumnsBar;
|
|
12527
12562
|
}(external_easyqueryCore_.Widget));
|
|
12528
12563
|
|
|
12529
|
-
;// CONCATENATED MODULE: ./src/widgets/renderers/sortingbar/
|
|
12564
|
+
;// CONCATENATED MODULE: ./src/widgets/renderers/sortingbar/column_renderer_sb.ts
|
|
12530
12565
|
|
|
12531
12566
|
|
|
12532
12567
|
|
|
@@ -12550,7 +12585,6 @@ var ColumnRendererSB = /** @class */ (function () {
|
|
|
12550
12585
|
});
|
|
12551
12586
|
ColumnRendererSB.prototype.render = function () {
|
|
12552
12587
|
var _this = this;
|
|
12553
|
-
this.baseAttr = this.getAttribute();
|
|
12554
12588
|
var builder = (0,lib_public_api/* domel */.uC)('div');
|
|
12555
12589
|
builder.data('id', this.column.id);
|
|
12556
12590
|
if (this.element) {
|
|
@@ -12601,9 +12635,6 @@ var ColumnRendererSB = /** @class */ (function () {
|
|
|
12601
12635
|
};
|
|
12602
12636
|
ColumnRendererSB.prototype.renderCaptionBlock = function () {
|
|
12603
12637
|
var _this = this;
|
|
12604
|
-
if (!this.column.caption || this.column.caption == '') {
|
|
12605
|
-
this.column.caption = this.getDefaultCaption();
|
|
12606
|
-
}
|
|
12607
12638
|
function getArrow(sd) {
|
|
12608
12639
|
switch (sd) {
|
|
12609
12640
|
case external_easyqueryCore_.SortDirection.Ascending:
|
|
@@ -12673,7 +12704,7 @@ var ColumnRendererSB = /** @class */ (function () {
|
|
|
12673
12704
|
if (data.id == 'None' || data.id == "Ascending" || data.id == "Descending") {
|
|
12674
12705
|
var query = _this.bar.getContext().getQuery();
|
|
12675
12706
|
if (_this.column.isJustSorted() && data.id == 'None') {
|
|
12676
|
-
query.removeColumn(_this.column
|
|
12707
|
+
query.removeColumn(_this.column);
|
|
12677
12708
|
query.fireColumnsChangedEvent(external_easyqueryCore_.QueryChangeAction.Delete, _this.column, true);
|
|
12678
12709
|
}
|
|
12679
12710
|
else {
|
|
@@ -12692,14 +12723,6 @@ var ColumnRendererSB = /** @class */ (function () {
|
|
|
12692
12723
|
});
|
|
12693
12724
|
return false;
|
|
12694
12725
|
};
|
|
12695
|
-
ColumnRendererSB.prototype.getDefaultCaption = function () {
|
|
12696
|
-
return this.getDefaultTitleText(this.baseAttr);
|
|
12697
|
-
};
|
|
12698
|
-
ColumnRendererSB.prototype.getDefaultTitleText = function (attr) {
|
|
12699
|
-
var format = this.bar.options.titleElementFormat || this.bar.options.attrElementFormat;
|
|
12700
|
-
var model = this.bar.getContext().getModel();
|
|
12701
|
-
return model.getAttributeText(attr, format);
|
|
12702
|
-
};
|
|
12703
12726
|
ColumnRendererSB.prototype.getClassesToAdd = function () {
|
|
12704
12727
|
return "".concat(this.cssPrefix, "-row ").concat(this.cssPrefix, "-row-column-entattr");
|
|
12705
12728
|
};
|
|
@@ -12741,8 +12764,6 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12741
12764
|
var _this = _super.call(this, slot) || this;
|
|
12742
12765
|
_this.options = {
|
|
12743
12766
|
showAddRow: true,
|
|
12744
|
-
attrElementFormat: '{entity} {attr}',
|
|
12745
|
-
titleElementFormat: null,
|
|
12746
12767
|
allowDragDrop: true,
|
|
12747
12768
|
menuOptions: {
|
|
12748
12769
|
showSearchBoxAfter: 30,
|
|
@@ -12786,6 +12807,12 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12786
12807
|
var _this = this;
|
|
12787
12808
|
_super.prototype.init.call(this, context, options);
|
|
12788
12809
|
this.setOptions(options);
|
|
12810
|
+
if (options.attrElementFormat) {
|
|
12811
|
+
this.context.options.attributeFormat = options.attrElementFormat;
|
|
12812
|
+
}
|
|
12813
|
+
if (options.titleElementFormat) {
|
|
12814
|
+
this.context.options.columnTitleFormat = options.titleElementFormat;
|
|
12815
|
+
}
|
|
12789
12816
|
this.destroyCore();
|
|
12790
12817
|
this.attachQueryObserver();
|
|
12791
12818
|
lib_public_api/* eqDragManager.removeDropContainer */.Yy.removeDropContainer(this.slot);
|
|
@@ -12938,48 +12965,20 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12938
12965
|
});
|
|
12939
12966
|
};
|
|
12940
12967
|
SortingBar.prototype.addNewColumn = function (attrId) {
|
|
12941
|
-
var _this = this;
|
|
12942
12968
|
var model = this.getModel();
|
|
12943
12969
|
var query = this.getQuery();
|
|
12944
|
-
var
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
}
|
|
12949
|
-
if (!attribute.useInSorting) {
|
|
12950
|
-
if (attribute.lookupAttr) {
|
|
12951
|
-
attrid = attribute.lookupAttr;
|
|
12952
|
-
attribute = model.getAttributeById(attrid);
|
|
12953
|
-
if (!attribute || !attribute.useInSorting) {
|
|
12954
|
-
return null;
|
|
12955
|
-
}
|
|
12956
|
-
}
|
|
12957
|
-
else
|
|
12958
|
-
return null;
|
|
12959
|
-
}
|
|
12960
|
-
var column = query.createColumn(true);
|
|
12961
|
-
column.caption = _this.getDefaultColumnCaption(attribute);
|
|
12962
|
-
column._sorting = external_easyqueryCore_.SortDirection.Ascending;
|
|
12963
|
-
//column.sortIndex = this.getQuery().getColumnSortIndex(column);
|
|
12964
|
-
column.expr.tag = external_easyqueryCore_.ExprTag.EntityAttribute;
|
|
12965
|
-
column.expr.dataType = attribute.dataType;
|
|
12966
|
-
//column.expr.id = attrid;
|
|
12967
|
-
column.expr.setValue(attrid, true);
|
|
12968
|
-
column.params.concat(attribute.params);
|
|
12969
|
-
return column;
|
|
12970
|
-
};
|
|
12971
|
-
if (!this.getQuery()) {
|
|
12972
|
-
return;
|
|
12973
|
-
}
|
|
12974
|
-
var newCol = getColumnByAttrId(attrId);
|
|
12975
|
-
return this.getQuery().addColumn({
|
|
12976
|
-
column: newCol
|
|
12970
|
+
var col = query.addColumn({
|
|
12971
|
+
attributeId: attrId,
|
|
12972
|
+
justsorted: true,
|
|
12973
|
+
sorting: external_easyqueryCore_.SortDirection.Ascending
|
|
12977
12974
|
});
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
12975
|
+
query.fireChangedEvent({
|
|
12976
|
+
part: external_easyqueryCore_.QueryChangePart.SortingColumns,
|
|
12977
|
+
action: external_easyqueryCore_.QueryChangeAction.Add,
|
|
12978
|
+
changee: col,
|
|
12979
|
+
source: this
|
|
12980
|
+
});
|
|
12981
|
+
return col;
|
|
12983
12982
|
};
|
|
12984
12983
|
SortingBar.prototype.renderColumn = function (column, elem) {
|
|
12985
12984
|
var renderer = new ColumnRendererSB(this, column, elem);
|
|
@@ -16701,78 +16700,17 @@ var EasyGridWidget = /** @class */ (function (_super) {
|
|
|
16701
16700
|
}
|
|
16702
16701
|
};
|
|
16703
16702
|
EasyGridWidget.prototype.addNewColumn = function (attrId) {
|
|
16704
|
-
var _this = this;
|
|
16705
|
-
var model = this.getContext().getModel();
|
|
16706
|
-
var query = this.getContext().getQuery();
|
|
16707
|
-
var getColumnByAttrId = function (attrid) {
|
|
16708
|
-
var attribute = model.getAttributeById(attrid);
|
|
16709
|
-
if (!attribute) {
|
|
16710
|
-
return null;
|
|
16711
|
-
}
|
|
16712
|
-
if (!attribute.useInSorting) {
|
|
16713
|
-
if (attribute.lookupAttr) {
|
|
16714
|
-
attrid = attribute.lookupAttr;
|
|
16715
|
-
attribute = model.getAttributeById(attrid);
|
|
16716
|
-
if (!attribute || !attribute.useInSorting) {
|
|
16717
|
-
return null;
|
|
16718
|
-
}
|
|
16719
|
-
}
|
|
16720
|
-
else
|
|
16721
|
-
return null;
|
|
16722
|
-
}
|
|
16723
|
-
var column = query.createColumn();
|
|
16724
|
-
column.caption = _this.getDefaultColumnCaption(attribute);
|
|
16725
|
-
column.sorting = external_easyqueryCore_.SortDirection.None;
|
|
16726
|
-
column.sortIndex = -1;
|
|
16727
|
-
column.expr.tag = external_easyqueryCore_.ExprTag.EntityAttribute;
|
|
16728
|
-
//column.expr.id = attrid;
|
|
16729
|
-
column.expr.setValue(attrid, true);
|
|
16730
|
-
column.params.concat(attribute.params);
|
|
16731
|
-
return column;
|
|
16732
|
-
};
|
|
16733
|
-
if (!this.getContext().getQuery()) {
|
|
16734
|
-
return;
|
|
16735
|
-
}
|
|
16736
|
-
return this.addColumn(getColumnByAttrId(attrId));
|
|
16737
|
-
};
|
|
16738
|
-
EasyGridWidget.prototype.getDefaultColumnCaption = function (attr) {
|
|
16739
|
-
var format = this.options.titleElementFormat || this.options.attrElementFormat;
|
|
16740
16703
|
var model = this.getContext().getModel();
|
|
16741
|
-
return model.getAttributeText(attr, format);
|
|
16742
|
-
};
|
|
16743
|
-
EasyGridWidget.prototype.addColumn = function (column) {
|
|
16744
16704
|
var query = this.getContext().getQuery();
|
|
16745
|
-
|
|
16746
|
-
|
|
16747
|
-
}
|
|
16748
|
-
column = this.checkColumn(column);
|
|
16749
|
-
if (!column) {
|
|
16750
|
-
return;
|
|
16751
|
-
}
|
|
16752
|
-
column = query.addColumn({
|
|
16753
|
-
caption: column.caption,
|
|
16754
|
-
attributeId: column.expr.value,
|
|
16755
|
-
sorting: column.sorting,
|
|
16756
|
-
sortIndex: column.sortIndex
|
|
16705
|
+
var col = query.addColumn({
|
|
16706
|
+
attributeId: attrId
|
|
16757
16707
|
});
|
|
16758
16708
|
query.fireChangedEvent({
|
|
16759
16709
|
part: external_easyqueryCore_.QueryChangePart.Columns,
|
|
16760
16710
|
action: external_easyqueryCore_.QueryChangeAction.Add,
|
|
16761
|
-
changee:
|
|
16711
|
+
changee: col,
|
|
16762
16712
|
source: this
|
|
16763
16713
|
});
|
|
16764
|
-
return column;
|
|
16765
|
-
};
|
|
16766
|
-
EasyGridWidget.prototype.checkColumn = function (col) {
|
|
16767
|
-
var query = this.getContext().getQuery();
|
|
16768
|
-
var columns = query.getColumns();
|
|
16769
|
-
var colJson = JSON.stringify(col.expr.saveToData());
|
|
16770
|
-
for (var i = 0; i < columns.length; i++) {
|
|
16771
|
-
var qcolJson = JSON.stringify(columns[i].expr.saveToData());
|
|
16772
|
-
if (qcolJson === colJson) {
|
|
16773
|
-
return null;
|
|
16774
|
-
}
|
|
16775
|
-
}
|
|
16776
16714
|
return col;
|
|
16777
16715
|
};
|
|
16778
16716
|
return EasyGridWidget;
|
|
@@ -20719,12 +20657,7 @@ var View = /** @class */ (function () {
|
|
|
20719
20657
|
}
|
|
20720
20658
|
// map columnTitleFormat option to widgets that have similar option
|
|
20721
20659
|
if (options.columnTitleFormat) {
|
|
20722
|
-
options.
|
|
20723
|
-
options.widgets.entitiesPanel.columnTitleFormat = options.widgets.entitiesPanel.columnTitleFormat || options.columnTitleFormat;
|
|
20724
|
-
options.widgets.columnsBar = options.widgets.columnsBar || {};
|
|
20725
|
-
options.widgets.columnsBar.titleElementFormat = options.widgets.columnsBar.titleElementFormat || options.columnTitleFormat;
|
|
20726
|
-
options.widgets.columnsPanel = options.widgets.columnsPanel || {};
|
|
20727
|
-
options.widgets.columnsPanel.titleElementFormat = options.widgets.columnsPanel.titleElementFormat || options.columnTitleFormat;
|
|
20660
|
+
this.context.options.columnTitleFormat = options.columnTitleFormat;
|
|
20728
20661
|
}
|
|
20729
20662
|
//to support old paging options (should be removed in the next versions)
|
|
20730
20663
|
options.widgets.easyGrid.paging =
|