@easyquery/ui 7.2.4-beta03 → 7.2.4-rc02
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/assets/css/easyquery.css +5 -2
- package/dist/assets/css/eqview.css +4 -5
- package/dist/browser/eq.community.css.map +1 -1
- package/dist/browser/eq.community.js +437 -197
- 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 +6 -3
- package/dist/browser/eq.core.min.css +1 -1
- package/dist/browser/eq.view.css +5 -6
- package/dist/browser/eq.view.css.map +1 -1
- package/dist/browser/eq.view.min.css +1 -1
- package/dist/bundles/easyquery.ui.js +191 -133
- 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/widgets/columns_bar.js +9 -4
- package/dist/lib/widgets/columns_bar.js.map +1 -1
- package/dist/lib/widgets/columns_panel.js +2 -1
- package/dist/lib/widgets/columns_panel.js.map +1 -1
- package/dist/lib/widgets/manage_drilldown_widget.js +2 -1
- package/dist/lib/widgets/manage_drilldown_widget.js.map +1 -1
- package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js +1 -1
- package/dist/lib/widgets/renderers/columnsbar/column_renderer_cb.js.map +1 -1
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.d.ts +2 -0
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js +22 -12
- package/dist/lib/widgets/renderers/columnspanel/column_renderer_cp.js.map +1 -1
- package/dist/lib/widgets/renderers/columnspanel/customsql_column_renderer.d.ts +0 -1
- package/dist/lib/widgets/renderers/columnspanel/customsql_column_renderer.js +0 -7
- package/dist/lib/widgets/renderers/columnspanel/customsql_column_renderer.js.map +1 -1
- package/dist/lib/widgets/renderers/sortingbar/column_renderer_sp.js +23 -2
- package/dist/lib/widgets/renderers/sortingbar/column_renderer_sp.js.map +1 -1
- package/dist/lib/widgets/sorting_bar.d.ts +7 -4
- package/dist/lib/widgets/sorting_bar.js +135 -108
- package/dist/lib/widgets/sorting_bar.js.map +1 -1
- package/dist/lib/widgets/widget_options.d.ts +2 -0
- package/package.json +4 -4
|
@@ -9008,10 +9008,20 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9008
9008
|
enumerable: false,
|
|
9009
9009
|
configurable: true
|
|
9010
9010
|
});
|
|
9011
|
+
Object.defineProperty(ColumnRendererCP.prototype, "columnEnabled", {
|
|
9012
|
+
get: function () {
|
|
9013
|
+
return this.column.enabled;
|
|
9014
|
+
},
|
|
9015
|
+
set: function (value) {
|
|
9016
|
+
this.column.enabled = value;
|
|
9017
|
+
},
|
|
9018
|
+
enumerable: false,
|
|
9019
|
+
configurable: true
|
|
9020
|
+
});
|
|
9011
9021
|
ColumnRendererCP.prototype.render = function () {
|
|
9012
9022
|
var _this = this;
|
|
9013
9023
|
this.baseAttr = this.getAttribute();
|
|
9014
|
-
if (this.getButtonsToShow().indexOf("sorting") >= 0 && this.
|
|
9024
|
+
if (this.getButtonsToShow().indexOf("sorting") >= 0 && this.columnEnabled) {
|
|
9015
9025
|
this.sortingButton = this.renderSoringButton(this.column.sorting);
|
|
9016
9026
|
if (this.column.sorting !== external_easyqueryCore_.SortDirection.None) {
|
|
9017
9027
|
this.sortingButton.style.display = 'block';
|
|
@@ -9081,12 +9091,12 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9081
9091
|
}
|
|
9082
9092
|
//end enable button
|
|
9083
9093
|
//start aggr func button
|
|
9084
|
-
if (_this.getButtonsToShow().indexOf("type") >= 0 && _this.
|
|
9094
|
+
if (_this.getButtonsToShow().indexOf("type") >= 0 && _this.columnEnabled) {
|
|
9085
9095
|
builder.addChildElement(_this.renderColumnTypeButton());
|
|
9086
9096
|
}
|
|
9087
9097
|
//end aggr func button
|
|
9088
9098
|
//start format selector button
|
|
9089
|
-
if (_this.getButtonsToShow().indexOf("format") >= 0 && _this.
|
|
9099
|
+
if (_this.getButtonsToShow().indexOf("format") >= 0 && _this.columnEnabled) {
|
|
9090
9100
|
builder.addChildElement(_this.renderColumnFormatButton());
|
|
9091
9101
|
}
|
|
9092
9102
|
//end format selector button
|
|
@@ -9299,9 +9309,9 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9299
9309
|
.title(external_easyqueryCore_.i18n.getText('CmdToggleEnable'))
|
|
9300
9310
|
.attr('tabIndex', '0')
|
|
9301
9311
|
.addClass("".concat(this.cssPrefix, "-colelement ").concat(this.cssPrefix, "-column-checkbox"))
|
|
9302
|
-
.addClass("".concat(this.
|
|
9312
|
+
.addClass("".concat(this.columnEnabled ? 'enabled' : ''))
|
|
9303
9313
|
.on('click', function () {
|
|
9304
|
-
_this.
|
|
9314
|
+
_this.columnEnabled = !_this.columnEnabled;
|
|
9305
9315
|
_this.column.fireChangedEvent();
|
|
9306
9316
|
return false;
|
|
9307
9317
|
})
|
|
@@ -9357,8 +9367,8 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9357
9367
|
};
|
|
9358
9368
|
ColumnRendererCP.prototype.getClassesToAdd = function () {
|
|
9359
9369
|
var result = "";
|
|
9360
|
-
result += this.
|
|
9361
|
-
if (this.
|
|
9370
|
+
result += this.columnEnabled ? '' : " ".concat(this.cssPrefix, "-disabled");
|
|
9371
|
+
if (this.columnEnabled) {
|
|
9362
9372
|
result += this.column.isReadOnly() ? " ".concat(this.cssPrefix, "-readonly") : '';
|
|
9363
9373
|
}
|
|
9364
9374
|
result += this.column.isHidden() ? " ".concat(this.cssPrefix, "-hidden") : '';
|
|
@@ -9415,7 +9425,7 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9415
9425
|
.addChild('div', function (b) { return b
|
|
9416
9426
|
.addClass("".concat(utils/* eqCssPrefix */.YR, "-button"), "".concat(utils/* eqCssPrefix */.YR, "-column-button"), "".concat(utils/* eqCssPrefix */.YR, "-column-button-enable"))
|
|
9417
9427
|
.title(external_easyqueryCore_.i18n.getText('CmdToggleEnable'))
|
|
9418
|
-
.addClass(_this.
|
|
9428
|
+
.addClass(_this.columnEnabled ? 'enabled' : '')
|
|
9419
9429
|
.attr('tabIndex', '0')
|
|
9420
9430
|
.on('click', function (evt) { return _this.buttonMenuHandler(ColumnAction.Enable, evt); }) //touchstart
|
|
9421
9431
|
.on('keypress', function (evt) { if (evt.keyCode == 13) {
|
|
@@ -9423,7 +9433,7 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9423
9433
|
} }); }).toDOM();
|
|
9424
9434
|
};
|
|
9425
9435
|
ColumnRendererCP.prototype.isEditable = function () {
|
|
9426
|
-
return this.
|
|
9436
|
+
return this.columnEnabled && !this.column.isReadOnly();
|
|
9427
9437
|
};
|
|
9428
9438
|
ColumnRendererCP.prototype.changeFormatHandler = function (ev) {
|
|
9429
9439
|
var _this = this;
|
|
@@ -9589,7 +9599,7 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9589
9599
|
curQuery.fireColumnsChangedEvent(external_easyqueryCore_.QueryChangeAction.Delete, this.column);
|
|
9590
9600
|
break;
|
|
9591
9601
|
case ColumnAction.Enable:
|
|
9592
|
-
this.
|
|
9602
|
+
this.columnEnabled = !this.columnEnabled;
|
|
9593
9603
|
this.fireColumnChanged();
|
|
9594
9604
|
break;
|
|
9595
9605
|
case ColumnAction.Hidden:
|
|
@@ -9663,7 +9673,7 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9663
9673
|
_this.buttonMenuHandler(action, evt);
|
|
9664
9674
|
},
|
|
9665
9675
|
itemFilterCallback: function (item) {
|
|
9666
|
-
var result = _this.
|
|
9676
|
+
var result = _this.columnEnabled || item.id === "__group" || item.id === "enable" || item.id === "delete";
|
|
9667
9677
|
return result;
|
|
9668
9678
|
},
|
|
9669
9679
|
menuClosedCallback: function () {
|
|
@@ -9756,7 +9766,7 @@ var ColumnRendererCP = /** @class */ (function () {
|
|
|
9756
9766
|
ColumnRendererCP.prototype.getButtonMenuSelectedItems = function () {
|
|
9757
9767
|
var _this = this;
|
|
9758
9768
|
var arrSelected = [];
|
|
9759
|
-
if (this.
|
|
9769
|
+
if (this.columnEnabled) {
|
|
9760
9770
|
arrSelected.push("enable");
|
|
9761
9771
|
}
|
|
9762
9772
|
;
|
|
@@ -10172,13 +10182,6 @@ var CustomSqlColumnRendererCP = /** @class */ (function (_super) {
|
|
|
10172
10182
|
_this.dataTypeMenu = null;
|
|
10173
10183
|
return _this;
|
|
10174
10184
|
}
|
|
10175
|
-
CustomSqlColumnRendererCP.prototype.render = function () {
|
|
10176
|
-
if (!this.panel.areCustomExpressionsAllowed() && this.column.enabled) {
|
|
10177
|
-
this.column.enabled = false;
|
|
10178
|
-
this.fireColumnChanged();
|
|
10179
|
-
}
|
|
10180
|
-
return _super.prototype.render.call(this);
|
|
10181
|
-
};
|
|
10182
10185
|
CustomSqlColumnRendererCP.prototype.renderEnabledButton = function () {
|
|
10183
10186
|
var elem = _super.prototype.renderEnabledButton.call(this);
|
|
10184
10187
|
var child = elem.children[0];
|
|
@@ -10736,6 +10739,7 @@ var ColumnsPanel = /** @class */ (function (_super) {
|
|
|
10736
10739
|
};
|
|
10737
10740
|
ColumnsPanel.prototype.setOptions = function (options) {
|
|
10738
10741
|
public_api/* utils.assignDeep */.P6.assignDeep(this.options, options);
|
|
10742
|
+
this.getContext().options.allowCustomExpressions = options.allowCustomExpressions;
|
|
10739
10743
|
if (browser_utils/* browserUtils.isMobileMode */.z.isMobileMode()) {
|
|
10740
10744
|
this.options.buttons = ["menu"];
|
|
10741
10745
|
this.options.showHeader = false;
|
|
@@ -10955,7 +10959,7 @@ var ColumnsPanel = /** @class */ (function (_super) {
|
|
|
10955
10959
|
};
|
|
10956
10960
|
ColumnsPanel.prototype.areCustomExpressionsAllowed = function () {
|
|
10957
10961
|
var query = this.getQuery();
|
|
10958
|
-
return query.isEx() && this.options.allowCustomExpressions;
|
|
10962
|
+
return query.isEx() && this.getContext().options.allowCustomExpressions;
|
|
10959
10963
|
};
|
|
10960
10964
|
ColumnsPanel.prototype.addAllColumnsToEntitiesList = function (list) {
|
|
10961
10965
|
var _this = this;
|
|
@@ -11384,7 +11388,7 @@ var ColumnRendererCB = /** @class */ (function () {
|
|
|
11384
11388
|
if (data.id == 'None' || data.id == "Ascending" || data.id == "Descending") {
|
|
11385
11389
|
var query = _this.bar.getQuery();
|
|
11386
11390
|
_this.column.sorting = strToSortDirection(data.id);
|
|
11387
|
-
_this.column.
|
|
11391
|
+
_this.column._sortIndex = query.getColumnSortIndex(_this.column);
|
|
11388
11392
|
_this.fireColumnChanged();
|
|
11389
11393
|
}
|
|
11390
11394
|
else {
|
|
@@ -11939,10 +11943,15 @@ var ColumnsBar = /** @class */ (function (_super) {
|
|
|
11939
11943
|
_this.hideLandingSlot();
|
|
11940
11944
|
},
|
|
11941
11945
|
onDrop: function (container, ev) {
|
|
11942
|
-
|
|
11943
|
-
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
+
if (_this.landingIndex >= 0) {
|
|
11947
|
+
var query = _this.getQuery();
|
|
11948
|
+
var columns = query.getColumns();
|
|
11949
|
+
var index = columns.indexOf(ev.data.column);
|
|
11950
|
+
_this.moveColumnCore(index, _this.landingIndex);
|
|
11951
|
+
}
|
|
11952
|
+
else {
|
|
11953
|
+
ev.item.element.removeAttribute('style');
|
|
11954
|
+
}
|
|
11946
11955
|
}
|
|
11947
11956
|
});
|
|
11948
11957
|
}
|
|
@@ -12575,6 +12584,7 @@ var ColumnRendererSB = /** @class */ (function () {
|
|
|
12575
12584
|
configurable: true
|
|
12576
12585
|
});
|
|
12577
12586
|
ColumnRendererSB.prototype.render = function () {
|
|
12587
|
+
var _this = this;
|
|
12578
12588
|
this.baseAttr = this.getAttribute();
|
|
12579
12589
|
var builder = (0,lib_public_api/* domel */.uC)('div');
|
|
12580
12590
|
builder.data('id', this.column.id);
|
|
@@ -12584,6 +12594,23 @@ var ColumnRendererSB = /** @class */ (function () {
|
|
|
12584
12594
|
.replaceChild(builder.toDOM(), this.element);
|
|
12585
12595
|
}
|
|
12586
12596
|
this.element = builder.toDOM();
|
|
12597
|
+
if (this.bar.options.allowDragDrop) {
|
|
12598
|
+
lib_public_api/* eqDragManager.registerDraggableItem */.Yy.registerDraggableItem({
|
|
12599
|
+
element: this.element,
|
|
12600
|
+
scope: "entityAttrSortSB",
|
|
12601
|
+
beforeDragStart: function () { return _this.element.dispatchEvent((0,lib_public_api/* createBrowserEvent */.sJ)('mouseleave')); },
|
|
12602
|
+
onDragStart: function (ev) {
|
|
12603
|
+
_this.element.style.display = 'none';
|
|
12604
|
+
ev.dropEffect = lib_public_api/* DropEffect.Allow */.KX.Allow;
|
|
12605
|
+
},
|
|
12606
|
+
onDragEnd: function (ev) {
|
|
12607
|
+
if (!ev.data.finishedSuccessfully) {
|
|
12608
|
+
_this.element.removeAttribute('style');
|
|
12609
|
+
}
|
|
12610
|
+
},
|
|
12611
|
+
data: { column: this.column }
|
|
12612
|
+
});
|
|
12613
|
+
}
|
|
12587
12614
|
builder
|
|
12588
12615
|
.addClass(this.getClassesToAdd())
|
|
12589
12616
|
.addClass(browser_utils/* browserUtils.getMobileCssClass */.z.getMobileCssClass())
|
|
@@ -12686,10 +12713,13 @@ var ColumnRendererSB = /** @class */ (function () {
|
|
|
12686
12713
|
}
|
|
12687
12714
|
else {
|
|
12688
12715
|
_this.column.sorting = strToSortDirection(data.id);
|
|
12689
|
-
_this.column.
|
|
12716
|
+
_this.column._sortIndex = query.getColumnSortIndex(_this.column);
|
|
12690
12717
|
_this.fireColumnChanged();
|
|
12691
12718
|
}
|
|
12692
12719
|
}
|
|
12720
|
+
else {
|
|
12721
|
+
_this.bar.moveColumn(_this.column, data.id);
|
|
12722
|
+
}
|
|
12693
12723
|
},
|
|
12694
12724
|
menuClosedCallback: function () {
|
|
12695
12725
|
_this.keepShowingButtons = false;
|
|
@@ -12748,6 +12778,7 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12748
12778
|
showAddRow: true,
|
|
12749
12779
|
attrElementFormat: '{entity} {attr}',
|
|
12750
12780
|
titleElementFormat: null,
|
|
12781
|
+
allowDragDrop: true,
|
|
12751
12782
|
menuOptions: {
|
|
12752
12783
|
showSearchBoxAfter: 30,
|
|
12753
12784
|
searchBoxAutoFocus: true,
|
|
@@ -12759,8 +12790,17 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12759
12790
|
_this.sortMenuList = [
|
|
12760
12791
|
{ id: 'None', text: public_api/* i18n.getText */.ag.getText('CmdNotSorted') },
|
|
12761
12792
|
{ id: 'Ascending', text: public_api/* i18n.getText */.ag.getText('CmdAscending') },
|
|
12762
|
-
{ id: 'Descending', text: public_api/* i18n.getText */.ag.getText('CmdDescending') }
|
|
12793
|
+
{ id: 'Descending', text: public_api/* i18n.getText */.ag.getText('CmdDescending') },
|
|
12794
|
+
{ id: '---', text: '---' },
|
|
12795
|
+
{ id: 'MoveTop', text: public_api/* i18n.getText */.ag.getText('CmdMoveToFirst') },
|
|
12796
|
+
{ id: 'MoveUp', text: public_api/* i18n.getText */.ag.getText('CmdMoveToPrev') },
|
|
12797
|
+
{ id: 'MoveDown', text: public_api/* i18n.getText */.ag.getText('CmdMoveToNext') },
|
|
12798
|
+
{ id: 'MoveBottom', text: public_api/* i18n.getText */.ag.getText('CmdMoveToLast') }
|
|
12763
12799
|
];
|
|
12800
|
+
_this.landingSlot = (0,lib_public_api/* domel */.uC)('div')
|
|
12801
|
+
.addClass("".concat(utils/* eqCssPrefix */.YR, "-highlight"))
|
|
12802
|
+
.toDOM();
|
|
12803
|
+
_this.landingIndex = -1;
|
|
12764
12804
|
(0,lib_public_api/* domel */.uC)(_this.slot)
|
|
12765
12805
|
.addClass("".concat(_this.cssPrefix, "-panel"))
|
|
12766
12806
|
.addClass(browser_utils/* browserUtils.getMobileCssClass */.z.getMobileCssClass());
|
|
@@ -12778,10 +12818,37 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12778
12818
|
return 'sortingBar';
|
|
12779
12819
|
};
|
|
12780
12820
|
SortingBar.prototype.init = function (context, options) {
|
|
12821
|
+
var _this = this;
|
|
12781
12822
|
_super.prototype.init.call(this, context, options);
|
|
12782
12823
|
this.setOptions(options);
|
|
12783
12824
|
this.destroyCore();
|
|
12784
12825
|
this.attachQueryObserver();
|
|
12826
|
+
lib_public_api/* eqDragManager.removeDropContainer */.Yy.removeDropContainer(this.slot);
|
|
12827
|
+
if (this.options.allowDragDrop) {
|
|
12828
|
+
lib_public_api/* eqDragManager.registerDropContainer */.Yy.registerDropContainer({
|
|
12829
|
+
element: this.slot,
|
|
12830
|
+
scopes: ["entityAttrSortSB"],
|
|
12831
|
+
onDragEnter: function (container, ev) {
|
|
12832
|
+
_this.showLandingSlot(ev.pageX, ev.pageY);
|
|
12833
|
+
},
|
|
12834
|
+
onDragOver: function (container, ev) {
|
|
12835
|
+
_this.showLandingSlot(ev.pageX, ev.pageY);
|
|
12836
|
+
},
|
|
12837
|
+
onDragLeave: function (container, ev) {
|
|
12838
|
+
ev.dropEffect = lib_public_api/* DropEffect.Forbid */.KX.Forbid;
|
|
12839
|
+
_this.hideLandingSlot();
|
|
12840
|
+
},
|
|
12841
|
+
onDrop: function (container, ev) {
|
|
12842
|
+
if (_this.landingIndex >= 0) {
|
|
12843
|
+
var query = _this.getQuery();
|
|
12844
|
+
query.setColumnSortIndex(ev.data.column, _this.landingIndex);
|
|
12845
|
+
}
|
|
12846
|
+
else {
|
|
12847
|
+
ev.item.element.removeAttribute('style');
|
|
12848
|
+
}
|
|
12849
|
+
}
|
|
12850
|
+
});
|
|
12851
|
+
}
|
|
12785
12852
|
};
|
|
12786
12853
|
SortingBar.prototype.setOptions = function (options) {
|
|
12787
12854
|
public_api/* utils.assignDeep */.P6.assignDeep(this.options, options);
|
|
@@ -12796,66 +12863,21 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12796
12863
|
&& edata.part != external_easyqueryCore_.QueryChangePart.Columns && edata.part != external_easyqueryCore_.QueryChangePart.All)) {
|
|
12797
12864
|
return;
|
|
12798
12865
|
}
|
|
12799
|
-
|
|
12800
|
-
case external_easyqueryCore_.QueryChangeAction.Modify: {
|
|
12801
|
-
var columns = edata.changee;
|
|
12802
|
-
var modifyColumn_1 = function (column) {
|
|
12803
|
-
var colEl = _this.columnsBlock.querySelector("div[data-id='".concat(column.id, "']"));
|
|
12804
|
-
if (colEl) {
|
|
12805
|
-
_this.renderColumn(column, colEl);
|
|
12806
|
-
}
|
|
12807
|
-
};
|
|
12808
|
-
if (Array.isArray(columns)) {
|
|
12809
|
-
columns.forEach(function (col) { return modifyColumn_1(col); });
|
|
12810
|
-
}
|
|
12811
|
-
else {
|
|
12812
|
-
modifyColumn_1(columns);
|
|
12813
|
-
}
|
|
12814
|
-
break;
|
|
12815
|
-
}
|
|
12816
|
-
case external_easyqueryCore_.QueryChangeAction.Add: {
|
|
12817
|
-
var columns = edata.changee;
|
|
12818
|
-
var addColumn_1 = function (column) {
|
|
12819
|
-
_this.addColumnElement(column);
|
|
12820
|
-
};
|
|
12821
|
-
if (Array.isArray(columns)) {
|
|
12822
|
-
columns.forEach(function (col) { return addColumn_1(col); });
|
|
12823
|
-
}
|
|
12824
|
-
else {
|
|
12825
|
-
addColumn_1(columns);
|
|
12826
|
-
}
|
|
12827
|
-
break;
|
|
12828
|
-
}
|
|
12829
|
-
case external_easyqueryCore_.QueryChangeAction.Delete: {
|
|
12830
|
-
var columns = edata.changee;
|
|
12831
|
-
var deleteColumn_1 = function (column) {
|
|
12832
|
-
var colEl = _this.columnsBlock.querySelector("div[data-id='".concat(column.id, "']"));
|
|
12833
|
-
if (colEl)
|
|
12834
|
-
_this.columnsBlock.removeChild(colEl);
|
|
12835
|
-
};
|
|
12836
|
-
if (Array.isArray(columns)) {
|
|
12837
|
-
columns.forEach(function (col) { return deleteColumn_1(col); });
|
|
12838
|
-
}
|
|
12839
|
-
else {
|
|
12840
|
-
deleteColumn_1(columns);
|
|
12841
|
-
}
|
|
12842
|
-
break;
|
|
12843
|
-
}
|
|
12844
|
-
default:
|
|
12845
|
-
_this.refresh();
|
|
12846
|
-
break;
|
|
12847
|
-
}
|
|
12866
|
+
_this.refresh();
|
|
12848
12867
|
});
|
|
12849
12868
|
};
|
|
12850
12869
|
SortingBar.prototype.detachQueryObserver = function () {
|
|
12851
12870
|
if (this.queryEventCallbackId) {
|
|
12852
|
-
var query = this.
|
|
12871
|
+
var query = this.getQuery();
|
|
12853
12872
|
query.removeChangedCallback(this.queryEventCallbackId);
|
|
12854
12873
|
}
|
|
12855
12874
|
};
|
|
12856
12875
|
SortingBar.prototype.getQuery = function () {
|
|
12857
12876
|
return this.getContext().getQuery();
|
|
12858
12877
|
};
|
|
12878
|
+
SortingBar.prototype.getModel = function () {
|
|
12879
|
+
return this.getContext().getModel();
|
|
12880
|
+
};
|
|
12859
12881
|
SortingBar.prototype.destroyCore = function () {
|
|
12860
12882
|
this.detachQueryObserver();
|
|
12861
12883
|
this.clear();
|
|
@@ -12893,7 +12915,7 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12893
12915
|
this.entitiesMenu.showMenu(menuOptions);
|
|
12894
12916
|
};
|
|
12895
12917
|
SortingBar.prototype.createEntitiesMenu = function () {
|
|
12896
|
-
var model = this.
|
|
12918
|
+
var model = this.getModel();
|
|
12897
12919
|
if (!model || model.isEmpty())
|
|
12898
12920
|
return null;
|
|
12899
12921
|
var menuId = this.slot.id;
|
|
@@ -12906,7 +12928,7 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12906
12928
|
this.entitiesMenu = new PopupMenu(options);
|
|
12907
12929
|
};
|
|
12908
12930
|
SortingBar.prototype.createSortMenu = function () {
|
|
12909
|
-
var model = this.
|
|
12931
|
+
var model = this.getModel();
|
|
12910
12932
|
if (!model || model.isEmpty())
|
|
12911
12933
|
return null;
|
|
12912
12934
|
var menuId = this.slot.id;
|
|
@@ -12943,8 +12965,8 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12943
12965
|
}
|
|
12944
12966
|
(0,lib_public_api/* domel */.uC)(this.slot)
|
|
12945
12967
|
.addChildElement(this.columnsBlock);
|
|
12946
|
-
var query = this.
|
|
12947
|
-
var columns = query.getColumns().concat(query.getJustSortedColumns());
|
|
12968
|
+
var query = this.getQuery();
|
|
12969
|
+
var columns = query.getSortedColumns(); // .getColumns().concat(query.getJustSortedColumns());
|
|
12948
12970
|
columns.forEach(function (column, index) {
|
|
12949
12971
|
var slot = _this.renderColumn(column);
|
|
12950
12972
|
_this.columnsBlock.appendChild(slot);
|
|
@@ -12952,8 +12974,8 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12952
12974
|
};
|
|
12953
12975
|
SortingBar.prototype.addNewColumn = function (attrId) {
|
|
12954
12976
|
var _this = this;
|
|
12955
|
-
var model = this.
|
|
12956
|
-
var query = this.
|
|
12977
|
+
var model = this.getModel();
|
|
12978
|
+
var query = this.getQuery();
|
|
12957
12979
|
var getColumnByAttrId = function (attrid) {
|
|
12958
12980
|
var attribute = model.getAttributeById(attrid);
|
|
12959
12981
|
if (!attribute) {
|
|
@@ -12972,60 +12994,28 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
12972
12994
|
}
|
|
12973
12995
|
var column = query.createColumn(true);
|
|
12974
12996
|
column.caption = _this.getDefaultColumnCaption(attribute);
|
|
12975
|
-
column.
|
|
12976
|
-
column.sortIndex =
|
|
12997
|
+
column._sorting = external_easyqueryCore_.SortDirection.Ascending;
|
|
12998
|
+
//column.sortIndex = this.getQuery().getColumnSortIndex(column);
|
|
12977
12999
|
column.expr.tag = external_easyqueryCore_.ExprTag.EntityAttribute;
|
|
13000
|
+
column.expr.dataType = attribute.dataType;
|
|
12978
13001
|
//column.expr.id = attrid;
|
|
12979
13002
|
column.expr.setValue(attrid, true);
|
|
12980
13003
|
column.params.concat(attribute.params);
|
|
12981
13004
|
return column;
|
|
12982
13005
|
};
|
|
12983
|
-
if (!this.
|
|
13006
|
+
if (!this.getQuery()) {
|
|
12984
13007
|
return;
|
|
12985
13008
|
}
|
|
12986
|
-
|
|
13009
|
+
var newCol = getColumnByAttrId(attrId);
|
|
13010
|
+
return this.getQuery().addColumn({
|
|
13011
|
+
column: newCol
|
|
13012
|
+
});
|
|
12987
13013
|
};
|
|
12988
13014
|
SortingBar.prototype.getDefaultColumnCaption = function (attr) {
|
|
12989
13015
|
var format = this.options.titleElementFormat || this.options.attrElementFormat;
|
|
12990
|
-
var model = this.
|
|
13016
|
+
var model = this.getModel();
|
|
12991
13017
|
return model.getAttributeText(attr, format);
|
|
12992
13018
|
};
|
|
12993
|
-
SortingBar.prototype.addColumn = function (column) {
|
|
12994
|
-
var query = this.getContext().getQuery();
|
|
12995
|
-
if (!query) {
|
|
12996
|
-
return;
|
|
12997
|
-
}
|
|
12998
|
-
column = this.checkColumn(column);
|
|
12999
|
-
if (!column) {
|
|
13000
|
-
return;
|
|
13001
|
-
}
|
|
13002
|
-
column = query.addColumn({
|
|
13003
|
-
caption: column.caption,
|
|
13004
|
-
attributeId: column.expr.value,
|
|
13005
|
-
sorting: column.sorting,
|
|
13006
|
-
sortIndex: column.sortIndex,
|
|
13007
|
-
justsorted: true
|
|
13008
|
-
});
|
|
13009
|
-
query.fireChangedEvent({
|
|
13010
|
-
part: external_easyqueryCore_.QueryChangePart.SortingColumns,
|
|
13011
|
-
action: external_easyqueryCore_.QueryChangeAction.Add,
|
|
13012
|
-
changee: column
|
|
13013
|
-
});
|
|
13014
|
-
return column;
|
|
13015
|
-
};
|
|
13016
|
-
SortingBar.prototype.checkColumn = function (col) {
|
|
13017
|
-
var query = this.getContext().getQuery();
|
|
13018
|
-
var columns = query.getColumns()
|
|
13019
|
-
.concat(query.getJustSortedColumns());
|
|
13020
|
-
var colJson = JSON.stringify(col.expr.saveToData());
|
|
13021
|
-
for (var i = 0; i < columns.length; i++) {
|
|
13022
|
-
var qcolJson = JSON.stringify(columns[i].expr.saveToData());
|
|
13023
|
-
if (qcolJson === colJson) {
|
|
13024
|
-
return null;
|
|
13025
|
-
}
|
|
13026
|
-
}
|
|
13027
|
-
return col;
|
|
13028
|
-
};
|
|
13029
13019
|
SortingBar.prototype.renderColumn = function (column, elem) {
|
|
13030
13020
|
var renderer = new ColumnRendererSB(this, column, elem);
|
|
13031
13021
|
if (renderer) {
|
|
@@ -13034,17 +13024,84 @@ var SortingBar = /** @class */ (function (_super) {
|
|
|
13034
13024
|
}
|
|
13035
13025
|
return null;
|
|
13036
13026
|
};
|
|
13037
|
-
//adds one column to the bar on the specified position
|
|
13038
|
-
SortingBar.prototype.addColumnElement = function (column) {
|
|
13039
|
-
var newColBlock = this.renderColumn(column);
|
|
13040
|
-
this.columnsBlock.appendChild(newColBlock);
|
|
13041
|
-
if (this.options.columnRenderedCallback) {
|
|
13042
|
-
this.options.columnRenderedCallback(newColBlock);
|
|
13043
|
-
}
|
|
13044
|
-
};
|
|
13045
13027
|
SortingBar.prototype.clear = function () {
|
|
13046
13028
|
this.slot.innerHTML = '';
|
|
13047
13029
|
};
|
|
13030
|
+
SortingBar.prototype.moveColumn = function (column, direction) {
|
|
13031
|
+
var query = this.getQuery();
|
|
13032
|
+
var columns = query.getSortedColumns();
|
|
13033
|
+
var index = query.getColumnSortIndex(column);
|
|
13034
|
+
if (index >= 0) {
|
|
13035
|
+
switch (direction) {
|
|
13036
|
+
case 'MoveTop':
|
|
13037
|
+
query.setColumnSortIndex(column, 0);
|
|
13038
|
+
break;
|
|
13039
|
+
case 'MoveUp':
|
|
13040
|
+
query.setColumnSortIndex(column, index > 0 ? index - 1 : 0);
|
|
13041
|
+
break;
|
|
13042
|
+
case 'MoveDown':
|
|
13043
|
+
query.setColumnSortIndex(column, index < columns.length - 1 ? index + 1 : columns.length - 1);
|
|
13044
|
+
break;
|
|
13045
|
+
case 'MoveBottom':
|
|
13046
|
+
query.setColumnSortIndex(column, columns.length - 1);
|
|
13047
|
+
break;
|
|
13048
|
+
}
|
|
13049
|
+
;
|
|
13050
|
+
}
|
|
13051
|
+
};
|
|
13052
|
+
SortingBar.prototype.showLandingSlot = function (pageX, pageY) {
|
|
13053
|
+
var elements = this.columnsBlock.querySelectorAll("[class*=".concat(this.cssPrefix, "-row]"));
|
|
13054
|
+
var columnSlots = [];
|
|
13055
|
+
for (var i = 0; i < elements.length; i++) {
|
|
13056
|
+
if (elements[i].style.display !== 'none') {
|
|
13057
|
+
columnSlots.push(elements[i]);
|
|
13058
|
+
}
|
|
13059
|
+
}
|
|
13060
|
+
if (columnSlots.length === 0) {
|
|
13061
|
+
this.landingIndex = 0;
|
|
13062
|
+
return;
|
|
13063
|
+
}
|
|
13064
|
+
var landingPos = (0,lib_public_api/* getElementAbsolutePos */.lE)(this.landingSlot);
|
|
13065
|
+
if (pageX >= landingPos.x && pageX <= landingPos.x + this.landingSlot.offsetWidth
|
|
13066
|
+
&& pageY >= landingPos.y && pageY <= landingPos.y + this.landingSlot.offsetHeight) {
|
|
13067
|
+
return;
|
|
13068
|
+
}
|
|
13069
|
+
var newLandingIndex = this.landingIndex;
|
|
13070
|
+
for (var i = 0; i < columnSlots.length; i++) {
|
|
13071
|
+
var colSlot = columnSlots[i];
|
|
13072
|
+
var absPos = (0,lib_public_api/* getElementAbsolutePos */.lE)(colSlot);
|
|
13073
|
+
var colWidth = colSlot.offsetWidth;
|
|
13074
|
+
var colHeight = colSlot.offsetHeight;
|
|
13075
|
+
var paddingWidth = 0.2 * colWidth;
|
|
13076
|
+
var paddingHeight = 2;
|
|
13077
|
+
if (pageX >= absPos.x + paddingWidth && pageX <= absPos.x + colWidth - paddingWidth
|
|
13078
|
+
&& pageY >= absPos.y + paddingHeight && pageY <= absPos.y + colHeight - paddingHeight) {
|
|
13079
|
+
if (pageX > landingPos.x)
|
|
13080
|
+
newLandingIndex = i + 1;
|
|
13081
|
+
else
|
|
13082
|
+
newLandingIndex = i;
|
|
13083
|
+
break;
|
|
13084
|
+
}
|
|
13085
|
+
}
|
|
13086
|
+
if (newLandingIndex != this.landingIndex || this.landingSlot.parentElement) {
|
|
13087
|
+
this.landingIndex = newLandingIndex;
|
|
13088
|
+
if (this.landingIndex <= 0) {
|
|
13089
|
+
this.columnsBlock.insertBefore(this.landingSlot, columnSlots[0]);
|
|
13090
|
+
}
|
|
13091
|
+
if (this.landingIndex < columnSlots.length) {
|
|
13092
|
+
this.columnsBlock.insertBefore(this.landingSlot, columnSlots[this.landingIndex]);
|
|
13093
|
+
}
|
|
13094
|
+
else {
|
|
13095
|
+
this.columnsBlock.appendChild(this.landingSlot);
|
|
13096
|
+
}
|
|
13097
|
+
}
|
|
13098
|
+
};
|
|
13099
|
+
SortingBar.prototype.hideLandingSlot = function () {
|
|
13100
|
+
this.landingIndex = -1;
|
|
13101
|
+
if (this.landingSlot.parentElement) {
|
|
13102
|
+
this.landingSlot.parentElement.removeChild(this.landingSlot);
|
|
13103
|
+
}
|
|
13104
|
+
};
|
|
13048
13105
|
return SortingBar;
|
|
13049
13106
|
}(external_easyqueryCore_.Widget));
|
|
13050
13107
|
|
|
@@ -16944,7 +17001,8 @@ var ManageDrillDownWidget = /** @class */ (function (_super) {
|
|
|
16944
17001
|
}
|
|
16945
17002
|
}, null);
|
|
16946
17003
|
this.ddQuery = new external_easyqueryCore_.Query(model, null, {
|
|
16947
|
-
parent: query
|
|
17004
|
+
parent: query,
|
|
17005
|
+
context: this.context
|
|
16948
17006
|
});
|
|
16949
17007
|
var dds = this.context.getQuery().getDrillDowns();
|
|
16950
17008
|
if (dds.length) {
|