@easyquery/ui 7.3.3-rc01 → 7.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/css/easyquery.css +1 -0
- package/dist/assets/css/easyquery.ui.css +31 -12
- package/dist/assets/css/upgrade.css +29 -12
- package/dist/easyquery.ui.cjs.js +57 -37
- package/dist/easyquery.ui.esm.js +58 -38
- package/dist/types/utils/popup_menu.d.ts +4 -0
- package/dist/types/views/view.d.ts +2 -2
- package/package.json +2 -2
|
@@ -3128,6 +3128,8 @@ body {
|
|
|
3128
3128
|
|
|
3129
3129
|
.eqjs-fb-button {
|
|
3130
3130
|
-moz-user-select: none;
|
|
3131
|
+
-webkit-user-select: none;
|
|
3132
|
+
user-select: none;
|
|
3131
3133
|
background-image: none;
|
|
3132
3134
|
border: 1px solid transparent;
|
|
3133
3135
|
border-radius: 4px;
|
|
@@ -4689,9 +4691,6 @@ input.eqjs-invalid {
|
|
|
4689
4691
|
top: 4px;
|
|
4690
4692
|
}
|
|
4691
4693
|
|
|
4692
|
-
.eqjs-qp-condition-buttonsBlock {
|
|
4693
|
-
}
|
|
4694
|
-
|
|
4695
4694
|
.eqjs-qc-column-checkbox:hover,
|
|
4696
4695
|
.eqjs-qp-column-checkbox:hover,
|
|
4697
4696
|
.eqjs-column-buttonsBlock .eqjs-button:hover,
|
|
@@ -4711,15 +4710,14 @@ input.eqjs-invalid {
|
|
|
4711
4710
|
align-items: center;
|
|
4712
4711
|
justify-content: center;
|
|
4713
4712
|
font-family: 'easyquery' !important;
|
|
4714
|
-
speak: never;
|
|
4715
4713
|
font-style: normal;
|
|
4716
4714
|
font-weight: normal;
|
|
4717
4715
|
font-variant: normal;
|
|
4718
|
-
text-transform: none;
|
|
4719
|
-
line-height: 1!important;
|
|
4716
|
+
text-transform: none !important;
|
|
4717
|
+
line-height: 1 !important;
|
|
4720
4718
|
font-size: var(--icon-size);
|
|
4721
4719
|
color: var(--button-text-color);
|
|
4722
|
-
text-decoration: none;
|
|
4720
|
+
text-decoration: none !important;
|
|
4723
4721
|
padding: 0;
|
|
4724
4722
|
outline: none;
|
|
4725
4723
|
|
|
@@ -4800,10 +4798,6 @@ input.eqjs-invalid {
|
|
|
4800
4798
|
border-bottom: 1px solid var(--border-color);
|
|
4801
4799
|
}
|
|
4802
4800
|
|
|
4803
|
-
.eqjs-qc-row.eqjs-qc-disabled {
|
|
4804
|
-
/*min-height: 26px;*/
|
|
4805
|
-
}
|
|
4806
|
-
|
|
4807
4801
|
.eqjs-qc-row:not([data-show-buttons]) .eqjs-qc-column-checkbox,
|
|
4808
4802
|
.eqjs-qc-row:not([data-show-buttons]) .eqjs-column-sortbutton.eqjs-column-sortbutton-none
|
|
4809
4803
|
{
|
|
@@ -4864,6 +4858,11 @@ input.eqjs-invalid {
|
|
|
4864
4858
|
flex-wrap: nowrap;
|
|
4865
4859
|
}
|
|
4866
4860
|
|
|
4861
|
+
.eqjs-qp-valueelement {
|
|
4862
|
+
width: auto;
|
|
4863
|
+
flex-grow: 0;
|
|
4864
|
+
}
|
|
4865
|
+
|
|
4867
4866
|
.eqjs-qc-attrelement, .eqjs-qp-attrelement, .eqjs-qp-operelement {
|
|
4868
4867
|
margin-left: 0;
|
|
4869
4868
|
flex-shrink: 1;
|
|
@@ -4967,7 +4966,7 @@ input.eqjs-invalid {
|
|
|
4967
4966
|
}
|
|
4968
4967
|
|
|
4969
4968
|
.eqjs-menu-scrollDiv:not(.eqjs-mobile) {
|
|
4970
|
-
max-height:
|
|
4969
|
+
/*max-height: 500px;*/
|
|
4971
4970
|
}
|
|
4972
4971
|
|
|
4973
4972
|
.eqjs-qc-colelement {
|
|
@@ -5105,6 +5104,26 @@ input.eqjs-invalid {
|
|
|
5105
5104
|
.eqjs-qc-captionelement input {
|
|
5106
5105
|
min-width: var(--column-panel-caption-size);
|
|
5107
5106
|
width: auto;
|
|
5107
|
+
}
|
|
5108
|
+
|
|
5109
|
+
.eqjs-qp-row {
|
|
5110
|
+
padding: 0 10px!important;
|
|
5111
|
+
}
|
|
5112
|
+
.eqjs-qp-condition-buttonsBlock, .eqjs-facets-total-buttons {
|
|
5113
|
+
margin-right: 10px;
|
|
5114
|
+
}
|
|
5115
|
+
|
|
5116
|
+
.eqjs-qp-row.eqjs-mobile {
|
|
5117
|
+
border-style: solid!important;
|
|
5118
|
+
margin: 0 4px;
|
|
5119
|
+
}
|
|
5120
|
+
|
|
5121
|
+
.eqjs-qp-condition-buttonsBlock.eqjs-mobile {
|
|
5122
|
+
top: 0!important;
|
|
5123
|
+
}
|
|
5124
|
+
|
|
5125
|
+
.eqjs-cb-addrow.eqjs-mobile a, .eqjs-sb-addrow.eqjs-mobile a {
|
|
5126
|
+
background: none!important;
|
|
5108
5127
|
}
|
|
5109
5128
|
/*setting to all page */
|
|
5110
5129
|
#eqv-main{
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
top: 4px;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.eqjs-qp-condition-buttonsBlock {
|
|
25
|
-
}
|
|
26
|
-
|
|
27
24
|
.eqjs-qc-column-checkbox:hover,
|
|
28
25
|
.eqjs-qp-column-checkbox:hover,
|
|
29
26
|
.eqjs-column-buttonsBlock .eqjs-button:hover,
|
|
@@ -43,15 +40,14 @@
|
|
|
43
40
|
align-items: center;
|
|
44
41
|
justify-content: center;
|
|
45
42
|
font-family: 'easyquery' !important;
|
|
46
|
-
speak: never;
|
|
47
43
|
font-style: normal;
|
|
48
44
|
font-weight: normal;
|
|
49
45
|
font-variant: normal;
|
|
50
|
-
text-transform: none;
|
|
51
|
-
line-height: 1!important;
|
|
46
|
+
text-transform: none !important;
|
|
47
|
+
line-height: 1 !important;
|
|
52
48
|
font-size: var(--icon-size);
|
|
53
49
|
color: var(--button-text-color);
|
|
54
|
-
text-decoration: none;
|
|
50
|
+
text-decoration: none !important;
|
|
55
51
|
padding: 0;
|
|
56
52
|
outline: none;
|
|
57
53
|
|
|
@@ -132,10 +128,6 @@
|
|
|
132
128
|
border-bottom: 1px solid var(--border-color);
|
|
133
129
|
}
|
|
134
130
|
|
|
135
|
-
.eqjs-qc-row.eqjs-qc-disabled {
|
|
136
|
-
/*min-height: 26px;*/
|
|
137
|
-
}
|
|
138
|
-
|
|
139
131
|
.eqjs-qc-row:not([data-show-buttons]) .eqjs-qc-column-checkbox,
|
|
140
132
|
.eqjs-qc-row:not([data-show-buttons]) .eqjs-column-sortbutton.eqjs-column-sortbutton-none
|
|
141
133
|
{
|
|
@@ -196,6 +188,11 @@
|
|
|
196
188
|
flex-wrap: nowrap;
|
|
197
189
|
}
|
|
198
190
|
|
|
191
|
+
.eqjs-qp-valueelement {
|
|
192
|
+
width: auto;
|
|
193
|
+
flex-grow: 0;
|
|
194
|
+
}
|
|
195
|
+
|
|
199
196
|
.eqjs-qc-attrelement, .eqjs-qp-attrelement, .eqjs-qp-operelement {
|
|
200
197
|
margin-left: 0;
|
|
201
198
|
flex-shrink: 1;
|
|
@@ -299,7 +296,7 @@
|
|
|
299
296
|
}
|
|
300
297
|
|
|
301
298
|
.eqjs-menu-scrollDiv:not(.eqjs-mobile) {
|
|
302
|
-
max-height:
|
|
299
|
+
/*max-height: 500px;*/
|
|
303
300
|
}
|
|
304
301
|
|
|
305
302
|
.eqjs-qc-colelement {
|
|
@@ -435,4 +432,24 @@
|
|
|
435
432
|
.eqjs-qc-captionelement input {
|
|
436
433
|
min-width: var(--column-panel-caption-size);
|
|
437
434
|
width: auto;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.eqjs-qp-row {
|
|
438
|
+
padding: 0 10px!important;
|
|
439
|
+
}
|
|
440
|
+
.eqjs-qp-condition-buttonsBlock, .eqjs-facets-total-buttons {
|
|
441
|
+
margin-right: 10px;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.eqjs-qp-row.eqjs-mobile {
|
|
445
|
+
border-style: solid!important;
|
|
446
|
+
margin: 0 4px;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.eqjs-qp-condition-buttonsBlock.eqjs-mobile {
|
|
450
|
+
top: 0!important;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.eqjs-cb-addrow.eqjs-mobile a, .eqjs-sb-addrow.eqjs-mobile a {
|
|
454
|
+
background: none!important;
|
|
438
455
|
}
|
package/dist/easyquery.ui.cjs.js
CHANGED
|
@@ -21,11 +21,11 @@ function findHighestZIndex(elem) {
|
|
|
21
21
|
}
|
|
22
22
|
// simetimes setting focus in the main thread doesn't work correctly (in Firefox). So we need to 'hack' it.
|
|
23
23
|
function safeFocus(element) {
|
|
24
|
-
setTimeout(
|
|
25
|
-
if (
|
|
26
|
-
|
|
24
|
+
setTimeout((el) => {
|
|
25
|
+
if (el && el.focus) {
|
|
26
|
+
el.focus();
|
|
27
27
|
}
|
|
28
|
-
}, 100);
|
|
28
|
+
}, 100, element);
|
|
29
29
|
}
|
|
30
30
|
const eqCssPrefix = 'eqjs';
|
|
31
31
|
const eqCssMobile = 'eqjs-mobile';
|
|
@@ -1434,6 +1434,16 @@ class MenuLevel {
|
|
|
1434
1434
|
levelStyle.top = y + 'px';
|
|
1435
1435
|
this.scrollDiv.style.width = "auto";
|
|
1436
1436
|
this.scrollDiv.style.height = "auto";
|
|
1437
|
+
if (this.parentMenu.options.useMaxSpace === false) {
|
|
1438
|
+
const winSize = ui.getWinSize().height;
|
|
1439
|
+
if (y > winSize / 2 && this.scrollDiv.scrollHeight > winSize / 2) {
|
|
1440
|
+
this.scrollDiv.style.height = (y - 16 - 56) + 'px';
|
|
1441
|
+
levelStyle.top = 0 + 'px';
|
|
1442
|
+
}
|
|
1443
|
+
else if (this.scrollDiv.scrollHeight > winSize / 2) {
|
|
1444
|
+
this.scrollDiv.style.height = (winSize - y - 56) + 'px';
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1437
1447
|
//adjusting level top position
|
|
1438
1448
|
if (adjustTopPos) {
|
|
1439
1449
|
y = this.adjustTopPos(y);
|
|
@@ -1468,16 +1478,15 @@ class MenuLevel {
|
|
|
1468
1478
|
if (this.closeDiv != null) {
|
|
1469
1479
|
maxHeight -= this.closeDiv.offsetHeight;
|
|
1470
1480
|
}
|
|
1471
|
-
if (this.levelDiv.offsetHeight > maxHeight) {
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
}
|
|
1481
|
+
// if (this.levelDiv.offsetHeight > maxHeight) {
|
|
1482
|
+
// let newHeight = maxHeight;
|
|
1483
|
+
// if (newHeight < 50) { newHeight = 50; }
|
|
1484
|
+
//
|
|
1485
|
+
// this.scrollDiv.style.height = newHeight + "px";
|
|
1486
|
+
// }
|
|
1487
|
+
// else {
|
|
1488
|
+
// this.scrollDiv.style.height = "auto";
|
|
1489
|
+
// }
|
|
1481
1490
|
this.activeItem = null;
|
|
1482
1491
|
}
|
|
1483
1492
|
focus() {
|
|
@@ -1619,7 +1628,8 @@ class PopupMenu {
|
|
|
1619
1628
|
container: document.body,
|
|
1620
1629
|
domWriteItemsId: false,
|
|
1621
1630
|
itemRenderedCallback: null,
|
|
1622
|
-
showItemIds: false
|
|
1631
|
+
showItemIds: false,
|
|
1632
|
+
useMaxSpace: true,
|
|
1623
1633
|
};
|
|
1624
1634
|
if (options) {
|
|
1625
1635
|
core$1.utils.assign(this.options, options);
|
|
@@ -1781,7 +1791,16 @@ class PopupMenu {
|
|
|
1781
1791
|
const leftSpace = pos.x + anchorWidth - scroll.left;
|
|
1782
1792
|
const rightSpace = winSize.width - leftSpace + anchorWidth;
|
|
1783
1793
|
pos.x += 2;
|
|
1784
|
-
this.
|
|
1794
|
+
if (this.options.useMaxSpace === true) {
|
|
1795
|
+
this.rootLevel.showAt(pos.x, pos.y, true, true);
|
|
1796
|
+
}
|
|
1797
|
+
else {
|
|
1798
|
+
// console.log(this.rootLevel.levelDiv)
|
|
1799
|
+
// if (this.rootLevel.levelDiv.scrollHeight > 500 && pos.y > winSize.height / 2) {
|
|
1800
|
+
// pos.y = 0
|
|
1801
|
+
// }
|
|
1802
|
+
this.rootLevel.showAt(pos.x, pos.y, false, true);
|
|
1803
|
+
}
|
|
1785
1804
|
this.rootLevel.levelDiv.style.width = '';
|
|
1786
1805
|
this.rootLevel.levelDiv.style.right = '';
|
|
1787
1806
|
if (!this.rootLevel.levelDiv.style.zIndex) {
|
|
@@ -2742,6 +2761,7 @@ class AttrColumnRendererCP extends ColumnRendererCP {
|
|
|
2742
2761
|
.title(attrCaption)
|
|
2743
2762
|
.text(attrCaption) //TO DO:add localization
|
|
2744
2763
|
.on('click', (ev) => {
|
|
2764
|
+
console.log("columns expression click");
|
|
2745
2765
|
ev.stopPropagation();
|
|
2746
2766
|
this.activate();
|
|
2747
2767
|
this.panel.showEntitiesMenu({
|
|
@@ -3407,6 +3427,7 @@ class ColumnsPanel extends core.Widget {
|
|
|
3407
3427
|
.attr('href', 'javascript:void(0)')
|
|
3408
3428
|
.text(core$1.i18n.getText('CmdClickToAddColumn'))
|
|
3409
3429
|
.on('click', (e) => {
|
|
3430
|
+
console.log("Add new column");
|
|
3410
3431
|
e.preventDefault();
|
|
3411
3432
|
this.showEntitiesMenu({
|
|
3412
3433
|
anchor: e.target,
|
|
@@ -7988,7 +8009,8 @@ class QueryPanel extends core.Widget {
|
|
|
7988
8009
|
return new PopupMenu(options);
|
|
7989
8010
|
}
|
|
7990
8011
|
showEntitiesMenu(options) {
|
|
7991
|
-
this.entitiesMenu.showMenu(options);
|
|
8012
|
+
this.entitiesMenu.showMenu(Object.assign({}, this.options.menuOptions, options));
|
|
8013
|
+
// this.entitiesMenu.showMenu(options);
|
|
7992
8014
|
}
|
|
7993
8015
|
createConditionMenus() {
|
|
7994
8016
|
//ConditionMenu
|
|
@@ -8285,6 +8307,7 @@ class FilterBar extends core.Widget {
|
|
|
8285
8307
|
.text(core$1.i18n.getText('StrNoFilterClickToAdd'))
|
|
8286
8308
|
.hide()
|
|
8287
8309
|
.on('click', () => {
|
|
8310
|
+
console.log("condition filter click");
|
|
8288
8311
|
this.queryPanel.showEntitiesMenu({
|
|
8289
8312
|
anchor: this.headerLinkElement,
|
|
8290
8313
|
selectedIds: null,
|
|
@@ -8683,9 +8706,10 @@ class EasyGridWidget extends Grid {
|
|
|
8683
8706
|
* @param options The options.
|
|
8684
8707
|
*/
|
|
8685
8708
|
init(context, options) {
|
|
8709
|
+
var _a, _b;
|
|
8686
8710
|
super.init(context, options);
|
|
8687
|
-
const gridOptions = Object.assign(Object.assign({}, options), { slot: this.slot, dataTable: context.resultTable });
|
|
8688
|
-
this.options = core$1.utils.assign(this.options,
|
|
8711
|
+
const gridOptions = Object.assign(Object.assign(Object.assign(Object.assign({}, (_a = context.options.widgets) === null || _a === void 0 ? void 0 : _a.resultGrid), (_b = context.options.widgets) === null || _b === void 0 ? void 0 : _b.easyGrid), options), { slot: this.slot, dataTable: context.resultTable });
|
|
8712
|
+
this.options = core$1.utils.assign(this.options, gridOptions);
|
|
8689
8713
|
gridOptions.onPlusButtonClick = (ev) => this.addColumnClickHandler(ev);
|
|
8690
8714
|
gridOptions.onColumnMoved = (ev) => this.columnMovedHandler(ev);
|
|
8691
8715
|
if (gridOptions.aggregates) {
|
|
@@ -12389,9 +12413,7 @@ class View {
|
|
|
12389
12413
|
if (this.context.getQuery().isEmpty() && !this.resultOptions.fetchEmptyQueries)
|
|
12390
12414
|
return;
|
|
12391
12415
|
this.showResultSpinner();
|
|
12392
|
-
this.context.fetchData({
|
|
12393
|
-
elasticPaging: options.elasticPaging,
|
|
12394
|
-
success: (result) => {
|
|
12416
|
+
this.context.fetchData(Object.assign(Object.assign({}, options), { elasticPaging: options.elasticPaging, success: (result) => {
|
|
12395
12417
|
this.hideResultSpinner();
|
|
12396
12418
|
this.toggleExportButtons();
|
|
12397
12419
|
this.displayRecordsCount(this.context.resultTable.getTotal());
|
|
@@ -12404,11 +12426,9 @@ class View {
|
|
|
12404
12426
|
if (options.success) {
|
|
12405
12427
|
options.success(result);
|
|
12406
12428
|
}
|
|
12407
|
-
},
|
|
12408
|
-
error: () => {
|
|
12429
|
+
}, error: () => {
|
|
12409
12430
|
this.hideResultSpinner();
|
|
12410
|
-
}
|
|
12411
|
-
});
|
|
12431
|
+
} }));
|
|
12412
12432
|
}
|
|
12413
12433
|
toggleExportButtons() {
|
|
12414
12434
|
if (this.enableExport && this.context.resultTable
|
|
@@ -13457,7 +13477,7 @@ class ReportView extends View {
|
|
|
13457
13477
|
this.syncReportOnChange = true;
|
|
13458
13478
|
this._reportSaveTemplate = `<div id="kdlg-dialog-form" class="kfrm-form">
|
|
13459
13479
|
<div class="kfrm-fields label-above">
|
|
13460
|
-
<label for="kdlg-dialog-form-input" id="kdlg-dialog-form-
|
|
13480
|
+
<label for="kdlg-dialog-form-input" id="kdlg-dialog-form-name-label"></label>
|
|
13461
13481
|
<input type="text" name="kdlg-dialog-form-input" id="kdlg-dialog-form-input" />
|
|
13462
13482
|
<label for="kdlg-dialog-form-textarea" id="kdlg-dialog-form-desc-label"></label>
|
|
13463
13483
|
<textarea type="text" name="kdlg-dialog-form-textarea" id="kdlg-dialog-form-textarea"></textarea>
|
|
@@ -13650,13 +13670,13 @@ class ReportView extends View {
|
|
|
13650
13670
|
submitOnEnter: true,
|
|
13651
13671
|
arrangeParents: false,
|
|
13652
13672
|
beforeOpen: () => {
|
|
13653
|
-
const
|
|
13654
|
-
|
|
13655
|
-
const
|
|
13656
|
-
|
|
13657
|
-
const
|
|
13658
|
-
|
|
13659
|
-
|
|
13673
|
+
const nameInput = document.getElementById(`kdlg-dialog-form-input`);
|
|
13674
|
+
nameInput.value = core$1.i18n.getText('NewReportDefName');
|
|
13675
|
+
const nameLabel = document.getElementById('kdlg-dialog-form-name-label');
|
|
13676
|
+
nameLabel.innerHTML = core$1.i18n.getText('SaveReportDlgLabel');
|
|
13677
|
+
const descLabel = document.getElementById('kdlg-dialog-form-desc-label');
|
|
13678
|
+
descLabel.innerHTML = core$1.i18n.getText('ReportDescLabel');
|
|
13679
|
+
nameInput.focus();
|
|
13660
13680
|
},
|
|
13661
13681
|
onSubmit: () => {
|
|
13662
13682
|
const nameInput = document.getElementById(`kdlg-dialog-form-input`);
|
|
@@ -13749,12 +13769,12 @@ class ReportView extends View {
|
|
|
13749
13769
|
beforeOpen: () => {
|
|
13750
13770
|
const input = document.getElementById(`kdlg-dialog-form-input`);
|
|
13751
13771
|
input.value = query.getName();
|
|
13752
|
-
const content = document.getElementById('kdlg-dialog-form-
|
|
13772
|
+
const content = document.getElementById('kdlg-dialog-form-name-label');
|
|
13753
13773
|
content.innerHTML = core$1.i18n.getText('SaveReportDlgLabel');
|
|
13754
13774
|
const label = document.getElementById('kdlg-dialog-form-desc-label');
|
|
13755
13775
|
label.innerHTML = core$1.i18n.getText('ReportDescLabel');
|
|
13756
13776
|
const text = document.getElementById(`kdlg-dialog-form-textarea`);
|
|
13757
|
-
text.
|
|
13777
|
+
text.innerText = query.getDescription();
|
|
13758
13778
|
input.focus();
|
|
13759
13779
|
},
|
|
13760
13780
|
onSubmit: () => {
|
|
@@ -13924,7 +13944,7 @@ class ReportView extends View {
|
|
|
13924
13944
|
this.loadReportButton = null;
|
|
13925
13945
|
}
|
|
13926
13946
|
if (this.saveReportButton) {
|
|
13927
|
-
this.saveReportButton.
|
|
13947
|
+
this.saveReportButton.removeEventListener('click', this.saveReportButtonClickHandler);
|
|
13928
13948
|
this.saveReportButton = null;
|
|
13929
13949
|
}
|
|
13930
13950
|
if (this.removeReportButton) {
|
package/dist/easyquery.ui.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { utils, i18n, DataType, EasyDataTable, AggregationSettings } from '@easydata/core';
|
|
2
2
|
import { Widget, WidgetGroup, QueryChangePart, QueryChangeAction, ExprTag, SortDirection, i18n as i18n$1, equtils, eqconsts, ConditionPart, DataKind, Query, Expression, CondTag, EqEditorTag, EqValueEditor, EqServiceProvider, createEqContext } from '@easyquery/core';
|
|
3
|
-
import { browserUtils, eqDragManager, getElementAbsolutePos, getScrollPos, getWinSize, getViewportSize,
|
|
3
|
+
import { browserUtils, eqDragManager, domel, getElementAbsolutePos, getScrollPos, getWinSize, getViewportSize, DropEffect, createBrowserEvent, DomElementBuilder, DefaultDateTimePicker, slideDown, slideUp, EasyGrid, addCssClass, hideElement, showElement, isVisible, toggleVisibility, addElement, DefaultDialogService } from '@easydata/ui';
|
|
4
4
|
|
|
5
5
|
function findHighestZIndex(elem) {
|
|
6
6
|
let highest = 0;
|
|
@@ -19,11 +19,11 @@ function findHighestZIndex(elem) {
|
|
|
19
19
|
}
|
|
20
20
|
// simetimes setting focus in the main thread doesn't work correctly (in Firefox). So we need to 'hack' it.
|
|
21
21
|
function safeFocus(element) {
|
|
22
|
-
setTimeout(
|
|
23
|
-
if (
|
|
24
|
-
|
|
22
|
+
setTimeout((el) => {
|
|
23
|
+
if (el && el.focus) {
|
|
24
|
+
el.focus();
|
|
25
25
|
}
|
|
26
|
-
}, 100);
|
|
26
|
+
}, 100, element);
|
|
27
27
|
}
|
|
28
28
|
const eqCssPrefix = 'eqjs';
|
|
29
29
|
const eqCssMobile = 'eqjs-mobile';
|
|
@@ -1432,6 +1432,16 @@ class MenuLevel {
|
|
|
1432
1432
|
levelStyle.top = y + 'px';
|
|
1433
1433
|
this.scrollDiv.style.width = "auto";
|
|
1434
1434
|
this.scrollDiv.style.height = "auto";
|
|
1435
|
+
if (this.parentMenu.options.useMaxSpace === false) {
|
|
1436
|
+
const winSize = getWinSize().height;
|
|
1437
|
+
if (y > winSize / 2 && this.scrollDiv.scrollHeight > winSize / 2) {
|
|
1438
|
+
this.scrollDiv.style.height = (y - 16 - 56) + 'px';
|
|
1439
|
+
levelStyle.top = 0 + 'px';
|
|
1440
|
+
}
|
|
1441
|
+
else if (this.scrollDiv.scrollHeight > winSize / 2) {
|
|
1442
|
+
this.scrollDiv.style.height = (winSize - y - 56) + 'px';
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1435
1445
|
//adjusting level top position
|
|
1436
1446
|
if (adjustTopPos) {
|
|
1437
1447
|
y = this.adjustTopPos(y);
|
|
@@ -1466,16 +1476,15 @@ class MenuLevel {
|
|
|
1466
1476
|
if (this.closeDiv != null) {
|
|
1467
1477
|
maxHeight -= this.closeDiv.offsetHeight;
|
|
1468
1478
|
}
|
|
1469
|
-
if (this.levelDiv.offsetHeight > maxHeight) {
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
}
|
|
1479
|
+
// if (this.levelDiv.offsetHeight > maxHeight) {
|
|
1480
|
+
// let newHeight = maxHeight;
|
|
1481
|
+
// if (newHeight < 50) { newHeight = 50; }
|
|
1482
|
+
//
|
|
1483
|
+
// this.scrollDiv.style.height = newHeight + "px";
|
|
1484
|
+
// }
|
|
1485
|
+
// else {
|
|
1486
|
+
// this.scrollDiv.style.height = "auto";
|
|
1487
|
+
// }
|
|
1479
1488
|
this.activeItem = null;
|
|
1480
1489
|
}
|
|
1481
1490
|
focus() {
|
|
@@ -1617,7 +1626,8 @@ class PopupMenu {
|
|
|
1617
1626
|
container: document.body,
|
|
1618
1627
|
domWriteItemsId: false,
|
|
1619
1628
|
itemRenderedCallback: null,
|
|
1620
|
-
showItemIds: false
|
|
1629
|
+
showItemIds: false,
|
|
1630
|
+
useMaxSpace: true,
|
|
1621
1631
|
};
|
|
1622
1632
|
if (options) {
|
|
1623
1633
|
utils.assign(this.options, options);
|
|
@@ -1779,7 +1789,16 @@ class PopupMenu {
|
|
|
1779
1789
|
const leftSpace = pos.x + anchorWidth - scroll.left;
|
|
1780
1790
|
const rightSpace = winSize.width - leftSpace + anchorWidth;
|
|
1781
1791
|
pos.x += 2;
|
|
1782
|
-
this.
|
|
1792
|
+
if (this.options.useMaxSpace === true) {
|
|
1793
|
+
this.rootLevel.showAt(pos.x, pos.y, true, true);
|
|
1794
|
+
}
|
|
1795
|
+
else {
|
|
1796
|
+
// console.log(this.rootLevel.levelDiv)
|
|
1797
|
+
// if (this.rootLevel.levelDiv.scrollHeight > 500 && pos.y > winSize.height / 2) {
|
|
1798
|
+
// pos.y = 0
|
|
1799
|
+
// }
|
|
1800
|
+
this.rootLevel.showAt(pos.x, pos.y, false, true);
|
|
1801
|
+
}
|
|
1783
1802
|
this.rootLevel.levelDiv.style.width = '';
|
|
1784
1803
|
this.rootLevel.levelDiv.style.right = '';
|
|
1785
1804
|
if (!this.rootLevel.levelDiv.style.zIndex) {
|
|
@@ -2740,6 +2759,7 @@ class AttrColumnRendererCP extends ColumnRendererCP {
|
|
|
2740
2759
|
.title(attrCaption)
|
|
2741
2760
|
.text(attrCaption) //TO DO:add localization
|
|
2742
2761
|
.on('click', (ev) => {
|
|
2762
|
+
console.log("columns expression click");
|
|
2743
2763
|
ev.stopPropagation();
|
|
2744
2764
|
this.activate();
|
|
2745
2765
|
this.panel.showEntitiesMenu({
|
|
@@ -3405,6 +3425,7 @@ class ColumnsPanel extends Widget {
|
|
|
3405
3425
|
.attr('href', 'javascript:void(0)')
|
|
3406
3426
|
.text(i18n.getText('CmdClickToAddColumn'))
|
|
3407
3427
|
.on('click', (e) => {
|
|
3428
|
+
console.log("Add new column");
|
|
3408
3429
|
e.preventDefault();
|
|
3409
3430
|
this.showEntitiesMenu({
|
|
3410
3431
|
anchor: e.target,
|
|
@@ -7986,7 +8007,8 @@ class QueryPanel extends Widget {
|
|
|
7986
8007
|
return new PopupMenu(options);
|
|
7987
8008
|
}
|
|
7988
8009
|
showEntitiesMenu(options) {
|
|
7989
|
-
this.entitiesMenu.showMenu(options);
|
|
8010
|
+
this.entitiesMenu.showMenu(Object.assign({}, this.options.menuOptions, options));
|
|
8011
|
+
// this.entitiesMenu.showMenu(options);
|
|
7990
8012
|
}
|
|
7991
8013
|
createConditionMenus() {
|
|
7992
8014
|
//ConditionMenu
|
|
@@ -8283,6 +8305,7 @@ class FilterBar extends Widget {
|
|
|
8283
8305
|
.text(i18n.getText('StrNoFilterClickToAdd'))
|
|
8284
8306
|
.hide()
|
|
8285
8307
|
.on('click', () => {
|
|
8308
|
+
console.log("condition filter click");
|
|
8286
8309
|
this.queryPanel.showEntitiesMenu({
|
|
8287
8310
|
anchor: this.headerLinkElement,
|
|
8288
8311
|
selectedIds: null,
|
|
@@ -8681,9 +8704,10 @@ class EasyGridWidget extends Grid {
|
|
|
8681
8704
|
* @param options The options.
|
|
8682
8705
|
*/
|
|
8683
8706
|
init(context, options) {
|
|
8707
|
+
var _a, _b;
|
|
8684
8708
|
super.init(context, options);
|
|
8685
|
-
const gridOptions = Object.assign(Object.assign({}, options), { slot: this.slot, dataTable: context.resultTable });
|
|
8686
|
-
this.options = utils.assign(this.options,
|
|
8709
|
+
const gridOptions = Object.assign(Object.assign(Object.assign(Object.assign({}, (_a = context.options.widgets) === null || _a === void 0 ? void 0 : _a.resultGrid), (_b = context.options.widgets) === null || _b === void 0 ? void 0 : _b.easyGrid), options), { slot: this.slot, dataTable: context.resultTable });
|
|
8710
|
+
this.options = utils.assign(this.options, gridOptions);
|
|
8687
8711
|
gridOptions.onPlusButtonClick = (ev) => this.addColumnClickHandler(ev);
|
|
8688
8712
|
gridOptions.onColumnMoved = (ev) => this.columnMovedHandler(ev);
|
|
8689
8713
|
if (gridOptions.aggregates) {
|
|
@@ -12387,9 +12411,7 @@ class View {
|
|
|
12387
12411
|
if (this.context.getQuery().isEmpty() && !this.resultOptions.fetchEmptyQueries)
|
|
12388
12412
|
return;
|
|
12389
12413
|
this.showResultSpinner();
|
|
12390
|
-
this.context.fetchData({
|
|
12391
|
-
elasticPaging: options.elasticPaging,
|
|
12392
|
-
success: (result) => {
|
|
12414
|
+
this.context.fetchData(Object.assign(Object.assign({}, options), { elasticPaging: options.elasticPaging, success: (result) => {
|
|
12393
12415
|
this.hideResultSpinner();
|
|
12394
12416
|
this.toggleExportButtons();
|
|
12395
12417
|
this.displayRecordsCount(this.context.resultTable.getTotal());
|
|
@@ -12402,11 +12424,9 @@ class View {
|
|
|
12402
12424
|
if (options.success) {
|
|
12403
12425
|
options.success(result);
|
|
12404
12426
|
}
|
|
12405
|
-
},
|
|
12406
|
-
error: () => {
|
|
12427
|
+
}, error: () => {
|
|
12407
12428
|
this.hideResultSpinner();
|
|
12408
|
-
}
|
|
12409
|
-
});
|
|
12429
|
+
} }));
|
|
12410
12430
|
}
|
|
12411
12431
|
toggleExportButtons() {
|
|
12412
12432
|
if (this.enableExport && this.context.resultTable
|
|
@@ -13455,7 +13475,7 @@ class ReportView extends View {
|
|
|
13455
13475
|
this.syncReportOnChange = true;
|
|
13456
13476
|
this._reportSaveTemplate = `<div id="kdlg-dialog-form" class="kfrm-form">
|
|
13457
13477
|
<div class="kfrm-fields label-above">
|
|
13458
|
-
<label for="kdlg-dialog-form-input" id="kdlg-dialog-form-
|
|
13478
|
+
<label for="kdlg-dialog-form-input" id="kdlg-dialog-form-name-label"></label>
|
|
13459
13479
|
<input type="text" name="kdlg-dialog-form-input" id="kdlg-dialog-form-input" />
|
|
13460
13480
|
<label for="kdlg-dialog-form-textarea" id="kdlg-dialog-form-desc-label"></label>
|
|
13461
13481
|
<textarea type="text" name="kdlg-dialog-form-textarea" id="kdlg-dialog-form-textarea"></textarea>
|
|
@@ -13648,13 +13668,13 @@ class ReportView extends View {
|
|
|
13648
13668
|
submitOnEnter: true,
|
|
13649
13669
|
arrangeParents: false,
|
|
13650
13670
|
beforeOpen: () => {
|
|
13651
|
-
const
|
|
13652
|
-
|
|
13653
|
-
const
|
|
13654
|
-
|
|
13655
|
-
const
|
|
13656
|
-
|
|
13657
|
-
|
|
13671
|
+
const nameInput = document.getElementById(`kdlg-dialog-form-input`);
|
|
13672
|
+
nameInput.value = i18n.getText('NewReportDefName');
|
|
13673
|
+
const nameLabel = document.getElementById('kdlg-dialog-form-name-label');
|
|
13674
|
+
nameLabel.innerHTML = i18n.getText('SaveReportDlgLabel');
|
|
13675
|
+
const descLabel = document.getElementById('kdlg-dialog-form-desc-label');
|
|
13676
|
+
descLabel.innerHTML = i18n.getText('ReportDescLabel');
|
|
13677
|
+
nameInput.focus();
|
|
13658
13678
|
},
|
|
13659
13679
|
onSubmit: () => {
|
|
13660
13680
|
const nameInput = document.getElementById(`kdlg-dialog-form-input`);
|
|
@@ -13747,12 +13767,12 @@ class ReportView extends View {
|
|
|
13747
13767
|
beforeOpen: () => {
|
|
13748
13768
|
const input = document.getElementById(`kdlg-dialog-form-input`);
|
|
13749
13769
|
input.value = query.getName();
|
|
13750
|
-
const content = document.getElementById('kdlg-dialog-form-
|
|
13770
|
+
const content = document.getElementById('kdlg-dialog-form-name-label');
|
|
13751
13771
|
content.innerHTML = i18n.getText('SaveReportDlgLabel');
|
|
13752
13772
|
const label = document.getElementById('kdlg-dialog-form-desc-label');
|
|
13753
13773
|
label.innerHTML = i18n.getText('ReportDescLabel');
|
|
13754
13774
|
const text = document.getElementById(`kdlg-dialog-form-textarea`);
|
|
13755
|
-
text.
|
|
13775
|
+
text.innerText = query.getDescription();
|
|
13756
13776
|
input.focus();
|
|
13757
13777
|
},
|
|
13758
13778
|
onSubmit: () => {
|
|
@@ -13922,7 +13942,7 @@ class ReportView extends View {
|
|
|
13922
13942
|
this.loadReportButton = null;
|
|
13923
13943
|
}
|
|
13924
13944
|
if (this.saveReportButton) {
|
|
13925
|
-
this.saveReportButton.
|
|
13945
|
+
this.saveReportButton.removeEventListener('click', this.saveReportButtonClickHandler);
|
|
13926
13946
|
this.saveReportButton = null;
|
|
13927
13947
|
}
|
|
13928
13948
|
if (this.removeReportButton) {
|
|
@@ -119,6 +119,10 @@ export interface PopupMenuOptions {
|
|
|
119
119
|
showSelected?: boolean;
|
|
120
120
|
/** If true - the menu will show the ID for each item (e.g. {itemId}:{itemText}) */
|
|
121
121
|
showItemIds?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* If true, popup use max available space
|
|
124
|
+
*/
|
|
125
|
+
useMaxSpace?: boolean;
|
|
122
126
|
}
|
|
123
127
|
export declare class PopupMenu {
|
|
124
128
|
private static lastMenuID;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Widget, EqContext, WidgetGroup, EqServiceProvider } from '@easyquery/core';
|
|
1
|
+
import { Widget, EqContext, WidgetGroup, EqServiceProvider, ContextFetchDataOptions } from '@easyquery/core';
|
|
2
2
|
import { DialogService } from '@easydata/ui';
|
|
3
3
|
import { EqViewOptions, EqResultOptions } from './view_options';
|
|
4
4
|
export declare abstract class View {
|
|
@@ -52,7 +52,7 @@ export declare abstract class View {
|
|
|
52
52
|
* Fetches the data according to the query and other options defined in the context.
|
|
53
53
|
* @param options The options.
|
|
54
54
|
*/
|
|
55
|
-
fetchData(options?:
|
|
55
|
+
fetchData(options?: ContextFetchDataOptions): void;
|
|
56
56
|
protected enableExport: boolean;
|
|
57
57
|
protected toggleExportButtons(): void;
|
|
58
58
|
protected enableExportButtons(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easyquery/ui",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.4",
|
|
4
4
|
"description": "EasyQuery.JS Community UI widgets",
|
|
5
5
|
"types": "./dist/types/public_api.d.ts",
|
|
6
6
|
"main": "./dist/easyquery.ui.cjs.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"bugs": "https://korzh.com/support",
|
|
31
31
|
"license": "LGPL-3.0",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@easyquery/core": "^7.3.
|
|
33
|
+
"@easyquery/core": "^7.3.4"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"dist",
|